Skip to content

Commit

Permalink
DE-99 Add extraEnvs support for the rest of containers
Browse files Browse the repository at this point in the history
  • Loading branch information
nedvna committed May 21, 2024
1 parent 169b252 commit 0e4ac6b
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 0 deletions.
41 changes: 41 additions & 0 deletions charts/ingress-nginx/ci/daemonset-extra-envs-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
controller:
image:
repository: wallarm/ingress-controller
tag: 1.0.0-dev
digest: null
service:
type: ClusterIP
extraEnvs:
- name: EXTRA_NGINXCTR_KEY
value: EXTRA_NGINXCTR_VAL
wallarm:
apiHost: api.wallarm.com
addnode:
extraEnvs:
- name: EXTRA_ADDNODE_KEY
value: EXTRA_ADDNODE_VAL
cron:
extraEnvs:
- name: EXTRA_CRON_KEY
value: EXTRA_CRON_VAL
collectd:
extraEnvs:
- name: EXTRA_COLLECTD_KEY
value: EXTRA_COLLECTD_VAL
apiFirewall:
extraEnvs:
- name: EXTRA_APIFW_KEY
value: EXTRA_APIFW_VAL
tarantool:
kind: DaemonSet
extraEnvs:
- name: EXTRA_TARANTOOL_KEY
value: EXTRA_TARANTOOL_VAL
wallarm-appstructure:
extraEnvs:
- name: EXTRA_APPSTRUCT_KEY
value: EXTRA_APPSTRUCT_VAL
wallarm-antibot:
extraEnvs:
- name: EXTRA_ANTIBOT_KEY
value: EXTRA_ANTIBOT_VAL
40 changes: 40 additions & 0 deletions charts/ingress-nginx/ci/deployment-extra-envs-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
controller:
image:
repository: wallarm/ingress-controller
tag: 1.0.0-dev
digest: null
service:
type: ClusterIP
extraEnvs:
- name: EXTRA_NGINXCTR_KEY
value: EXTRA_NGINXCTR_VAL
wallarm:
apiHost: api.wallarm.com
addnode:
extraEnvs:
- name: EXTRA_ADDNODE_KEY
value: EXTRA_ADDNODE_VAL
cron:
extraEnvs:
- name: EXTRA_CRON_KEY
value: EXTRA_CRON_VAL
collectd:
extraEnvs:
- name: EXTRA_COLLECTD_KEY
value: EXTRA_COLLECTD_VAL
apiFirewall:
extraEnvs:
- name: EXTRA_APIFW_KEY
value: EXTRA_APIFW_VAL
tarantool:
extraEnvs:
- name: EXTRA_TARANTOOL_KEY
value: EXTRA_TARANTOOL_VAL
wallarm-appstructure:
extraEnvs:
- name: EXTRA_APPSTRUCT_KEY
value: EXTRA_APPSTRUCT_VAL
wallarm-antibot:
extraEnvs:
- name: EXTRA_ANTIBOT_KEY
value: EXTRA_ANTIBOT_VAL
13 changes: 13 additions & 0 deletions charts/ingress-nginx/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ Create the name of the controller service account to use
{{- if .Values.controller.wallarm.nodeGroup }}
- name: WALLARM_LABELS
value: "group={{ .Values.controller.wallarm.nodeGroup }}"
{{- end }}
{{- if .Values.controller.wallarm.addnode.extraEnvs }}
{{- toYaml .Values.controller.wallarm.addnode.extraEnvs | nindent 2 }}
{{- end }}
volumeMounts:
- mountPath: {{ include "wallarm.path" . }}
Expand Down Expand Up @@ -279,6 +282,9 @@ Create the name of the controller service account to use
fieldPath: metadata.name
- name: WALLARM_INGRESS_CONTROLLER_VERSION
value: {{ .Chart.Version | quote }}
{{- if .Values.controller.wallarm.cron.extraEnvs }}
{{- toYaml .Values.controller.wallarm.cron.extraEnvs | nindent 2 }}
{{- end }}
volumeMounts:
- mountPath: {{ include "wallarm.path" . }}
name: wallarm
Expand Down Expand Up @@ -319,6 +325,10 @@ Create the name of the controller service account to use
{{- end }}
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
args: ["collectd"]
{{- if .Values.controller.wallarm.collectd.extraEnvs }}
env:
{{- toYaml .Values.controller.wallarm.collectd.extraEnvs | nindent 2 }}
{{- end }}
volumeMounts:
- name: wallarm
mountPath: {{ include "wallarm.path" . }}
Expand Down Expand Up @@ -359,6 +369,9 @@ Create the name of the controller service account to use
value: 5s
- name: APIFW_API_MODE_DEBUG_PATH_DB
value: "{{ include "wallarm-apifw.path" . }}/2/wallarm_api.db"
{{- if .Values.controller.wallarm.apiFirewall.extraEnvs }}
{{- toYaml .Values.controller.wallarm.apiFirewall.extraEnvs | nindent 4 }}
{{- end }}
volumeMounts:
- name: wallarm-apifw
mountPath: {{ include "wallarm-apifw.path" . }}
Expand Down
11 changes: 11 additions & 0 deletions charts/ingress-nginx/templates/tarantool-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
env:
- name: SLAB_ALLOC_ARENA
value: "{{ .Values.controller.wallarm.tarantool.arena }}"
{{- if (index .Values "controller" "wallarm" "tarantool" "extraEnvs") }}
{{- toYaml (index .Values "controller" "wallarm" "tarantool" "extraEnvs") | nindent 12 }}
{{- end }}
securityContext: {{ include "ingress-nginx.controller.containerSecurityContext" . | nindent 12 }}
livenessProbe:
tcpSocket:
Expand All @@ -85,6 +88,10 @@ spec:
{{- end }}
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
args: ["appstructure"]
{{- if (index .Values "controller" "wallarm" "wallarm-appstructure" "extraEnvs") }}
env:
{{- toYaml (index .Values "controller" "wallarm" "wallarm-appstructure" "extraEnvs") | nindent 12 }}
{{- end }}
securityContext: {{ include "ingress-nginx.controller.containerSecurityContext" . | nindent 12 }}
volumeMounts:
- mountPath: /opt/wallarm/etc/wallarm
Expand All @@ -102,6 +109,10 @@ spec:
{{- end }}
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
args: ["antibot"]
{{- if (index .Values "controller" "wallarm" "wallarm-antibot" "extraEnvs") }}
env:
{{- toYaml (index .Values "controller" "wallarm" "wallarm-antibot" "extraEnvs") | nindent 12 }}
{{- end }}
securityContext: {{ include "ingress-nginx.controller.containerSecurityContext" . | nindent 12 }}
volumeMounts:
- mountPath: /opt/wallarm/etc/wallarm
Expand Down
11 changes: 11 additions & 0 deletions charts/ingress-nginx/templates/tarantool-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ spec:
env:
- name: SLAB_ALLOC_ARENA
value: "{{ .Values.controller.wallarm.tarantool.arena }}"
{{- if (index .Values "controller" "wallarm" "tarantool" "extraEnvs") }}
{{- toYaml (index .Values "controller" "wallarm" "tarantool" "extraEnvs") | nindent 12 }}
{{- end }}
securityContext: {{ include "ingress-nginx.controller.containerSecurityContext" . | nindent 12 }}
livenessProbe:
tcpSocket:
Expand All @@ -86,6 +89,10 @@ spec:
{{- end }}
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
args: ["appstructure"]
{{- if (index .Values "controller" "wallarm" "wallarm-appstructure" "extraEnvs") }}
env:
{{- toYaml (index .Values "controller" "wallarm" "wallarm-appstructure" "extraEnvs") | nindent 12 }}
{{- end }}
securityContext: {{ include "ingress-nginx.controller.containerSecurityContext" . | nindent 12 }}
volumeMounts:
- mountPath: /opt/wallarm/etc/wallarm
Expand All @@ -103,6 +110,10 @@ spec:
{{- end }}
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
args: ["antibot"]
{{- if (index .Values "controller" "wallarm" "wallarm-antibot" "extraEnvs") }}
env:
{{- toYaml (index .Values "controller" "wallarm" "wallarm-antibot" "extraEnvs") | nindent 12 }}
{{- end }}
securityContext: {{ include "ingress-nginx.controller.containerSecurityContext" . | nindent 12 }}
volumeMounts:
- mountPath: /opt/wallarm/etc/wallarm
Expand Down
56 changes: 56 additions & 0 deletions charts/ingress-nginx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -964,10 +964,34 @@ controller:
topologySpreadConstraints: []
nodeSelector:
kubernetes.io/os: linux
# -- Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource
wallarm-appstructure:
resources: {}
# -- Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource
wallarm-antibot:
resources: {}
# -- Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource
metrics:
port: 18080
enabled: false
Expand All @@ -994,6 +1018,14 @@ controller:
## Means that in case of values changing - BOTH pods (controller and tarantool) will be redeployed.
addnode:
resources: {}
# -- Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource
cron:
commands:
exportEnvironment:
Expand Down Expand Up @@ -1026,8 +1058,24 @@ controller:
### Ref: http://supervisord.org/logging.html
logLevel: warn
resources: {}
# -- Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource
collectd:
resources: {}
# -- Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource
apiFirewall:
### Enable or disable API Firewall functionality (true|false)
###
Expand Down Expand Up @@ -1064,6 +1112,14 @@ controller:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
# -- Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource

# -- Rollback limit
##
Expand Down

0 comments on commit 0e4ac6b

Please sign in to comment.