Skip to content

Commit

Permalink
Fixed cluster role. Also implemented security context
Browse files Browse the repository at this point in the history
  • Loading branch information
glenndehaan committed Apr 27, 2023
1 parent 5261022 commit 6b5661d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion charts/kube-hook/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.2
version: 1.0.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 2 additions & 2 deletions charts/kube-hook/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# kube-hook

![Version: 1.0.2](https://img.shields.io/badge/Version-1.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
![Version: 1.0.3](https://img.shields.io/badge/Version-1.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

A Kubernetes Webhook server that allows you to remotely restart deployments

Expand Down Expand Up @@ -40,7 +40,7 @@ A Kubernetes Webhook server that allows you to remotely restart deployments
| replicaCount | int | `2` | Number of kube-hook replicas to deploy |
| resources | object | `{"limits":{"memory":"125Mi"},"requests":{"memory":"125Mi"}}` | Resources for pods. Evaluated as a template. |
| revisionHistoryLimit | int | `1` | Number of kube-hook revisions to keep |
| securityContext | object | `{}` | Security Context for kube-hook |
| securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsGroup":101,"runAsUser":101}` | Security Context for kube-hook |
| service.port | int | `3000` | Service HTTP port |
| service.type | string | `"ClusterIP"` | Service type |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
Expand Down
12 changes: 3 additions & 9 deletions charts/kube-hook/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@ metadata:
labels:
{{- include "kube-hook.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["deployments"]
verbs: ["get", "list", "update", "patch"]
- apiGroups: [""]
resources: ["replicasets"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list"]
- apiGroups: ["", "apps"]
resources: ["deployments", "replicasets", "pods"]
verbs: ["get", "list", "update", "patch"]
{{- end }}
16 changes: 9 additions & 7 deletions charts/kube-hook/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ podSecurityContext: {}
# fsGroup: 2000

# -- Security Context for kube-hook
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsGroup: 101
runAsUser: 101

service:
# -- Service type
Expand Down

0 comments on commit 6b5661d

Please sign in to comment.