Skip to content

Commit

Permalink
NODE-5873 add configurable APIFW parameters to Sidecar Helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
braek-neck committed Jan 21, 2025
1 parent e53af0e commit 01e876d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0
1.4.1
35 changes: 21 additions & 14 deletions files/template.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ volumes:
{{ if ne (getAnnotation .ObjectMeta (withAP "sidecar-injection-schema") .Config.injectionStrategy.schema) "split" -}}
{{ template "wallarmApiVariables" . }}
{{ template "wallarmVersion" . }}
{{ template "wallarmApiFwVariables" . }}
{{- end }}
{{ if (isSet .ObjectMeta.Annotations (withAP "wallarm-application")) -}}
- name: WALLARM_APPLICATION
Expand Down Expand Up @@ -66,20 +67,6 @@ volumes:
value: "{{ getAnnotation .ObjectMeta (withAP `wallarm-upstream-connect-attempts`) .Config.wallarm.upstream.connectAttempts }}"
- name: WALLARM_UPSTREAM_RECONNECT_INTERVAL
value: "{{ getAnnotation .ObjectMeta (withAP `wallarm-upstream-reconnect-interval`) .Config.wallarm.upstream.reconnectInterval }}"
- name: WALLARM_APIFW_ENABLE
value: "{{ getAnnotation .ObjectMeta (withAP `api-firewall-enabled`) .Config.wallarm.apiFirewall.mode }}"
- name: APIFW_READ_BUFFER_SIZE
value: "{{ .Config.wallarm.apiFirewall.readBufferSize | int64 }}"
- name: APIFW_WRITE_BUFFER_SIZE
value: "{{ .Config.wallarm.apiFirewall.writeBufferSize | int64 }}"
- name: APIFW_MAX_REQUEST_BODY_SIZE
value: "{{ .Config.wallarm.apiFirewall.maxRequestBodySize | int64 }}"
- name: APIFW_DISABLE_KEEPALIVE
value: "{{ .Config.wallarm.apiFirewall.disableKeepalive }}"
- name: APIFW_MAX_CONNS_PER_IP
value: "{{ .Config.wallarm.apiFirewall.maxConnectionsPerIp }}"
- name: APIFW_MAX_REQUESTS_PER_CONN
value: "{{ .Config.wallarm.apiFirewall.maxRequestsPerConnection }}"
- name: NGINX_LISTEN_PORT
value: "{{ getAnnotation .ObjectMeta (withAP `nginx-listen-port`) .Config.nginx.listenPort }}"
- name: NGINX_PROXY_PASS_PORT
Expand Down Expand Up @@ -148,6 +135,8 @@ volumes:
value: "{{ .Profile.nginx.servers | toJson | b64enc }}"
{{- end }}
{{- end }}
- name: WALLARM_APIFW_ENABLE
value: "{{ getAnnotation .ObjectMeta (withAP `api-firewall-enabled`) .Config.wallarm.apiFirewall.mode }}"
ports:
- name: status
containerPort: {{ getAnnotation .ObjectMeta (withAP "nginx-status-port") .Config.nginx.statusPort }}
Expand Down Expand Up @@ -200,6 +189,9 @@ volumes:
env:
{{ template "wallarmApiVariables" . }}
{{ template "wallarmVersion" . }}
{{ template "wallarmApiFwVariables" . }}
- name: WALLARM_APIFW_ENABLE
value: "{{ getAnnotation .ObjectMeta (withAP `api-firewall-enabled`) .Config.wallarm.apiFirewall.mode }}"
- name: NGINX_STATUS_PORT
value: "{{ getAnnotation .ObjectMeta (withAP `nginx-status-port`) .Config.nginx.statusPort }}"
volumeMounts:
Expand Down Expand Up @@ -303,6 +295,21 @@ volumes:
value: "{{ .Config.component.version }}"
{{- end }}

{{- define "wallarmApiFwVariables" }}
- name: APIFW_READ_BUFFER_SIZE
value: "{{ .Config.wallarm.apiFirewall.readBufferSize | int64 }}"
- name: APIFW_WRITE_BUFFER_SIZE
value: "{{ .Config.wallarm.apiFirewall.writeBufferSize | int64 }}"
- name: APIFW_MAX_REQUEST_BODY_SIZE
value: "{{ .Config.wallarm.apiFirewall.maxRequestBodySize | int64 }}"
- name: APIFW_DISABLE_KEEPALIVE
value: "{{ .Config.wallarm.apiFirewall.disableKeepalive }}"
- name: APIFW_MAX_CONNS_PER_IP
value: "{{ .Config.wallarm.apiFirewall.maxConnectionsPerIp }}"
- name: APIFW_MAX_REQUESTS_PER_CONN
value: "{{ .Config.wallarm.apiFirewall.maxRequestsPerConnection }}"
{{- end }}

{{- define "helperContainer.resources" }}
{{- if or (isSet .ObjectMeta.Annotations (withAP "helper-cpu")) (isSet .ObjectMeta.Annotations (withAP "helper-memory")) (isSet .ObjectMeta.Annotations (withAP "helper-cpu-limit")) (isSet .ObjectMeta.Annotations (withAP "helper-memory-limit")) }}
{{- if or (isSet .ObjectMeta.Annotations (withAP "helper-cpu")) (isSet .ObjectMeta.Annotations (withAP "helper-memory")) }}
Expand Down
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ annotations:
- name: sidecar
image: wallarm/sidecar:5.2.11
- name: sidecar-controller
image: wallarm/sidecar-controller:1.4.0
image: wallarm/sidecar-controller:1.4.1
- name: node-helpers
image: wallarm/node-helpers:5.2.11
2 changes: 1 addition & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ controller:
image:
registry: docker.io
image: wallarm/sidecar-controller
tag: 1.4.0
tag: 1.4.1
pullPolicy: IfNotPresent
# -- Admission webhook configuration
# @default -- *See below for details*
Expand Down

0 comments on commit 01e876d

Please sign in to comment.