Last active
November 23, 2023 09:14
-
-
Save suresh-sendinblue/7d8cd16f8916439c5a7984bd2d047c3e to your computer and use it in GitHub Desktop.
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 | |
| set -x | |
| kubeserver=$1 | |
| KUBECONFIG=$2 | |
| SA_TOKEN=$3 | |
| client_domain=$4 | |
| if (test -f $KUBECONFIG && ! test -f $SA_TOKEN); then | |
| if curl -s --insecure --connect-timeout 10 $kubeserver > /dev/null; then | |
| echo "$KUBESERVER is able to connect"; | |
| kubectl --kubeconfig $KUBECONFIG create serviceaccount argocd-sa -n kube-system | |
| kubectl --kubeconfig $KUBECONFIG create token argocd-sa -n kube-system --audience https://$client_domain > $SA_TOKEN; | |
| else | |
| echo "Connection refused: $KUBESERVER"; | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment