Skip to content

Commit 791d74e

Browse files
committed
merge
2 parents 6b0c745 + 8ba3a59 commit 791d74e

File tree

20 files changed

+246
-27
lines changed

20 files changed

+246
-27
lines changed

.circleci/package_index.sh

100644100755
Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,33 @@ PACKAGE_FULL_NAME="${PACKAGE}-${PACKAGE_VERSION}.tgz"
66
git config user.email "[email protected]"
77
git config user.name "CircleCI"
88

9-
# Update package dependencies
10-
helm dependency update $PACKAGE
9+
ATTEMPTS=20
10+
SLEEP_INTERVAL=30
11+
12+
for i in $(seq 1 $ATTEMPTS); do
13+
set +e
14+
# Try updating package dependencies
15+
output=$(helm dependency update $PACKAGE 2>&1)
16+
exit_code=$?
17+
set -e
18+
19+
if echo "$output" | grep -q "can't get a valid version"; then
20+
echo "Attempt $i/$ATTEMPTS: Dependency not available yet. Retrying in $SLEEP_INTERVAL seconds..."
21+
sleep $SLEEP_INTERVAL
22+
elif [ $exit_code -eq 0 ]; then
23+
echo "Dependency update succeeded."
24+
break
25+
else
26+
echo "Error: $output"
27+
exit 1
28+
fi
29+
done
30+
31+
if [ $i -eq $ATTEMPTS ]; then
32+
echo "Failed to update dependencies after $ATTEMPTS attempts with the following error:"
33+
echo "$output"
34+
exit 1
35+
fi
1136

1237
# Package the chart with diffs
1338
helm package $PACKAGE

flux2/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ name: flux2
88
sources:
99
- https://github.com/fluxcd-community/helm-charts
1010
type: application
11-
version: 2024.10.08-rc
11+
version: 2024.10.30

git-proxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
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: 2024.10.08-rc
18+
version: 2024.10.30
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

git-proxy/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ image:
6161
namePrefix: wiz-git-proxy
6262
pullPolicy: Always
6363
# Overrides the image tag whose default is the chart appVersion.
64-
tag: "89ac334c3c709b3d9ab72ae32234611f82da1b82-multiarch"
64+
tag: "85fae5662b6d70b9b7850b5446ccda64ddf5b8ce-multiarch"
6565

6666
imagePullSecrets: []
6767
nameOverride: ""

wiz-admission-controller/templates/_helpers.tpl

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ If release name contains chart name it will be used as a full name.
5353
{{- end }}
5454
{{- end }}
5555

56+
{{- define "wiz-hpa-enforcer.name" -}}
57+
{{- printf "%s-hpa" (include "wiz-admission-controller.fullname" .) | trunc 63 | trimSuffix "-" }}
58+
{{- end }}
59+
60+
{{- define "wiz-hpa-audit-logs.name" -}}
61+
{{- printf "%s-hpa" (include "wiz-kubernetes-audit-log-collector.name" .) | trunc 63 | trimSuffix "-" }}
62+
{{- end }}
63+
5664
{{/*
5765
Create chart name and version as used by the chart label.
5866
*/}}
@@ -126,6 +134,21 @@ app.kubernetes.io/name: {{ include "wiz-admission-controller-manager.name" . }}
126134
{{ include "wiz-admission-controller-manager.selectorLabels" . }}
127135
{{- end }}
128136

137+
{{/*
138+
Wiz Horizontal Pod Autoscaler labels
139+
*/}}
140+
141+
{{- define "wiz-hpa-enforcer.labels" -}}
142+
{{ include "wiz-admission-controller.labels" . }}
143+
app.kubernetes.io/name: {{ include "wiz-hpa-enforcer.name" . }}
144+
{{- end }}
145+
146+
{{- define "wiz-hpa-audit-logs.labels" -}}
147+
{{ include "wiz-admission-controller.labels" . }}
148+
app.kubernetes.io/name: {{ include "wiz-hpa-audit-logs.name" . }}
149+
{{- end }}
150+
151+
129152
{{/*
130153
131154
{{/*
@@ -220,6 +243,43 @@ Use for debug purpose only.
220243
{{- . | mustToPrettyJson | printf "\nThe JSON output of the dumped var is: \n%s" | fail }}
221244
{{- end -}}
222245

246+
{{- define "wiz-admission-controller.resources" -}}
247+
{{- if hasKey .Values "resources" }}
248+
{{- toYaml .Values.resources }}
249+
{{- else -}}
250+
{{- if .Values.hpa.enabled }}
251+
requests:
252+
cpu: 500m
253+
memory: 300Mi
254+
{{- else }}
255+
{}
256+
{{- end -}}
257+
{{- end -}}
258+
{{- end -}}
259+
260+
{{- define "wiz-admission-controller.isEnforcerEnabled" -}}
261+
{{- if or .Values.opaWebhook.enabled .Values.imageIntegrityWebhook.enabled .Values.debugWebhook.enabled }}
262+
true
263+
{{- else }}
264+
false
265+
{{- end }}
266+
{{- end }}
267+
268+
{{- define "wiz-admission-controller.hpaBehavior" -}}
269+
{{- if hasKey .Values.hpa "behavior" }}
270+
{{- toYaml .Values.hpa.behavior }}
271+
{{- else -}}
272+
scaleUp:
273+
stabilizationWindowSeconds: 300
274+
scaleDown:
275+
stabilizationWindowSeconds: 300
276+
policies:
277+
- type: Pods
278+
value: 1
279+
periodSeconds: 300
280+
{{- end -}}
281+
{{- end -}}
282+
223283
{{- define "autoUpdate.deployments" -}}
224284
{{- $list := list -}}
225285
{{- if or .Values.opaWebhook.enabled .Values.imageIntegrityWebhook.enabled .Values.debugWebhook.enabled -}}

wiz-admission-controller/templates/deploymentauditlogs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ metadata:
77
labels:
88
{{- include "wiz-kubernetes-audit-log-collector.labels" . | nindent 4 }}
99
spec:
10+
{{- if not .Values.hpa.enabled }}
1011
replicas: {{ .Values.kubernetesAuditLogsWebhook.replicaCount }}
12+
{{- end }}
1113
selector:
1214
matchLabels:
1315
{{- include "wiz-admission-controller.selectorLabels" . | nindent 6 }}
@@ -188,7 +190,7 @@ spec:
188190
value: "{{ .Values.global.istio.proxySidecarPort }}"
189191
{{- end }}
190192
resources:
191-
{{- toYaml .Values.resources | nindent 12 }}
193+
{{- include "wiz-admission-controller.resources" . | nindent 12 }}
192194
volumeMounts:
193195
- mountPath: /var/server-certs
194196
name: server-certs

wiz-admission-controller/templates/deploymentenforcement.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ metadata:
77
labels:
88
{{- include "wiz-admission-controller-enforcement.labels" . | nindent 4 }}
99
spec:
10+
{{- if not .Values.hpa.enabled }}
1011
replicas: {{ .Values.replicaCount }}
12+
{{- end }}
1113
selector:
1214
matchLabels:
1315
{{- include "wiz-admission-controller.selectorLabels" . | nindent 6 }}
@@ -217,7 +219,7 @@ spec:
217219
value: "{{ .Values.global.istio.proxySidecarPort }}"
218220
{{- end }}
219221
resources:
220-
{{- toYaml .Values.resources | nindent 12 }}
222+
{{- include "wiz-admission-controller.resources" . | nindent 12 }}
221223
volumeMounts:
222224
- mountPath: /var/cache
223225
name: cache
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{{- if .Values.hpa.enabled }}
2+
{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }}
3+
{{- if eq $isEnabled "true" }}
4+
apiVersion: autoscaling/v2
5+
kind: HorizontalPodAutoscaler
6+
metadata:
7+
name: {{ include "wiz-hpa-enforcer.name" . }}
8+
namespace: {{ .Release.Namespace }}
9+
labels:
10+
{{- include "wiz-hpa-enforcer.labels" . | nindent 4 }}
11+
spec:
12+
scaleTargetRef:
13+
apiVersion: apps/v1
14+
kind: Deployment
15+
name: {{ include "wiz-admission-controller.fullname" . }}
16+
minReplicas: {{ .Values.hpa.minReplicas }}
17+
maxReplicas: {{ .Values.hpa.maxReplicas }}
18+
metrics:
19+
{{- if .Values.hpa.enableCPU }}
20+
- type: Resource
21+
resource:
22+
name: cpu
23+
target:
24+
type: Utilization
25+
averageUtilization: {{ .Values.hpa.targetCPUUtilizationPercentage }}
26+
{{- end }}
27+
{{- if .Values.hpa.enableMemory }}
28+
- type: Resource
29+
resource:
30+
name: memory
31+
target:
32+
type: Utilization
33+
averageUtilization: {{ .Values.hpa.targetMemoryUtilizationPercentage }}
34+
{{- end }}
35+
{{- with .Values.hpa.customMetrics }}
36+
{{- toYaml . | nindent 4 }}
37+
{{- end }}
38+
behavior: {{ include "wiz-admission-controller.hpaBehavior" . | nindent 4 }}
39+
---
40+
{{- end }}
41+
{{ if .Values.kubernetesAuditLogsWebhook.enabled -}}
42+
apiVersion: autoscaling/v2
43+
kind: HorizontalPodAutoscaler
44+
metadata:
45+
name: {{ include "wiz-hpa-audit-logs.name" . }}
46+
namespace: {{ .Release.Namespace }}
47+
labels:
48+
{{- include "wiz-hpa-audit-logs.labels" . | nindent 4 }}
49+
spec:
50+
scaleTargetRef:
51+
apiVersion: apps/v1
52+
kind: Deployment
53+
name: {{ include "wiz-kubernetes-audit-log-collector.name" . }}
54+
minReplicas: {{ .Values.hpa.minReplicas }}
55+
maxReplicas: {{ .Values.hpa.maxReplicas }}
56+
metrics:
57+
{{- if .Values.hpa.enableCPU }}
58+
- type: Resource
59+
resource:
60+
name: cpu
61+
target:
62+
type: Utilization
63+
averageUtilization: {{ .Values.hpa.targetCPUUtilizationPercentage }}
64+
{{- end }}
65+
{{- if .Values.hpa.enableMemory }}
66+
- type: Resource
67+
resource:
68+
name: memory
69+
target:
70+
type: Utilization
71+
averageUtilization: {{ .Values.hpa.targetMemoryUtilizationPercentage }}
72+
{{- end }}
73+
{{- with .Values.hpa.customMetrics }}
74+
{{- toYaml . | nindent 4 }}
75+
{{- end }}
76+
behavior: {{ include "wiz-admission-controller.hpaBehavior" . | nindent 4 }}
77+
{{- end }}
78+
{{- end }}

wiz-admission-controller/templates/opawebhook.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ webhooks:
163163
failurePolicy: {{ .Values.debugWebhook.failurePolicy }}
164164
sideEffects: {{ .Values.debugWebhook.sideEffects }}
165165
{{- end }}
166-
{{- if and (or .Values.opaWebhook.enabled .Values.imageIntegrityWebhook.enabled .Values.kubernetesAuditLogsWebhook.enabled .Values.debugWebhook.enabled) (not $useCertManagerCerts) }}
166+
{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }}
167+
{{- if and (eq $isEnabled "true") (not $useCertManagerCerts) }}
167168
---
168169
apiVersion: v1
169170
kind: Secret

wiz-admission-controller/templates/service.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{{- if or .Values.opaWebhook.enabled .Values.imageIntegrityWebhook.enabled .Values.debugWebhook.enabled}}
1+
{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }}
2+
{{- if eq $isEnabled "true" }}
23
---
34
apiVersion: v1
45
kind: Service

0 commit comments

Comments
 (0)