Skip to content

Commit

Permalink
fix(helm): use a directory to store bootstrap time
Browse files Browse the repository at this point in the history
Fixes: cilium#14483

Signed-off-by: Raphaël Pinson <raphael@isovalent.com>
  • Loading branch information
raphink authored and aanm committed Apr 5, 2022
1 parent f1b52db commit 27a93e8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Documentation/helm-values.rst

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion install/kubernetes/cilium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ contributors across the globe, there is almost always someone available to help.
| nodePort.enabled | bool | `false` | Enable the Cilium NodePort service implementation. |
| nodeSelector | object | `{"kubernetes.io/os":"linux"}` | Node selector for cilium-agent. |
| nodeinit.affinity | object | `{}` | Affinity for cilium-nodeinit |
| nodeinit.bootstrapFile | string | `"/tmp/cilium-bootstrap-time"` | bootstrapFile is the location of the file where the bootstrap timestamp is written by the node-init DaemonSet |
| nodeinit.bootstrapFile | string | `"/tmp/cilium-bootstrap.d/cilium-bootstrap-time"` | bootstrapFile is the location of the file where the bootstrap timestamp is written by the node-init DaemonSet |
| nodeinit.enabled | bool | `false` | Enable the node initialization DaemonSet |
| nodeinit.extraEnv | list | `[]` | Additional nodeinit environment variables. |
| nodeinit.image | object | `{"override":null,"pullPolicy":"Always","repository":"quay.io/cilium/startup-script","tag":"d69851597ea019af980891a4628fb36b7880ec26"}` | node-init image. |
Expand Down
2 changes: 1 addition & 1 deletion install/kubernetes/cilium/files/nodeinit/prestop.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if ip link show cilium_host; then
fi

{{- if not (eq .Values.nodeinit.bootstrapFile "") }}
rm -f {{ .Values.nodeinit.bootstrapFile }}
rm -f {{ .Values.nodeinit.bootstrapFile | quote }}
{{- end }}

rm -f /tmp/node-init.cilium.io
Expand Down
3 changes: 2 additions & 1 deletion install/kubernetes/cilium/files/nodeinit/startup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ iptables -w -t nat -D POSTROUTING -m comment --comment "ip-masq: ensure nat POST
{{- end }}

{{- if not (eq .Values.nodeinit.bootstrapFile "") }}
date > {{ .Values.nodeinit.bootstrapFile }}
mkdir -p {{ .Values.nodeinit.bootstrapFile | dir | quote }}
date > {{ .Values.nodeinit.bootstrapFile | quote }}
{{- end }}

{{- if .Values.azure.enabled }}
Expand Down
12 changes: 6 additions & 6 deletions install/kubernetes/cilium/templates/cilium-agent/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,13 @@ spec:
- sh
- -c
- |
until test -s {{ .Values.nodeinit.bootstrapFile | quote }}; do
until test -s {{ (print "/tmp/cilium-bootstrap.d/" (.Values.nodeinit.bootstrapFile | base)) | quote }}; do
echo "Waiting on node-init to run...";
sleep 1;
done
volumeMounts:
- name: cilium-bootstrap-file
mountPath: {{ .Values.nodeinit.bootstrapFile }}
- name: cilium-bootstrap-file-dir
mountPath: "/tmp/cilium-bootstrap.d"
{{- end }}
- name: clean-cilium-state
image: {{ include "cilium.image" .Values.image | quote }}
Expand Down Expand Up @@ -515,10 +515,10 @@ spec:
type: FileOrCreate
{{- end }}
{{- if and .Values.nodeinit.enabled .Values.nodeinit.bootstrapFile }}
- name: cilium-bootstrap-file
- name: cilium-bootstrap-file-dir
hostPath:
path: {{ .Values.nodeinit.bootstrapFile }}
type: FileOrCreate
path: {{ .Values.nodeinit.bootstrapFile | dir | quote }}
type: DirectoryOrCreate
{{- end }}
{{- if .Values.etcd.enabled }}
# To read the etcd config stored in config maps
Expand Down
2 changes: 1 addition & 1 deletion install/kubernetes/cilium/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,7 @@ nodeinit:

# -- bootstrapFile is the location of the file where the bootstrap timestamp is
# written by the node-init DaemonSet
bootstrapFile: "/tmp/cilium-bootstrap-time"
bootstrapFile: "/tmp/cilium-bootstrap.d/cilium-bootstrap-time"

preflight:
# -- Enable Cilium pre-flight resources (required for upgrade)
Expand Down

0 comments on commit 27a93e8

Please sign in to comment.