Skip to content

Instantly share code, notes, and snippets.

@alces
Created September 5, 2024 08:51
Show Gist options
  • Save alces/a67090757398fd9d93d94ece11b925a0 to your computer and use it in GitHub Desktop.
Save alces/a67090757398fd9d93d94ece11b925a0 to your computer and use it in GitHub Desktop.

Revisions

  1. alces created this gist Sep 5, 2024.
    6 changes: 6 additions & 0 deletions k8s_patch_sidecar_version.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    for ns in $(kubectl get sts --all-namespaces | awk '{if ($2 == "zookeeper") {print $1}}'); do
    if [ $(kubectl get sts zookeeper -n $ns -o json | jq '.spec.template.spec.containers[1].image') != null ]; then
    kubectl patch sts zookeeper -n $ns \
    -p '{"spec":{"template":{"spec": {"containers":[{"name": "jmx-exporter", "image":"bitnami/jmx-exporter:1.0.1"}]}}}}'
    fi
    done