Skip to content

Commit

Permalink
Merge pull request #426 from wallarm/NODE-5400
Browse files Browse the repository at this point in the history
NODE-5400 Node 5.0 Migration to wcli scripts
  • Loading branch information
nedvna committed Aug 8, 2024
2 parents 6499e11 + a8f675c commit 5d9b00c
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 322 deletions.
2 changes: 1 addition & 1 deletion AIO_BASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.10.9
5.0.0
2 changes: 1 addition & 1 deletion TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.10.9-1
5.0.0-1
4 changes: 2 additions & 2 deletions charts/ingress-nginx/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: wallarm-ingress
version: 4.10.9
appVersion: 4.10.9
version: 5.0.0
appVersion: 5.0.0
home: https://github.com/wallarm/ingress
description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer with Wallarm module
icon: https://static.wallarm.com/wallarm-logo.svg
Expand Down
4 changes: 0 additions & 4 deletions charts/ingress-nginx/ci/daemonset-extra-envs-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,3 @@ controller:
extraEnvs:
- name: EXTRA_APPSTRUCT_KEY
value: EXTRA_APPSTRUCT_VAL
wallarm-antibot:
extraEnvs:
- name: EXTRA_ANTIBOT_KEY
value: EXTRA_ANTIBOT_VAL
4 changes: 0 additions & 4 deletions charts/ingress-nginx/ci/deployment-extra-envs-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,3 @@ controller:
extraEnvs:
- name: EXTRA_APPSTRUCT_KEY
value: EXTRA_APPSTRUCT_VAL
wallarm-antibot:
extraEnvs:
- name: EXTRA_ANTIBOT_KEY
value: EXTRA_ANTIBOT_VAL
28 changes: 18 additions & 10 deletions charts/ingress-nginx/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ Create the name of the controller service account to use
{{- end }}
- name: WALLARM_API_TOKEN_PATH
value: "/secrets/wallarm/token"
- name: WALLARM_COMPONENT_NAME
value: wallarm-ingress-controller
- name: WALLARM_COMPONENT_VERSION
value: {{ .Chart.Version | quote }}
{{- end -}}

{{- define "ingress-nginx.wallarmInitContainer.addNode" -}}
Expand All @@ -227,7 +231,7 @@ Create the name of the controller service account to use
image: "{{ .Values.controller.wallarm.helpers.image }}:{{ .Values.controller.wallarm.helpers.tag }}"
{{- end }}
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
args: [ "register" {{- if eq .Values.controller.wallarm.fallback "on" }}, "fallback"{{- end }} ]
args: [ "register", "{{ .Values.register_mode }}" {{- if eq .Values.controller.wallarm.fallback "on" }}, "fallback"{{- end }} ]
env:
{{- include "wallarm.credentials" . | nindent 2 }}
- name: WALLARM_NODE_NAME
Expand All @@ -238,8 +242,6 @@ Create the name of the controller service account to use
value: www-data
- name: WALLARM_SYNCNODE_GROUP
value: www-data
- name: WALLARM_INGRESS_CONTROLLER_VERSION
value: {{ .Chart.Version | quote }}
{{- if .Values.controller.wallarm.nodeGroup }}
- name: WALLARM_LABELS
value: "group={{ .Values.controller.wallarm.nodeGroup }}"
Expand Down Expand Up @@ -273,15 +275,13 @@ Create the name of the controller service account to use
image: "{{ .Values.controller.wallarm.helpers.image }}:{{ .Values.controller.wallarm.helpers.tag }}"
{{- end }}
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
args: ["supervisord"]
args: ["wcli", "run", {{ include "ingress-nginx.wcli-args" . }}]
env:
{{- include "wallarm.credentials" . | nindent 2 }}
- name: WALLARM_NODE_NAME
valueFrom:
fieldRef:
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 }}
Expand All @@ -292,10 +292,6 @@ Create the name of the controller service account to use
name: wallarm-acl
- mountPath: {{ include "wallarm-apifw.path" . }}
name: wallarm-apifw
- mountPath: /opt/supervisord/supervisord.conf
name: wallarm-cron
subPath: supervisord.conf
readOnly: true
- mountPath: /secrets/wallarm/token
name: wallarm-token
subPath: token
Expand Down Expand Up @@ -507,3 +503,15 @@ Extra modules.
- name: modules
mountPath: /modules_mount
{{- end -}}

{{/*
Wcli arguments building
*/}}
{{- define "ingress-nginx.wcli-args" -}}
"-log-level", "{{ .Values.controller.wallarm.cron.logLevel }}",{{ " " }}
{{- with .Values.controller.wallarm.cron.commands -}}
{{- range $name, $value := . -}}
"job:{{ $name }}", "-log-level", "{{ $value.logLevel }}",{{ " " }}
{{- end -}}
{{- end -}}
{{- end -}}
92 changes: 0 additions & 92 deletions charts/ingress-nginx/templates/controller-configmap-cron.yaml

This file was deleted.

4 changes: 1 addition & 3 deletions charts/ingress-nginx/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ spec:
{{- end }}
{{- end }}
{{- if .Values.controller.wallarm.enabled }}
{{ $_ := set .Values "register_mode" "filtering" }}
{{ include "ingress-nginx.wallarmInitContainer.addNode" . | nindent 8 }}
{{- end }}
{{- if .Values.controller.hostNetwork }}
Expand Down Expand Up @@ -257,9 +258,6 @@ spec:
emptyDir: {}
- name: wallarm-apifw
emptyDir: {}
- name: wallarm-cron
configMap:
name: {{ template "ingress-nginx.wallarmControllerCronConfig" . }}
{{- include "ingress-nginx.wallarmTokenVolume" . | nindent 8 }}
{{- end }}
{{- if .Values.controller.customTemplate.configMapName }}
Expand Down
4 changes: 1 addition & 3 deletions charts/ingress-nginx/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ spec:
{{- end }}
{{- end }}
{{- if .Values.controller.wallarm.enabled }}
{{ $_ := set .Values "register_mode" "filtering" }}
{{ include "ingress-nginx.wallarmInitContainer.addNode" . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -260,9 +261,6 @@ spec:
emptyDir: {}
- name: wallarm-apifw
emptyDir: {}
- name: wallarm-cron
configMap:
name: {{ template "ingress-nginx.wallarmControllerCronConfig" . }}
{{- include "ingress-nginx.wallarmTokenVolume" . | nindent 8 }}
{{- end }}
{{- if .Values.controller.customTemplate.configMapName }}
Expand Down
126 changes: 0 additions & 126 deletions charts/ingress-nginx/templates/tarantool-configmap.yaml

This file was deleted.

Loading

0 comments on commit 5d9b00c

Please sign in to comment.