Skip to content

Commit

Permalink
Rename cron to wcli
Browse files Browse the repository at this point in the history
  • Loading branch information
nedvna committed Jan 22, 2025
1 parent c1edbc8 commit a283b2d
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 33 deletions.
6 changes: 3 additions & 3 deletions charts/ingress-nginx/ci/daemonset-extra-envs-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ controller:
extraEnvs:
- name: EXTRA_ADDNODE_KEY
value: EXTRA_ADDNODE_VAL
cron:
wcli:
extraEnvs:
- name: EXTRA_CRON_KEY
value: EXTRA_CRON_VAL
- name: EXTRA_WCLI_KEY
value: EXTRA_WCLI_VAL
collectd:
extraEnvs:
- name: EXTRA_COLLECTD_KEY
Expand Down
6 changes: 3 additions & 3 deletions charts/ingress-nginx/ci/deployment-extra-envs-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ controller:
extraEnvs:
- name: EXTRA_ADDNODE_KEY
value: EXTRA_ADDNODE_VAL
cron:
wcli:
extraEnvs:
- name: EXTRA_CRON_KEY
value: EXTRA_CRON_VAL
- name: EXTRA_WCLI_KEY
value: EXTRA_WCLI_VAL
collectd:
extraEnvs:
- name: EXTRA_COLLECTD_KEY
Expand Down
22 changes: 11 additions & 11 deletions charts/ingress-nginx/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ Create the name of the controller service account to use

{{- define "ingress-nginx.wallarmPostanalyticsPort" -}}3313{{- end -}}
{{- define "ingress-nginx.wallarmPostanalyticsName" -}}{{ .Values.controller.name }}-wallarm-wstore{{- end -}}
{{- define "ingress-nginx.wallarmPostanalyticsCronConfig" -}}{{ template "ingress-nginx.wallarmPostanalyticsName" . }}-cron{{- end -}}
{{- define "ingress-nginx.wallarmControllerCronConfig" -}}{{ include "ingress-nginx.controller.fullname" . | lower }}-cron{{- end -}}
{{- define "ingress-nginx.wallarmPostanalyticsWcliConfig" -}}{{ template "ingress-nginx.wallarmPostanalyticsName" . }}-wcli{{- end -}}
{{- define "ingress-nginx.wallarmControllerWcliConfig" -}}{{ include "ingress-nginx.controller.fullname" . | lower }}-wcli{{- end -}}
{{- define "ingress-nginx.wallarmSecret" -}}{{ .Values.controller.name }}-secret{{- end -}}

{{- define "wallarm.credentials" -}}
Expand Down Expand Up @@ -265,10 +265,10 @@ Create the name of the controller service account to use
{{ toYaml .Values.controller.wallarm.init.resources | indent 4 }}
{{- end -}}

{{- define "ingress-nginx.wallarmCronContainer" -}}
- name: cron
{{- if .Values.controller.wallarm.cron.image }}
{{- with .Values.controller.wallarm.cron.image }}
{{- define "ingress-nginx.wallarmWcliContainer" -}}
- name: wcli
{{- if .Values.controller.wallarm.wcli.image }}
{{- with .Values.controller.wallarm.wcli.image }}
image: "{{ .repository }}:{{ .tag }}"
{{- end }}
{{- else }}
Expand All @@ -282,8 +282,8 @@ Create the name of the controller service account to use
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- if .Values.controller.wallarm.cron.extraEnvs }}
{{- toYaml .Values.controller.wallarm.cron.extraEnvs | nindent 2 }}
{{- if .Values.controller.wallarm.wcli.extraEnvs }}
{{- toYaml .Values.controller.wallarm.wcli.extraEnvs | nindent 2 }}
{{- end }}
volumeMounts:
- mountPath: {{ include "wallarm.path" . }}
Expand All @@ -298,7 +298,7 @@ Create the name of the controller service account to use
readOnly: true
securityContext: {{ include "ingress-nginx.controller.containerSecurityContext" . | nindent 4 }}
resources:
{{ toYaml .Values.controller.wallarm.cron.resources | indent 4 }}
{{ toYaml .Values.controller.wallarm.wcli.resources | indent 4 }}
{{- end -}}

{{- define "ingress-nginx.wallarmTokenVolume" -}}
Expand Down Expand Up @@ -512,8 +512,8 @@ Extra modules.
Wcli arguments building
*/}}
{{- define "ingress-nginx.wcli-args" -}}
"-log-level", "{{ .Values.controller.wallarm.cron.logLevel }}",{{ " " }}
{{- with .Values.controller.wallarm.cron.commands -}}
"-log-level", "{{ .Values.controller.wallarm.wcli.logLevel }}",{{ " " }}
{{- with .Values.controller.wallarm.wcli.commands -}}
{{- range $name, $value := . -}}
"job:{{ $name }}", "-log-level", "{{ $value.logLevel }}",{{ " " }}
{{- end -}}
Expand Down
4 changes: 2 additions & 2 deletions charts/ingress-nginx/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
annotations:
{{- if .Values.controller.wallarm.enabled }}
wallarm-enabled: "true"
checksum/cron: {{ .Values.controller.wallarm.cron | toJson | sha256sum }}
checksum/wcli: {{ .Values.controller.wallarm.wcli | toJson | sha256sum }}
{{- if not .Values.controller.wallarm.existingSecret.enabled }}
checksum/token: {{ .Values.controller.wallarm.token | sha256sum }}
{{- end }}
Expand Down Expand Up @@ -198,7 +198,7 @@ spec:
{{- toYaml .Values.controller.extraContainers | nindent 8 }}
{{- end }}
{{- if .Values.controller.wallarm.enabled }}
{{ include "ingress-nginx.wallarmCronContainer" . | nindent 8 }}
{{ include "ingress-nginx.wallarmWcliContainer" . | nindent 8 }}
{{ include "ingress-nginx.wallarmCollectdContainer" . | nindent 8 }}
{{- if .Values.controller.wallarm.apiFirewall.enabled }}
{{ include "ingress-nginx.wallarmapiFirewallContainer" . | nindent 8 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/ingress-nginx/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
annotations:
{{- if .Values.controller.wallarm.enabled }}
wallarm-enabled: "true"
checksum/cron: {{ .Values.controller.wallarm.cron | toJson | sha256sum }}
checksum/wcli: {{ .Values.controller.wallarm.wcli | toJson | sha256sum }}
{{- if not .Values.controller.wallarm.existingSecret.enabled }}
checksum/token: {{ .Values.controller.wallarm.token | sha256sum }}
{{- end }}
Expand Down Expand Up @@ -201,7 +201,7 @@ spec:
{{- toYaml .Values.controller.extraContainers | nindent 8 }}
{{- end }}
{{- if .Values.controller.wallarm.enabled }}
{{ include "ingress-nginx.wallarmCronContainer" . | nindent 8 }}
{{ include "ingress-nginx.wallarmWcliContainer" . | nindent 8 }}
{{ include "ingress-nginx.wallarmCollectdContainer" . | nindent 8 }}
{{- if .Values.controller.wallarm.apiFirewall.enabled }}
{{ include "ingress-nginx.wallarmapiFirewallContainer" . | nindent 8 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/ingress-nginx/templates/postanalytics-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
template:
metadata:
annotations:
checksum/cron: {{ .Values.controller.wallarm.cron | toJson | sha256sum }}
checksum/wcli: {{ .Values.controller.wallarm.wcli | toJson | sha256sum }}
{{- if not .Values.controller.wallarm.existingSecret.enabled }}
checksum/token: {{ .Values.controller.wallarm.token | sha256sum }}
{{- end }}
Expand All @@ -46,7 +46,7 @@ spec:
{{ $_ := set .Values "register_mode" "post_analytic" }}
{{ include "ingress-nginx.wallarmInitContainer.init" . | nindent 8 }}
containers:
{{ include "ingress-nginx.wallarmCronContainer" . | nindent 8 }}
{{ include "ingress-nginx.wallarmWcliContainer" . | nindent 8 }}
- name: wstore
{{- if .Values.controller.wallarm.postanalytics.image }}
{{- with .Values.controller.wallarm.postanalytics.image }}
Expand Down
4 changes: 2 additions & 2 deletions charts/ingress-nginx/templates/postanalytics-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
template:
metadata:
annotations:
checksum/cron: {{ .Values.controller.wallarm.cron | toJson | sha256sum }}
checksum/wcli: {{ .Values.controller.wallarm.wcli | toJson | sha256sum }}
{{- if not .Values.controller.wallarm.existingSecret.enabled }}
checksum/token: {{ .Values.controller.wallarm.token | sha256sum }}
{{- end }}
Expand All @@ -47,7 +47,7 @@ spec:
{{ $_ := set .Values "register_mode" "post_analytic" }}
{{ include "ingress-nginx.wallarmInitContainer.init" . | nindent 8 }}
containers:
{{ include "ingress-nginx.wallarmCronContainer" . | nindent 8 }}
{{ include "ingress-nginx.wallarmWcliContainer" . | nindent 8 }}
- name: wstore
{{- if .Values.controller.wallarm.postanalytics.image }}
{{- with .Values.controller.wallarm.postanalytics.image }}
Expand Down
6 changes: 3 additions & 3 deletions charts/ingress-nginx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1040,8 +1040,8 @@ controller:
# externalTrafficPolicy: ""
# nodePort: ""
## If HPA is used, the resources.requests.{cpu,memory} must be set in the following variables:
## init, cron, and collectd. Otherwise, HPA will not work properly.
## Note: init.resources, and cron.resources are shared between 2 pods:
## init, wcli, and collectd. Otherwise, HPA will not work properly.
## Note: init.resources, and wcli.resources are shared between 2 pods:
## wallarm-ingress-controller and wallarm-ingress-controller-wstore.
## Means that in case of values changing - BOTH pods (controller and wstore) will be redeployed.
init:
Expand All @@ -1054,7 +1054,7 @@ controller:
# secretKeyRef:
# key: FOO
# name: secret-resource
cron:
wcli:
### General log level
logLevel: warn
### Per-job log levels
Expand Down
8 changes: 4 additions & 4 deletions test/smoke/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ function get_logs() {
echo -e "#######################################\n"

echo "#################################"
echo "###### Cron container logs ######"
echo "###### Wcli container logs ######"
echo "#################################"
kubectl logs -l "app.kubernetes.io/component=controller" -c cron --tail=-1
kubectl logs -l "app.kubernetes.io/component=controller" -c wcli --tail=-1
echo -e "#################################\n"

echo "###################################"
Expand Down Expand Up @@ -134,9 +134,9 @@ function get_logs() {
echo -e "############################################################\n"

echo "##################################################"
echo "###### WSTORE Pod - Cron container logs ######"
echo "###### WSTORE Pod - Wcli container logs ######"
echo "##################################################"
kubectl logs -l "app.kubernetes.io/component=controller-wallarm-wstore" -c cron --tail=-1
kubectl logs -l "app.kubernetes.io/component=controller-wallarm-wstore" -c wcli --tail=-1
echo -e "##################################################\n"

echo "######################################################"
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ controller:
apiCaVerify: ${WALLARM_API_CA_VERIFY}
nodeGroup: ${NODE_GROUP_NAME}
fallback: "off"
cron:
wcli:
commands:
detectCredStuffing:
logLevel: DEBUG
Expand Down

0 comments on commit a283b2d

Please sign in to comment.