Skip to content

Commit 3d6d695

Browse files
t3mimatthchr
andauthored
feat(helm): allow hardcodes to be configurable (#4207)
* feat(helm): allow hardcodes to be configurable Signed-off-by: t3mi <[email protected]> * docs: update comment for container security context Co-authored-by: Matthew Christopher <[email protected]> --------- Signed-off-by: t3mi <[email protected]> Co-authored-by: Matthew Christopher <[email protected]>
1 parent 1ae868d commit 3d6d695

File tree

3 files changed

+75
-19
lines changed

3 files changed

+75
-19
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{{if .Values.aadPodIdentity.enable}}
1+
{{- if .Values.aadPodIdentity.enable }}
22
apiVersion: "aadpodidentity.k8s.io/v1"
33
kind: AzureIdentity
44
metadata:
55
name: aso-identity
6-
namespace: {{.Release.Namespace}}
6+
namespace: {{ .Release.Namespace }}
77
spec:
88
type: 0
99
resourceID: {{ .Values.aadPodIdentity.azureManagedIdentityResourceId }}
@@ -13,8 +13,8 @@ apiVersion: "aadpodidentity.k8s.io/v1"
1313
kind: AzureIdentityBinding
1414
metadata:
1515
name: aso-identity-binding
16-
namespace: {{.Release.Namespace}}
16+
namespace: {{ .Release.Namespace }}
1717
spec:
1818
azureIdentity: aso-identity
1919
selector: aso-manager-binding
20-
{{ end }}
20+
{{- end }}

v2/charts/azure-service-operator/templates/apps_v1_deployment_azureserviceoperator-controller-manager.yaml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4+
{{- with .Values.deploymentAnnotations }}
5+
annotations:
6+
{{- toYaml . | nindent 4 }}
7+
{{- end }}
48
labels:
59
app.kubernetes.io/name: azure-service-operator
610
app.kubernetes.io/version: v2.9.0
@@ -9,23 +13,27 @@ metadata:
913
namespace: {{ .Release.Namespace }}
1014
spec:
1115
replicas: 1
16+
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
1217
selector:
1318
matchLabels:
1419
control-plane: controller-manager
1520
template:
1621
metadata:
1722
annotations:
18-
{{- if .Values.podAnnotations }}
19-
{{ toYaml .Values.podAnnotations }}
23+
{{- with .Values.podAnnotations }}
24+
{{- toYaml . | nindent 8}}
2025
{{- end }}
2126
kubectl.kubernetes.io/default-container: manager
2227
labels:
23-
{{- if or (eq .Values.multitenant.enable false) (eq .Values.azureOperatorMode "watchers") }}
28+
{{- if .Values.aadPodIdentity.enable }}
2429
aadpodidbinding: aso-manager-binding
2530
{{- end }}
2631
app.kubernetes.io/name: azure-service-operator
2732
app.kubernetes.io/version: v2.9.0
2833
control-plane: controller-manager
34+
{{- with .Values.podLabels }}
35+
{{- toYaml . | nindent 8 }}
36+
{{- end }}
2937
spec:
3038
{{- with .Values.tolerations }}
3139
tolerations:
@@ -191,16 +199,14 @@ spec:
191199
path: /readyz
192200
port: 8081
193201
initialDelaySeconds: 60
202+
{{- with .Values.resources }}
194203
resources:
195-
limits:
196-
cpu: 500m
197-
memory: 512Mi
198-
requests:
199-
cpu: 200m
200-
memory: 256Mi
204+
{{- toYaml . | nindent 10 }}
205+
{{- end }}
206+
{{- with .Values.securityContext }}
201207
securityContext:
202-
allowPrivilegeEscalation: false
203-
readOnlyRootFilesystem: true
208+
{{- toYaml . | nindent 10 }}
209+
{{- end }}
204210
volumeMounts:
205211
- mountPath: /var/run/secrets/tokens
206212
name: azure-identity
@@ -210,8 +216,17 @@ spec:
210216
name: cert
211217
readOnly: true
212218
{{- end }}
219+
{{- with .Values.nodeSelector }}
213220
nodeSelector:
214-
kubernetes.io/os: linux
221+
{{- toYaml . | nindent 8 }}
222+
{{- end }}
223+
{{- with .Values.priorityClassName }}
224+
priorityClassName: "{{ . }}"
225+
{{- end }}
226+
{{- with .Values.podSecurityContext }}
227+
securityContext:
228+
{{- toYaml . | nindent 8 }}
229+
{{- end }}
215230
serviceAccountName: {{ include "azure-service-operator.serviceAccountName" . }}
216231
terminationGracePeriodSeconds: 10
217232
volumes:

v2/charts/azure-service-operator/values.yaml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ installCRDs: true
132132
# together to enable other scenarios, such as dbformysql.azure.com/FlexibleServersFirewallRules, and it's generally
133133
# easier to just include the whole group.
134134
# See https://azure.github.io/azure-service-operator/guide/crd-management for more details.
135-
crdPattern: ''
135+
crdPattern: ""
136136

137-
# podAnnotations contain the pod annotations for Azure Service Operator
138-
podAnnotations: {}
137+
# deploymentAnnotations contain the deployment annotations for Azure Service Operator
138+
deploymentAnnotations: {}
139139

140140
# multitenant contains the value to enable multi-tenant mode for ASOv2. If multitenant.enable is true + azureOperatorMode set to "webhooks", chart will
141141
# install a cluster and if multitenant.enable is true + azureOperatorMode set to "watchers", chart will install a tenant.
@@ -155,6 +155,47 @@ networkPolicies:
155155
# Destination CIDR for talking to PostgreSQL servers
156156
postgresqlCIDR: 0.0.0.0/0
157157

158+
# Node labels for pod assignment
159+
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
160+
nodeSelector:
161+
kubernetes.io/os: linux
162+
163+
# podAnnotations contain the pod annotations for Azure Service Operator
164+
podAnnotations: {}
165+
166+
# Labels to be added to the pod
167+
podLabels: {}
168+
169+
# The securityContext of the pod
170+
# See https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
171+
podSecurityContext: {}
172+
173+
# Assign a PriorityClassName to pods if set
174+
priorityClassName: ""
175+
176+
# Recomended initial values for resources
177+
# adjust them as necessary
178+
resources:
179+
limits:
180+
cpu: 500m
181+
memory: 512Mi
182+
requests:
183+
cpu: 200m
184+
memory: 256Mi
185+
186+
# Number of old history to retain to allow rollback
187+
# Default Kubernetes value is set to 10
188+
revisionHistoryLimit: 10
189+
190+
# Specify security settings for a Container
191+
# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
192+
# It is not recommended to reduce the restrictions in this list, but additional restrictions outside of the default set
193+
# can be applied. If you believe additional securityContext configuration should be specified by default
194+
# please raise an issue.
195+
securityContext:
196+
allowPrivilegeEscalation: false
197+
readOnlyRootFilesystem: true
198+
158199
# Tolerations are applied to pods. Tolerations allow the scheduler to schedule pods with matching taints. Tolerations allow scheduling but don't guarantee scheduling
159200
# For more information, see https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration.
160201
tolerations: []

0 commit comments

Comments
 (0)