Commit 9b75510
authored
Add Helm overrides for env vars, volumes and volume mounts (#449)
Issue #, if available: aws-controllers-k8s/community#919
Description of changes:
Adds additional Helm chart value overrides for deployment environment variables, volumes and volume mounts.
When deploying the `s3-controller` with the following `values.yaml` overrides:
```yaml
deployment:
extraVolumes:
- name: test-volume
secret:
secretName: test-secret
extraVolumeMounts:
- name: test-volume-mount
mountPath: /root/
extraEnvVars:
- name: SOMEVAR
value: somevalue
- name: PASSWORD
valueFrom:
secretKeyRef:
name: mysecret
key: password
optional: false
```
`helm template` produces the following output:
```yaml
# Source: s3-chart/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: release-name-s3-chart
namespace: default
labels:
app.kubernetes.io/name: s3-chart
app.kubernetes.io/instance: release-name
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: "1.0.4"
k8s-app: s3-chart
helm.sh/chart: s3-chart-1.0.4
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: s3-chart
app.kubernetes.io/instance: release-name
template:
metadata:
labels:
app.kubernetes.io/name: s3-chart
app.kubernetes.io/instance: release-name
app.kubernetes.io/managed-by: Helm
k8s-app: s3-chart
spec:
serviceAccountName: ack-s3-controller
containers:
- command:
- ./bin/controller
args:
- --aws-region
- "$(AWS_REGION)"
- --aws-endpoint-url
- "$(AWS_ENDPOINT_URL)"
- --enable-development-logging
- "$(ACK_ENABLE_DEVELOPMENT_LOGGING)"
- --log-level
- "$(ACK_LOG_LEVEL)"
- --resource-tags
- "$(ACK_RESOURCE_TAGS)"
- --watch-namespace
- "$(ACK_WATCH_NAMESPACE)"
- --deletion-policy
- "$(DELETION_POLICY)"
image: public.ecr.aws/aws-controllers-k8s/s3-controller:1.0.4
imagePullPolicy: IfNotPresent
name: controller
ports:
- name: http
containerPort: 8080
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 50m
memory: 64Mi
env:
- name: ACK_SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: AWS_REGION
value:
- name: AWS_ENDPOINT_URL
value: ""
- name: ACK_WATCH_NAMESPACE
value:
- name: DELETION_POLICY
value: delete
- name: ACK_ENABLE_DEVELOPMENT_LOGGING
value: "false"
- name: ACK_LOG_LEVEL
value: "info"
- name: ACK_RESOURCE_TAGS
value: "services.k8s.aws/controller-version=%CONTROLLER_SERVICE%-%CONTROLLER_VERSION%,services.k8s.aws/namespace=%K8S_NAMESPACE%"
- name: SOMEVAR
value: somevalue
- name: PASSWORD
valueFrom:
secretKeyRef:
key: password
name: mysecret
optional: false
volumeMounts:
- mountPath: /root/
name: test-volume-mount
securityContext:
allowPrivilegeEscalation: false
privileged: false
runAsNonRoot: true
capabilities:
drop:
- ALL
securityContext:
seccompProfile:
type: RuntimeDefault
terminationGracePeriodSeconds: 10
nodeSelector:
kubernetes.io/os: linux
hostIPC: false
hostNetwork: false
hostPID: false
volumes:
- name: test-volume
secret:
secretName: test-secret
```
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.1 parent dbc9ad5 commit 9b75510
File tree
3 files changed
+43
-1
lines changed- templates/helm
- templates
3 files changed
+43
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
| 114 | + | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
112 | 122 | | |
113 | 123 | | |
114 | 124 | | |
| |||
133 | 143 | | |
134 | 144 | | |
135 | 145 | | |
136 | | - | |
137 | 146 | | |
| 147 | + | |
138 | 148 | | |
139 | 149 | | |
140 | 150 | | |
141 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
61 | 70 | | |
62 | 71 | | |
63 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
31 | 51 | | |
32 | 52 | | |
33 | 53 | | |
| |||
0 commit comments