Skip to content

Instantly share code, notes, and snippets.

@raykao
Created September 16, 2021 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raykao/1b22f8a807eeda584137ac944c1ea2b9 to your computer and use it in GitHub Desktop.
Save raykao/1b22f8a807eeda584137ac944c1ea2b9 to your computer and use it in GitHub Desktop.
used for demo environment
#!/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