Skip to content

Commit e11d59c

Browse files
committed
Update charts with latest changes
1 parent 4eeeaa8 commit e11d59c

File tree

10 files changed

+166
-50
lines changed

10 files changed

+166
-50
lines changed

wiz-broker/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: "wiz-broker"
33
description: Wiz Broker for tunneling http traffic to Wiz backend
44
type: application
5-
version: 2.4.1
5+
version: 2.4.2
66
appVersion: "2.8"
77
dependencies:
88
- name: wiz-common

wiz-broker/templates/_helpers.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ Deployment name.
2323
Service account name.
2424
*/}}
2525
{{- define "wiz-broker.serviceAccountName" -}}
26-
{{ coalesce (.Values.serviceAccount.name) (printf "%s-wiz-broker-sa" .Release.Name) }}
26+
{{- if or .Values.serviceAccount.create (.Values.serviceAccount.name | trim) (and .Values.global.useHATunnel .Values.autoRolloutUpdate) -}}
27+
{{ coalesce (.Values.serviceAccount.name | trim) (printf "%s-wiz-broker-sa" .Release.Name | trim) }}
28+
{{- end -}}
2729
{{- end }}
2830

2931
{{/*
Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{{- if .Values.enabled }}
2-
{{- if .Values.serviceAccount.create }}
2+
{{- if or .Values.serviceAccount.create (and (not (.Values.serviceAccount.name | trim)) .Values.global.useHATunnel .Values.autoRolloutUpdate) }}
33
apiVersion: v1
44
kind: ServiceAccount
55
metadata:
6-
name: {{ include "wiz-broker.serviceAccountName" . | trim }}
6+
name: {{ include "wiz-broker.serviceAccountName" . }}
77
namespace: {{ .Release.Namespace | quote }}
88
labels:
99
{{- include "wiz-broker.labels" . | nindent 4 }}
@@ -12,4 +12,39 @@ metadata:
1212
{{- toYaml . | nindent 4 }}
1313
{{- end }}
1414
{{- end }}
15+
---
16+
{{- if and .Values.global.useHATunnel .Values.autoRolloutUpdate }}
17+
apiVersion: rbac.authorization.k8s.io/v1
18+
kind: Role
19+
metadata:
20+
name: {{ include "wiz-broker.serviceAccountName" . }}-self-rollout
21+
namespace: {{ .Release.Namespace | quote }}
22+
labels:
23+
{{- include "wiz-broker.labels" . | nindent 4 }}
24+
rules:
25+
- apiGroups: ["apps"]
26+
resources: ["deployments"]
27+
resourceNames:
28+
- {{ include "wiz-broker.deploymentName" . }}
29+
verbs: ["patch"]
30+
- apiGroups: [""]
31+
resources: ["events"]
32+
verbs: ["create"]
33+
---
34+
apiVersion: rbac.authorization.k8s.io/v1
35+
kind: RoleBinding
36+
metadata:
37+
name: {{ include "wiz-broker.serviceAccountName" . }}-self-rollout-rb
38+
namespace: {{ .Release.Namespace | quote }}
39+
labels:
40+
{{- include "wiz-broker.labels" . | nindent 4 }}
41+
subjects:
42+
- kind: ServiceAccount
43+
name: {{ include "wiz-broker.serviceAccountName" . }}
44+
namespace: {{ .Release.Namespace | quote }}
45+
roleRef:
46+
kind: Role
47+
name: {{ include "wiz-broker.serviceAccountName" . }}-self-rollout
48+
apiGroup: rbac.authorization.k8s.io
49+
{{- end }}
1550
{{- end }}

wiz-broker/templates/wiz-broker-deployment.yaml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ spec:
4646
imagePullSecrets:
4747
{{- toYaml . | nindent 8 }}
4848
{{- end }}
49-
serviceAccountName: {{ .Values.serviceAccount.name }}
49+
serviceAccountName: {{ include "wiz-broker.serviceAccountName" . }}
5050
securityContext:
5151
{{- if hasKey .Values.global "lowPrivilegePodSecurityPolicy" }}
5252
{{- toYaml .Values.global.lowPrivilegePodSecurityPolicy | nindent 8 }}
@@ -189,6 +189,49 @@ spec:
189189
valueFrom:
190190
fieldRef:
191191
fieldPath: metadata.namespace
192+
- name: K8S_DEPLOYMENT_NAME
193+
value: {{ include "wiz-broker.deploymentName" . }}
194+
{{- if or .Values.global.istio.enabled .Values.istio.enabled }}
195+
- name: WIZ_ISTIO_PROXY_ENABLED
196+
value: "true"
197+
- name: WIZ_ISTIO_PROXY_PORT
198+
value: {{ coalesce .Values.global.istio.proxySidecarPort .Values.istio.proxySidecarPort | quote }}
199+
{{- end }}
200+
- name: WIZ_CHART_VERSION
201+
value: "{{ .Chart.Version }}"
202+
{{- if .Values.global.useHATunnel }}
203+
- name: WIZ_USE_HATUNNEL
204+
value: "1"
205+
- name: WIZ_BROKER_HEARTBEAT_DISABLE_CLUSTER_ID
206+
value: "1"
207+
- name: WIZ_AUTO_ROLLOUT_ROLE
208+
value: {{ ternary "true" "false" .Values.autoRolloutUpdate | quote }}
209+
- name: WIZ_HEALTH_PORT
210+
value: {{ .Values.healthPort | quote }}
211+
{{- if .Values.connectorType }}
212+
- name: CONNECTOR_TYPE
213+
value: {{ .Values.connectorType | quote }}
214+
{{- end }}
215+
{{- if gt (int .Values.healthPort) 0 }}
216+
readinessProbe:
217+
initialDelaySeconds: 10
218+
periodSeconds: 10
219+
failureThreshold: 3
220+
httpGet:
221+
port: {{ .Values.healthPort }}
222+
path: /ready
223+
livenessProbe:
224+
initialDelaySeconds: 10
225+
periodSeconds: 10
226+
failureThreshold: 90 # 15 minutes
227+
httpGet:
228+
port: {{ .Values.healthPort }}
229+
path: /live
230+
ports:
231+
- containerPort: {{ .Values.healthPort }}
232+
name: health
233+
{{- end }}
234+
{{- end }}
192235
{{- include "wiz-common.renderResources" (list .Values.resources (index .Values.global "wiz-kubernetes-connector" "resources")) | nindent 10 -}}
193236
{{- with (coalesce .Values.global.nodeSelector .Values.nodeSelector) }}
194237
nodeSelector:

wiz-broker/values.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ serviceAccount:
2424
# The name of the service account to use.
2525
name: ""
2626

27+
# enable the restart rollout rbac policy
28+
autoRolloutUpdate: true
29+
30+
healthPort: 30000
31+
32+
connectorType: ""
33+
2734
podCustomEnvironmentVariablesFile: ""
2835

2936
podCustomEnvironmentVariables: []
@@ -153,6 +160,21 @@ resources: {}
153160
# cpu: 100m
154161
# memory: 128Mi
155162

163+
# Set this to true if you are using Istio in sidecar mode.
164+
# When Istio uses sidecars, there are 2 issues when deploying Wiz:
165+
# 1) The creation and deletion Jobs never complete (due to istio-proxy sidecar)
166+
# 2) There is a race condition and possible network connectivity failures
167+
# when contacting the Wiz backend.
168+
#
169+
# When either of this happens, either the installation, upgrade or uninstallation
170+
# of the charts fail.
171+
# Setting this to true ensures that the istio-proxy gets a graceful shutdown
172+
# and mitigates the networking race condition by sleeping before the Job starts.
173+
# Learn more:
174+
# https://istio.io/latest/blog/2023/native-sidecars/
175+
istio:
176+
enabled: false
177+
proxySidecarPort: 15000
156178

157179
global:
158180
# Set the log level. Can be one of "debug", "info", "warn", or "error".
@@ -223,6 +245,24 @@ global:
223245
create: false # Secret created by wiz-broker.
224246
secretName: "" # The name of the proxy Secret.
225247

248+
# Set this to true if you are using Istio in sidecar mode.
249+
# When Istio uses sidecars, there are 2 issues when deploying Wiz:
250+
# 1) The creation and deletion Jobs never complete (due to istio-proxy sidecar)
251+
# 2) There is a race condition and possible network connectivity failures
252+
# when contacting the Wiz backend.
253+
#
254+
# When either of this happens, either the installation, upgrade or uninstallation
255+
# of the charts fail.
256+
# Setting this to true ensures that the istio-proxy gets a graceful shutdown
257+
# and mitigates the networking race condition by sleeping before the Job starts.
258+
# Learn more:
259+
# https://istio.io/latest/blog/2023/native-sidecars/
260+
istio:
261+
enabled: false
262+
proxySidecarPort: 0
263+
264+
useHATunnel: false
265+
226266
wiz-kubernetes-connector:
227267
resources: {}
228268
# We usually recommend not to specify default resources and to leave this as a conscious

wiz-kubernetes-connector/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 3.4.1
18+
version: 3.4.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
@@ -27,7 +27,7 @@ dependencies:
2727
- name: wiz-broker
2828
repository: https://wiz-sec.github.io/charts
2929
# repository: "file://../wiz-broker" # Use this line to test the chart locally
30-
version: "2.4.1"
30+
version: "2.4.2"
3131
condition: wiz-broker.enabled
3232
- name: wiz-common
3333
version: "0.1.9"

wiz-kubernetes-connector/templates/_helpers.tpl

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,7 @@ Input parameters
119119
{{- end }}
120120

121121
{{- define "wiz-kubernetes-connector.entrypoint" -}}
122-
{{- if .Values.autoCreateConnector.istio.enabled -}}
123-
- "sh"
124-
- "-c"
125-
{{- else -}}
126122
- "wiz-broker"
127-
{{- end -}}
128123
{{- end }}
129124

130125
{{- define "wiz-kubernetes-connector.argsListCreateConnector" -}}
@@ -172,27 +167,11 @@ create-kubernetes-connector
172167
--wait={{ and (include "wiz-kubernetes-connector.brokerEnabled" . | trim) .Values.autoCreateConnector.waitUntilInitialized }}
173168
{{- end }}
174169

175-
{{- define "wiz-kubernetes.pre-istio-sidecar" -}}
176-
{{- printf "sleep %d" (int (.Values.autoCreateConnector.istio.sleepBeforeJobSecs | default 15)) -}}
177-
{{- end -}}
178-
179-
{{- define "wiz-kubernetes.post-istio-sidecar" -}}
180-
{{- printf "curl --max-time 2 -s -f -XPOST http://127.0.0.1:%d/quitquitquit" (int (.Values.autoCreateConnector.istio.proxySidecarPort | default 15000)) -}}
181-
{{- end -}}
182-
183170
{{- define "wiz-kubernetes-connector.generateArgsCreate" -}}
184171
{{- $args := include "wiz-kubernetes-connector.argsListCreateConnector" . | splitList "\n" -}}
185-
{{- if .Values.autoCreateConnector.istio.enabled -}}
186-
{{- $first := include "wiz-kubernetes.pre-istio-sidecar" . -}}
187-
{{- $last := include "wiz-kubernetes.post-istio-sidecar" . -}}
188-
{{- $argsWithIstio := printf "%s &&\nwiz-broker %s &&\n%s" $first (join " \n" $args) $last -}}
189-
- >
190-
{{- printf "%s" $argsWithIstio | nindent 2 }}
191-
{{- else -}}
192172
{{- range $arg := $args }}
193173
- {{ $arg }}
194174
{{- end }}
195-
{{- end -}}
196175
{{- end }}
197176

198177
{{- define "wiz-kubernetes-connector.generate-args-list-delete" -}}
@@ -201,21 +180,13 @@ delete-kubernetes-connector
201180
{{ .Release.Namespace | quote }}
202181
--input-secret-name
203182
{{ include "wiz-kubernetes-connector.connectorSecretName" . | trim | quote }}
204-
|| true
205183
{{- end }}
206184

207185
{{- define "wiz-kubernetes-connector.argsListDeleteConnector" -}}
208186
{{- $args := include "wiz-kubernetes-connector.generate-args-list-delete" . | splitList "\n" -}}
209-
{{- $output := "kuku" }}
210-
{{- if .Values.autoCreateConnector.istio.enabled -}}
211-
{{- $first := include "wiz-kubernetes.pre-istio-sidecar" . -}}
212-
{{- $last := include "wiz-kubernetes.post-istio-sidecar" . -}}
213-
{{- $output = printf "%s &&\nwiz-broker %s &&\n%s" $first (join " \n" $args) $last -}}
214-
{{- else -}}
215-
{{- $output = printf "wiz-broker %s" (join " \n" $args) -}}
216-
{{- end -}}
217-
- >
218-
{{- printf "%s" $output | nindent 2 }}
187+
{{- range $arg := $args }}
188+
- {{ $arg }}
189+
{{- end }}
219190
{{- end }}
220191

221192
{{- define "wiz-kubernetes-connector.generate-args-list-refresh" -}}
@@ -232,17 +203,9 @@ refresh-token
232203

233204
{{- define "wiz-kubernetes-connector.argsListRefreshConnector" -}}
234205
{{- $args := include "wiz-kubernetes-connector.generate-args-list-refresh" . | splitList "\n" -}}
235-
{{- if .Values.autoCreateConnector.istio.enabled -}}
236-
{{- $first := include "wiz-kubernetes.pre-istio-sidecar" . -}}
237-
{{- $last := include "wiz-kubernetes.post-istio-sidecar" . -}}
238-
{{- $argsWithIstio := printf "%s &&\nwiz-broker %s &&\n%s" $first (join " \n" $args) $last -}}
239-
- >
240-
{{- printf "%s" $argsWithIstio | nindent 2 }}
241-
{{- else -}}
242206
{{- range $arg := $args }}
243207
- {{ $arg }}
244208
{{- end }}
245-
{{- end -}}
246209
{{- end }}
247210

248211
{{- define "wiz-broker.image" -}}
@@ -329,4 +292,16 @@ false
329292
{{- end }}
330293
- name: WIZ_ENV
331294
value: {{ coalesce .Values.global.wizApiToken.clientEndpoint .Values.wizApiToken.clientEndpoint | quote }}
295+
{{- if (or .Values.global.istio.enabled .Values.autoCreateConnector.istio.enabled) }}
296+
- name: WIZ_ISTIO_PROXY_ENABLED
297+
value: "true"
298+
- name: WIZ_ISTIO_PROXY_PORT
299+
value: {{ coalesce .Values.global.istio.proxySidecarPort .Values.autoCreateConnector.istio.proxySidecarPort | quote }}
300+
{{- end }}
301+
{{- if .Values.global.useHATunnel }}
302+
- name: WIZ_USE_HATUNNEL
303+
value: "1"
304+
- name: WIZ_BROKER_HEARTBEAT_DISABLE_CLUSTER_ID
305+
value: "1"
306+
{{- end }}
332307
{{- end }}

wiz-kubernetes-connector/templates/job-delete-connector.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ spec:
8787
{{- end }}
8888
image: {{ include "wiz-broker.image" . }}
8989
imagePullPolicy: {{ coalesce .Values.global.image.pullPolicy .Values.image.pullPolicy }}
90-
command: ["/bin/sh", "-c"]
90+
command:
91+
{{- include "wiz-kubernetes-connector.entrypoint" . | nindent 12 }}
9192
args: {{- include "wiz-kubernetes-connector.argsListDeleteConnector" . | nindent 12 }}
9293
env:
9394
{{- include "wiz-kubernetes-connector.spec.common.envVars" . | trim | nindent 10 }}

wiz-kubernetes-connector/values.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ autoCreateConnector:
9999
# https://istio.io/latest/blog/2023/native-sidecars/
100100
istio:
101101
enabled: false
102-
sleepBeforeJobSecs: 15
103102
proxySidecarPort: 15000
104103

105104
wizApiToken:
@@ -170,6 +169,9 @@ wiz-broker:
170169
# The name of the service account to use.
171170
name: "wiz-broker"
172171

172+
# enable the restart rollout rbac policy
173+
autoRolloutUpdate: true
174+
173175
# API token should be read from an environment file, which is specified in podCustomEnvironmentVariablesFile
174176
# The file must contain the following lines:
175177
# WIZ_CLIENT_ID=<wiz service account id>
@@ -333,6 +335,24 @@ global:
333335
create: false # Secret created by wiz-kubernetes-connector.
334336
secretName: "" # The name of the proxy Secret.
335337

338+
# Set this to true if you are using Istio in sidecar mode.
339+
# When Istio uses sidecars, there are 2 issues when deploying Wiz:
340+
# 1) The creation and deletion Jobs never complete (due to istio-proxy sidecar)
341+
# 2) There is a race condition and possible network connectivity failures
342+
# when contacting the Wiz backend.
343+
#
344+
# When either of this happens, either the installation, upgrade or uninstallation
345+
# of the charts fail.
346+
# Setting this to true ensures that the istio-proxy gets a graceful shutdown
347+
# and mitigates the networking race condition by sleeping before the Job starts.
348+
# Learn more:
349+
# https://istio.io/latest/blog/2023/native-sidecars/
350+
istio:
351+
enabled: false
352+
proxySidecarPort: 0
353+
354+
useHATunnel: false
355+
336356
wiz-kubernetes-connector:
337357
resources: {}
338358
# We usually recommend not to specify default resources and to leave this as a conscious

wiz-kubernetes-integration/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: wiz-kubernetes-integration
33
description: A Helm chart for Kubernetes
44
type: application
5-
version: 0.2.110
5+
version: 0.2.111
66
appVersion: ""
77
# Dependencies for wiz-kubernetes connector and wiz-admission-controller and wiz-sensor
88
dependencies:

0 commit comments

Comments
 (0)