Skip to content

Commit

Permalink
feat: allow changing the name of container in audit and controlle man…
Browse files Browse the repository at this point in the history
…ager (#3759)

Signed-off-by: mozillazg <mozillazg101@gmail.com>
Co-authored-by: Jaydip Gabani <gabanijaydip@gmail.com>
  • Loading branch information
mozillazg and JaydipGabani authored Jan 8, 2025
1 parent f7b8add commit 23dfa15
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cmd/build/helmify/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ patchesJson6902:
kind: Deployment
name: gatekeeper-audit
patch: |-
- op: replace
path: /spec/template/spec/containers/0/name
value: "{{ .Values.audit.containerName }}"
- op: remove
path: /spec/template/spec/containers/0/resources/limits
- op: remove
Expand All @@ -125,6 +128,9 @@ patchesJson6902:
kind: Deployment
name: gatekeeper-controller-manager
patch: |-
- op: replace
path: /spec/template/spec/containers/0/name
value: "{{ .Values.controllerManager.containerName }}"
- op: remove
path: /spec/template/spec/containers/0/resources/limits
- op: remove
Expand Down
2 changes: 2 additions & 0 deletions cmd/build/helmify/static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ information._
| image.pullSecrets | Specify an array of imagePullSecrets | `[]` |
| resources | The resource request/limits for the container image | limits: 1 CPU, 512Mi, requests: 100mCPU, 256Mi |
| nodeSelector | The node selector to use for pod scheduling | `kubernetes.io/os: linux` |
| controllerManager.containerName | Container name for controller manager | `manager` |
| controllerManager.podLabels | The labels to add to the controller manager pod | `{}` |
| controllerManager.affinity | The node affinity to use for controller manager pod scheduling | `{}` |
| controllerManager.topologySpreadConstraints | The topology spread constraints to use for controller manager pod scheduling | `[]` |
Expand All @@ -205,6 +206,7 @@ information._
| controllerManager.networkPolicy.ingress | Additional ingress rules to be added to the controller manager network policy | `{}` |
| controllerManager.strategyType | The strategy type to use for Controller Manager deployment | `RollingUpdate` |
| controllerManager.strategyRollingUpdate | [RollingUpdate](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rolling-update-deployment) configuration for Controller Manager deployment | `{}` |
| audit.containerName | Container name for audit | `manager` |
| audit.podLabels | The labels to add to the audit pod | `{}` |
| audit.affinity | The node affinity to use for audit pod scheduling | `{}` |
| audit.topologySpreadConstraints | The topology spread constraints to use for audit pod scheduling | `[]` |
Expand Down
2 changes: 2 additions & 0 deletions cmd/build/helmify/static/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ enableRuntimeDefaultSeccompProfile: true
controllerManager:
serviceAccount:
name: gatekeeper-admin
containerName: manager
exemptNamespaces: []
exemptNamespacePrefixes: []
hostNetwork: false
Expand Down Expand Up @@ -227,6 +228,7 @@ controllerManager:
audit:
serviceAccount:
name: gatekeeper-admin
containerName: manager
hostNetwork: false
dnsPolicy: ClusterFirst
metricsPort: 8888
Expand Down
2 changes: 2 additions & 0 deletions manifest_staging/charts/gatekeeper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ information._
| image.pullSecrets | Specify an array of imagePullSecrets | `[]` |
| resources | The resource request/limits for the container image | limits: 1 CPU, 512Mi, requests: 100mCPU, 256Mi |
| nodeSelector | The node selector to use for pod scheduling | `kubernetes.io/os: linux` |
| controllerManager.containerName | Container name for controller manager | `manager` |
| controllerManager.podLabels | The labels to add to the controller manager pod | `{}` |
| controllerManager.affinity | The node affinity to use for controller manager pod scheduling | `{}` |
| controllerManager.topologySpreadConstraints | The topology spread constraints to use for controller manager pod scheduling | `[]` |
Expand All @@ -205,6 +206,7 @@ information._
| controllerManager.networkPolicy.ingress | Additional ingress rules to be added to the controller manager network policy | `{}` |
| controllerManager.strategyType | The strategy type to use for Controller Manager deployment | `RollingUpdate` |
| controllerManager.strategyRollingUpdate | [RollingUpdate](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rolling-update-deployment) configuration for Controller Manager deployment | `{}` |
| audit.containerName | Container name for audit | `manager` |
| audit.podLabels | The labels to add to the audit pod | `{}` |
| audit.affinity | The node affinity to use for audit pod scheduling | `{}` |
| audit.topologySpreadConstraints | The topology spread constraints to use for audit pod scheduling | `[]` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ spec:
path: /healthz
port: {{ .Values.audit.healthPort }}
timeoutSeconds: {{ .Values.audit.livenessTimeout }}
name: manager
name: '{{ .Values.audit.containerName }}'
ports:
- containerPort: {{ .Values.audit.metricsPort }}
name: metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ spec:
path: /healthz
port: {{ .Values.controllerManager.healthPort }}
timeoutSeconds: {{ .Values.controllerManager.livenessTimeout }}
name: manager
name: '{{ .Values.controllerManager.containerName }}'
ports:
- containerPort: {{ .Values.controllerManager.port }}
name: webhook-server
Expand Down
2 changes: 2 additions & 0 deletions manifest_staging/charts/gatekeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ enableRuntimeDefaultSeccompProfile: true
controllerManager:
serviceAccount:
name: gatekeeper-admin
containerName: manager
exemptNamespaces: []
exemptNamespacePrefixes: []
hostNetwork: false
Expand Down Expand Up @@ -227,6 +228,7 @@ controllerManager:
audit:
serviceAccount:
name: gatekeeper-admin
containerName: manager
hostNetwork: false
dnsPolicy: ClusterFirst
metricsPort: 8888
Expand Down

0 comments on commit 23dfa15

Please sign in to comment.