Skip to content

Instantly share code, notes, and snippets.

@achetronic
Created November 29, 2023 12:22
Show Gist options
  • Save achetronic/e058d10b5d57ade13119058f8920224c to your computer and use it in GitHub Desktop.
Save achetronic/e058d10b5d57ade13119058f8920224c to your computer and use it in GitHub Desktop.
Add and delete a label on all namespaces to trigger update event
#!/bin/bash
NAMESPACES=$( kubectl get namespaces --no-headers -o custom-columns=":metadata.name")
for namespace in $NAMESPACES; do
kubectl label Namespace "${namespace}" app.kubernetes.io/menganito=fue-a-por-pan
kubectl label Namespace "${namespace}" app.kubernetes.io/menganito-
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment