Created
April 28, 2023 15:03
-
-
Save magickatt/e7885f748c2ecd5bb88dd64828b30fbf to your computer and use it in GitHub Desktop.
Adopt most resources into a Helm install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NAME=test | |
NAMESPACE=default | |
RESOURCES=service,role.rolebinding # Comma-delimited | |
kubectl get -n $NAMESPACE $RESOURCES -o name \ | |
| xargs -I % kubectl label -n $NAMESPACE % app.kubernetes.io/managed-by=Helm | |
kubectl get -n $NAMESPACE $RESOURCES -o name \ | |
| xargs -I % kubectl annotate -n $NAMESPACE % meta.helm.sh/release-name=$NAME | |
kubectl get -n $NAMESPACE $RESOURCES -o name \ | |
| xargs -I % kubectl annotate -n $NAMESPACE % meta.helm.sh/release-namespace=$NAMESPACE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment