Skip to content

Commit 6c3d56b

Browse files
committed
add bottlerocket option
Signed-off-by: Prabhjot <psb@tetrate.io>
1 parent b40623f commit 6c3d56b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

manifests/charts/istio-cni/templates/daemonset.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,32 @@ spec:
142142
seccompProfile:
143143
{{ toYaml .Values.seccompProfile | trim | indent 14 }}
144144
{{- end }}
145+
{{- if .Values.bottlerocketFips }}
146+
command: ["/bin/sh", "-c"]
147+
args:
148+
- |
149+
set -e
150+
# Bottlerocket FIPS AMI sets GODEBUG=fips140=on in containerd's
151+
# systemd env. CNI plugins inherit this, which conflicts with
152+
# GOEXPERIMENT=boringcrypto. This shim strips GODEBUG before exec.
153+
SRC="/opt/cni/bin/istio-cni"
154+
HOST_RAW="/host/opt/cni/bin/istio-cni-raw"
155+
HOST_SHIM="/host/opt/cni/bin/istio-cni"
156+
cp "$SRC" "$HOST_RAW"
157+
cat <<'EOF' > "$HOST_SHIM"
158+
#!/usr/bin/env -S -u GODEBUG /opt/cni/bin/istio-cni-raw
159+
EOF
160+
chmod +x "$HOST_RAW" "$HOST_SHIM"
161+
cp "$HOST_SHIM" "$SRC"
162+
echo "[fips-shim] Deployed"
163+
exec install-cni \
164+
{{- if or .Values.logging.level .Values.global.logging.level }}
165+
--log_output_level={{ coalesce .Values.logging.level .Values.global.logging.level }} \
166+
{{- end }}
167+
{{- if .Values.global.logAsJson }}
168+
--log_as_json \
169+
{{- end }}
170+
{{- else }}
145171
command: ["install-cni"]
146172
args:
147173
{{- if or .Values.logging.level .Values.global.logging.level }}
@@ -150,6 +176,7 @@ spec:
150176
{{- if .Values.global.logAsJson }}
151177
- --log_as_json
152178
{{- end}}
179+
{{- end }}
153180
envFrom:
154181
- configMapRef:
155182
name: {{ template "name" . }}-config

0 commit comments

Comments
 (0)