diff --git a/README.md b/README.md index 605b141..06b06f1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Cilium -The cluster CNI is managed with `cilium-cli` and pinned to Cilium `v1.19.1`. +The cluster CNI is managed with `cilium-cli` and pinned to Cilium `v1.20.0`. The values in `values.yaml` were recovered from the live Helm release with: ```sh -cilium-cli upgrade --version v1.19.1 --dry-run-helm-values +cilium-cli upgrade --version v1.20.0 --dry-run-helm-values ``` They preserve the Kubernetes API endpoint, VXLAN tunnel routing, diff --git a/install.sh b/install.sh index f27da1b..3268360 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -eu -CILIUM_VERSION=v1.19.1 +CILIUM_VERSION=v1.20.0 NAMESPACE=kube-system SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) @@ -25,8 +25,16 @@ kubectl wait --for=condition=Ready issuer/hubble-ca \ --namespace "$NAMESPACE" --timeout=2m existing_installation=false +version_change=false if kubectl get daemonset/cilium --namespace "$NAMESPACE" >/dev/null 2>&1; then existing_installation=true + current_image=$(kubectl get daemonset/cilium --namespace "$NAMESPACE" \ + --output=jsonpath='{.spec.template.spec.containers[0].image}') + case "$current_image" in + *":$CILIUM_VERSION"|*":$CILIUM_VERSION@"*) ;; + *) version_change=true ;; + esac + cilium-cli upgrade \ --version "$CILIUM_VERSION" \ --reset-values \ @@ -43,16 +51,24 @@ kubectl wait --for=condition=Ready certificate/hubble-server-certs \ kubectl wait --for=condition=Ready certificate/hubble-relay-client-certs \ --namespace "$NAMESPACE" --timeout=5m -# On an upgrade, running agents may still have the previous server certificate -# loaded. Roll them one at a time before restarting Relay with its new client -# certificate. Helm readiness cannot be used before this sequence completes. +# A version upgrade already changes the Pod templates. Wait for those rolling +# updates instead of forcing a second restart. A same-version reconcile still +# restarts the agents and Relay so renewed Hubble certificates are loaded. if [ "$existing_installation" = true ]; then - kubectl rollout restart daemonset/cilium --namespace "$NAMESPACE" + if [ "$version_change" = false ]; then + kubectl rollout restart daemonset/cilium --namespace "$NAMESPACE" + fi kubectl rollout status daemonset/cilium \ --namespace "$NAMESPACE" --timeout=10m + kubectl rollout status daemonset/cilium-envoy \ + --namespace "$NAMESPACE" --timeout=10m + kubectl rollout status deployment/cilium-operator \ + --namespace "$NAMESPACE" --timeout=10m fi -kubectl rollout restart deployment/hubble-relay --namespace "$NAMESPACE" +if [ "$version_change" = false ]; then + kubectl rollout restart deployment/hubble-relay --namespace "$NAMESPACE" +fi kubectl rollout status deployment/hubble-relay \ --namespace "$NAMESPACE" --timeout=5m diff --git a/values.yaml b/values.yaml index cc1770f..05ed1f5 100644 --- a/values.yaml +++ b/values.yaml @@ -1,5 +1,5 @@ -# Recovered from the live release with: -# cilium-cli upgrade --version v1.19.1 --dry-run-helm-values +# Originally recovered from the live release and validated with: +# cilium-cli upgrade --version v1.20.0 --dry-run-helm-values cluster: name: kubernetes