Created
September 16, 2021 01:34
-
-
Save raykao/1b22f8a807eeda584137ac944c1ea2b9 to your computer and use it in GitHub Desktop.
used for demo environment
This file contains 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 | |
# Wait for cloud-init to finish | |
while [ ! -f /tmp/cloud-init-done ]; do echo 'Waiting for cloud-init to complete.';sleep 5; done | |
ssh -o "StrictHostKeyChecking no" $USER@$CONTROL_HOST 'sudo cp /etc/rancher/k3s/k3s.yaml ~/;sudo chown $USER:$USER k3s.yaml' | |
mkdir .kube | |
scp -o "StrictHostKeyChecking no" $USER@$CONTROL_HOST:~/k3s.yaml ./.kube/config | |
chmod 640 ~/.kube/config | |
sed -i 's/127.0.0.1/'$CONTROL_HOST'/g' ./.kube/config | |
# Login to Azure with the vm managed identity | |
az login --identity | |
az config set extension.use_dynamic_install=yes_without_prompt | |
az extension add --name connectedk8s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment