Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Helm configuration for pod security context #467

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion charts/k6-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Kubernetes: `>=1.16.0-0`
| global.image.pullSecrets | list | `[]` | Optional set of global image pull secrets |
| global.image.registry | string | `""` | Global image registry to use if it needs to be overridden for some specific use cases (e.g local registries, custom images, ...) |
| installCRDs | bool | `true` | Installs CRDs as part of the release |
| manager | object | `{"containerSecurityContext":{},"env":[],"envFrom":[],"image":{"pullPolicy":"IfNotPresent","registry":"ghcr.io","repository":"grafana/k6-operator","tag":"controller-v0.0.17"},"livenessProbe":{},"readinessProbe":{},"replicas":1,"resources":{"limits":{"cpu":"100m","memory":"100Mi"},"requests":{"cpu":"100m","memory":"50Mi"}},"serviceAccount":{"create":true,"name":"k6-operator-controller"}}` | controller-manager configuration |
| manager | object | `{"containerSecurityContext":{},"env":[],"envFrom":[],"image":{"pullPolicy":"IfNotPresent","registry":"ghcr.io","repository":"grafana/k6-operator","tag":"controller-v0.0.17"},"livenessProbe":{},"podSecurityContext":{},"readinessProbe":{},"replicas":1,"resources":{"limits":{"cpu":"100m","memory":"100Mi"},"requests":{"cpu":"100m","memory":"50Mi"}},"serviceAccount":{"create":true,"name":"k6-operator-controller"}}` | controller-manager configuration |
| manager.containerSecurityContext | object | `{}` | A security context defines privileges and access control settings for the container. |
| manager.env | list | `[]` | List of environment variables to set in the controller |
| manager.envFrom | list | `[]` | List of sources to populate environment variables in the controller |
Expand All @@ -49,6 +49,7 @@ Kubernetes: `>=1.16.0-0`
| manager.image.repository | string | `"grafana/k6-operator"` | controller-manager image repository |
| manager.image.tag | string | `"controller-v0.0.17"` | controller-manager image tag |
| manager.livenessProbe | object | `{}` | Liveness probe in Probe format |
| manager.podSecurityContext | object | `{}` | A security context defines privileges and access control settings for a Pod |
| manager.readinessProbe | object | `{}` | Readiness probe in Probe format |
| manager.replicas | int | `1` | number of controller-manager replicas (default: 1) |
| manager.resources | object | `{"limits":{"cpu":"100m","memory":"100Mi"},"requests":{"cpu":"100m","memory":"50Mi"}}` | controller-manager Resources definition |
Expand Down
4 changes: 4 additions & 0 deletions charts/k6-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ spec:
{{- include "k6-operator.podAnnotations" . | default "" | nindent 8 }}
{{- end }}
spec:
{{- if .Values.manager.podSecurityContext }}
securityContext:
{{- toYaml .Values.manager.podSecurityContext | nindent 8 }}
{{- end }}
containers:
- name: manager
image: "{{ .Values.global.image.registry | default .Values.manager.image.registry }}/{{ .Values.manager.image.repository }}:{{ .Values.manager.image.tag }}"
Expand Down
6 changes: 6 additions & 0 deletions charts/k6-operator/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@
"title": "livenessProbe",
"type": "object"
},
"podSecurityContext": {
"additionalProperties": true,
"description": "manager.podSecurityContext -- A security context defines privileges and access control settings for a Pod",
"title": "podSecurityContext",
"type": "object"
},
"readinessProbe": {
"additionalProperties": true,
"description": "manager.readinessProbe -- Readiness probe in Probe format",
Expand Down
8 changes: 8 additions & 0 deletions charts/k6-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,11 @@ manager:
# @schema
# manager.containerSecurityContext -- A security context defines privileges and access control settings for the container.
containerSecurityContext: {}

# @schema
# additionalProperties: true
# required: false
# type: object
# @schema
# manager.podSecurityContext -- A security context defines privileges and access control settings for a pod.
podSecurityContext: {}
Loading