Skip to content

Commit 11ef722

Browse files
committed
feat: added extraEnv and extraEnvFrom to helm chart, readonly-fs
1 parent 2fbf6fb commit 11ef722

File tree

7 files changed

+118
-2
lines changed

7 files changed

+118
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN go build \
3131
FROM alpine:3.17
3232

3333
ARG USERNAME=steadybit
34-
ARG USER_UID=1000
34+
ARG USER_UID=10000
3535

3636
RUN adduser -u $USER_UID -D $USERNAME
3737

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ charttesting:
3535
helm unittest $$dir; \
3636
done
3737

38+
## chartlint: Lint charts
39+
.PHONY: chartlint
40+
chartlint:
41+
ct lint --config chartTesting.yaml
42+
3843
# ==================================================================================== #
3944
# BUILD
4045
# ==================================================================================== #

charts/steadybit-extension-http/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: steadybit-extension-http
33
description: Steadybit action implementation to check HTTP endpoints.
4-
version: 1.0.5
4+
version: 1.0.6
55
appVersion: latest
66
home: https://www.steadybit.com/
77
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png

charts/steadybit-extension-http/templates/deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ spec:
3030
cpu: {{ .Values.resources.limits.cpu }}
3131
env:
3232
{{- include "extensionlib.deployment.env" (list .) | nindent 12 }}
33+
{{- with .Values.extraEnv }}
34+
{{- toYaml . | nindent 12 }}
35+
{{- end }}
36+
{{- with .Values.extraEnvFrom }}
37+
envFrom:
38+
{{- toYaml . | nindent 12 }}
39+
{{- end }}
3340
volumeMounts:
3441
{{- include "extensionlib.deployment.volumeMounts" (list .) | nindent 12 }}
3542
livenessProbe:
@@ -40,6 +47,11 @@ spec:
4047
httpGet:
4148
path: /health/readiness
4249
port: 8081
50+
securityContext:
51+
readOnlyRootFilesystem: true
52+
runAsNonRoot: true
53+
runAsUser: 10000
54+
runAsGroup: 10000
4355
volumes:
4456
{{- include "extensionlib.deployment.volumes" (list .) | nindent 8 }}
4557
{{- with .Values.nodeSelector }}

charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ manifest should match snapshot with TLS:
4444
requests:
4545
cpu: 50m
4646
memory: 64Mi
47+
securityContext:
48+
readOnlyRootFilesystem: true
49+
runAsGroup: 10000
50+
runAsNonRoot: true
51+
runAsUser: 10000
4752
volumeMounts:
4853
- mountPath: /etc/extension/certificates/server-cert
4954
name: certificate-server-cert
@@ -53,6 +58,62 @@ manifest should match snapshot with TLS:
5358
secret:
5459
optional: false
5560
secretName: server-cert
61+
manifest should match snapshot with extra env vars:
62+
1: |
63+
apiVersion: apps/v1
64+
kind: Deployment
65+
metadata:
66+
labels: null
67+
name: RELEASE-NAME-steadybit-extension-http
68+
namespace: NAMESPACE
69+
spec:
70+
replicas: 1
71+
selector:
72+
matchLabels:
73+
app.kubernetes.io/name: steadybit-extension-http
74+
template:
75+
metadata:
76+
labels:
77+
app.kubernetes.io/name: steadybit-extension-http
78+
spec:
79+
containers:
80+
- env:
81+
- name: STEADYBIT_LOG_LEVEL
82+
value: INFO
83+
- name: STEADYBIT_LOG_FORMAT
84+
value: text
85+
- name: FOO
86+
value: bar
87+
envFrom:
88+
- configMapRef: null
89+
name: env-configmap
90+
- name: env-secrets
91+
secretRef: null
92+
image: ghcr.io/steadybit/extension-http:latest
93+
imagePullPolicy: Always
94+
livenessProbe:
95+
httpGet:
96+
path: /health/liveness
97+
port: 8081
98+
name: extension
99+
readinessProbe:
100+
httpGet:
101+
path: /health/readiness
102+
port: 8081
103+
resources:
104+
limits:
105+
cpu: 200m
106+
memory: 128Mi
107+
requests:
108+
cpu: 50m
109+
memory: 64Mi
110+
securityContext:
111+
readOnlyRootFilesystem: true
112+
runAsGroup: 10000
113+
runAsNonRoot: true
114+
runAsUser: 10000
115+
volumeMounts: null
116+
volumes: null
56117
manifest should match snapshot with mutual TLS:
57118
1: |
58119
apiVersion: apps/v1
@@ -101,6 +162,11 @@ manifest should match snapshot with mutual TLS:
101162
requests:
102163
cpu: 50m
103164
memory: 64Mi
165+
securityContext:
166+
readOnlyRootFilesystem: true
167+
runAsGroup: 10000
168+
runAsNonRoot: true
169+
runAsUser: 10000
104170
volumeMounts:
105171
- mountPath: /etc/extension/certificates/client-cert-a
106172
name: certificate-client-cert-a
@@ -159,5 +225,10 @@ manifest should match snapshot without TLS:
159225
requests:
160226
cpu: 50m
161227
memory: 64Mi
228+
securityContext:
229+
readOnlyRootFilesystem: true
230+
runAsGroup: 10000
231+
runAsNonRoot: true
232+
runAsUser: 10000
162233
volumeMounts: null
163234
volumes: null

charts/steadybit-extension-http/tests/deployment_test.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,15 @@ tests:
2525
- client-cert-a
2626
asserts:
2727
- matchSnapshot: {}
28+
- it: manifest should match snapshot with extra env vars
29+
set:
30+
extraEnv:
31+
- name: FOO
32+
value: "bar"
33+
extraEnvFrom:
34+
- configMapRef:
35+
name: env-configmap
36+
- secretRef:
37+
name: env-secrets
38+
asserts:
39+
- matchSnapshot: {}

charts/steadybit-extension-http/values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,19 @@ topologySpreadConstraints: []
5555

5656
# affinity -- Affinities to influence pod assignment.
5757
affinity: {}
58+
59+
# extraEnv -- Array with extra environment variables to add to the container
60+
# e.g:
61+
# extraEnv:
62+
# - name: FOO
63+
# value: "bar"
64+
extraEnv: []
65+
66+
# extraEnvFrom -- Array with extra environment variables sources to add to the container
67+
# e.g:
68+
# extraEnvFrom:
69+
# - configMapRef:
70+
# name: env-configmap
71+
# - secretRef:
72+
# name: env-secrets
73+
extraEnvFrom: []

0 commit comments

Comments
 (0)