Skip to content

Commit

Permalink
Merge branch 'main' into NODE-5583
Browse files Browse the repository at this point in the history
  • Loading branch information
braek-neck authored Aug 9, 2024
2 parents 72e9c6b + a8d1135 commit 8c5e1aa
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 241 deletions.
18 changes: 15 additions & 3 deletions files/template.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ volumes:
{{ if eq (getAnnotation .ObjectMeta (withAP "sidecar-injection-schema") .Config.injectionStrategy.schema) "split" -}}
command: ["/usr/local/run-nginx.sh"]
{{- else }}
command: ["/usr/local/run-node.sh"]
command: ["/usr/local/run-node.sh", "run", {{ template "wcli-args" . }}]
{{- end }}
env:
{{ if ne (getAnnotation .ObjectMeta (withAP "sidecar-injection-schema") .Config.injectionStrategy.schema) "split" -}}
Expand Down Expand Up @@ -184,7 +184,7 @@ volumes:
- name: sidecar-helper
image: {{ template "image" . }}
imagePullPolicy: {{ .Config.sidecar.image.pullPolicy }}
command: ["/usr/local/run-helper.sh"]
command: ["/usr/local/run-helper.sh", "run", {{ template "wcli-args" . }}]
env:
{{ template "wallarmApiVariables" . }}
{{ template "wallarmVersion" . }}
Expand Down Expand Up @@ -419,4 +419,16 @@ volumes:
{{ toYaml $value | indent 4 }}
{{ end }}
{{- end -}}
{{- end }}
{{- end }}

{{/*
Wcli arguments building
*/}}
{{- define "wcli-args" -}}
"-log-level", "{{ .Config.cron.logLevel }}",{{ " " }}
{{- with .Config.cron.commands -}}
{{- range $name, $value := . -}}
"job:{{ $name }}", "-log-level", "{{ $value.logLevel }}",{{ " " }}
{{- end -}}
{{- end -}}
{{- end -}}
8 changes: 4 additions & 4 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: wallarm-sidecar
version: 4.10.10
appVersion: 4.10.9-1
version: 5.0.0
appVersion: 5.0.0
description: Sidecar controller for Kubernetes. Injects sidecar proxy based on NGINX with Wallarm module and helper services.
home: https://github.com/wallarm/sidecar
icon: https://static.wallarm.com/wallarm-logo.svg
Expand All @@ -21,8 +21,8 @@ kubeVersion: ">=1.19.16-0"
annotations:
artifacthub.io/images: |
- name: sidecar
image: wallarm/sidecar:4.10.9-1
image: wallarm/sidecar:5.0.0-1
- name: sidecar-controller
image: wallarm/sidecar-controller:1.3.9
- name: node-helpers
image: wallarm/node-helpers:4.10.9-1
image: wallarm/node-helpers:5.0.0-1
12 changes: 12 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,15 @@ wallarm-sidecar-proxy
{{- .Values.postanalytics.service.port }}
{{- end }}
{{- end -}}

{{/*
Wcli arguments building
*/}}
{{- define "wallarm-sidecar.wcli-args" -}}
"-log-level", "{{ .Values.config.cron.logLevel }}",{{ " " }}
{{- with .Values.config.cron.commands -}}
{{- range $name, $value := . -}}
"job:{{ $name }}", "-log-level", "{{ $value.logLevel }}",{{ " " }}
{{- end -}}
{{- end -}}
{{- end -}}
117 changes: 0 additions & 117 deletions helm/templates/postanalytics-configmap.yaml

This file was deleted.

53 changes: 4 additions & 49 deletions helm/templates/postanalytics-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
template:
metadata:
annotations:
checksum/config: {{ index (include (print .Template.BasePath "/postanalytics-configmap.yaml") . | fromYaml) "data" | toYaml | sha256sum }}
checksum/config: {{ .Values.config.cron | toJson | sha256sum }}
checksum/secret: {{ .Values.config.wallarm.api | toJson | sha256sum }}
{{- include "wallarm-sidecar.annotations" . | nindent 8 }}
{{- with .Values.postanalytics.extraAnnotations }}
Expand Down Expand Up @@ -66,7 +66,7 @@ spec:
- name: init
image: {{ include "wallarm-sidecar.image" .Values.helper.image }}
imagePullPolicy: "{{ .Values.helper.image.pullPolicy }}"
args: [ "register"{{- if eq .Values.config.wallarm.fallback "on" }}, "fallback"{{- end }} ]
args: [ "register", "post_analytic"{{- if eq .Values.config.wallarm.fallback "on" }}, "fallback"{{- end }} ]
env:
{{- include "wallarm-sidecar.credentials" . | nindent 10 }}
{{- include "wallarm-sidecar.version" . | nindent 10 }}
Expand Down Expand Up @@ -111,7 +111,7 @@ spec:
- name: supervisord
image: {{ include "wallarm-sidecar.image" .Values.helper.image }}
imagePullPolicy: "{{ .Values.helper.image.pullPolicy }}"
args: ["supervisord"]
args: ["wcli", "run", {{ include "wallarm-sidecar.wcli-args" . }}]
env:
{{- include "wallarm-sidecar.credentials" . | nindent 10 }}
{{- include "wallarm-sidecar.version" . | nindent 10 }}
Expand Down Expand Up @@ -146,10 +146,6 @@ spec:
name: wallarm
- mountPath: /opt/wallarm/var/lib/wallarm-acl
name: wallarm-acl
- mountPath: /opt/supervisord/supervisord.conf
name: wallarm-supervisord
subPath: supervisord.conf
readOnly: true
{{- with .Values.postanalytics.supervisord.extraVolumeMounts }}
{{- . | toYaml | nindent 10 }}
{{- end }}
Expand Down Expand Up @@ -235,44 +231,6 @@ spec:
{{- with .Values.postanalytics.tarantool.extraVolumeMounts }}
{{- . | toYaml | nindent 10 }}
{{- end }}
- name: antibot
image: {{ include "wallarm-sidecar.image" .Values.helper.image }}
imagePullPolicy: "{{ .Values.helper.image.pullPolicy }}"
args: ["antibot"]
env:
{{- include "wallarm-sidecar.credentials" . | nindent 10 }}
{{- with .Values.postanalytics.antibot.extraEnvs }}
{{- . | toYaml | nindent 10 }}
{{- end }}
{{- with .Values.postanalytics.antibot.livenessProbe }}
livenessProbe: {{ . | toYaml | nindent 12 }}
{{- end }}
{{- with .Values.postanalytics.antibot.readinessProbe }}
readinessProbe: {{ . | toYaml | nindent 12 }}
{{- end }}
{{- with .Values.postanalytics.antibot.lifecycle }}
lifecycle: {{ . | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.postanalytics.antibot.securityContext }}
securityContext: {{ .Values.postanalytics.antibot.securityContext | toYaml | nindent 12 }}
{{- else }}
securityContext:
privileged: false
runAsUser: 101
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
{{- end }}
{{- with .Values.postanalytics.antibot.resources }}
resources: {{ . | toYaml | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /opt/wallarm/etc/wallarm
name: wallarm
{{- with .Values.postanalytics.tarantool.extraVolumeMounts }}
{{- . | toYaml | nindent 10 }}
{{- end }}
{{- with .Values.postanalytics.extraContainers }}
{{- . | toYaml | nindent 8 }}
{{- end }}
Expand All @@ -281,10 +239,7 @@ spec:
emptyDir: {}
- name: wallarm-acl
emptyDir: {}
- name: wallarm-supervisord
configMap:
name: {{ include "wallarm-sidecar.fullname" . }}-postanalytics
{{- with .Values.postanalytics.extraVolumes }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
Loading

0 comments on commit 8c5e1aa

Please sign in to comment.