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
| watch -n 1 gcloud container clusters list |
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
| watch -n 1 gcloud container clusters list |
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
| # Variables | |
| INSTANCE_IP=$(curl -s api.ipify.org) | |
| INSTANCE_CIDR=$INSTANCE_IP/32 | |
| ARRAY=("https-api-remote-k8s-local" "ssh-external-to-master-remote-k8s-local" "ssh-external-to-node-remote-k8s-local") | |
| for item in ${ARRAY[@]} | |
| do | |
| echo "Updating firewall-rule $item source-range to $INSTANCE_CIDR" | |
| gcloud compute firewall-rules update $item --source-ranges=$INSTANCE_CIDR |
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
| ## Setting variables for GKE | |
| export CLUSTER_NAME="central" | |
| export CLUSTER_ZONE="us-central1-b" | |
| export CLUSTER_KUBECONFIG=$WORK_DIR/$CLUSTER_NAME.context | |
| # Variables for remote kops cluster | |
| export REMOTE_CLUSTER_NAME_BASE="remote" | |
| export REMOTE_CLUSTER_NAME=$REMOTE_CLUSTER_NAME_BASE.k8s.local |
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
| Set up tmux panes in Cloud Shell | |
| You are going to configure three Cloud Shell panes so that you can issue commands in one pane and watch the effects on the two clusters in the other panes. | |
| Split the session screen with the tmux utility built-into Cloud Shell by typing <Ctrl>+b, then %. You should see 2 panes in the Cloud Shell. | |
| Dual tmux panes | |
| Any time you interact with tmux, you'll start with the <Ctrl>+b combination, which signals a command to tmux. | |
| Switch to the left-hand pane by typing: |
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
| export GCLOUD_EMAIL=$(gcloud config get-value account) | |
| cd $LAB_DIR | |
| ssh-keygen -t rsa -b 4096 \ | |
| -C "$GCLOUD_EMAIL" \ | |
| -N '' \ | |
| -f $HOME/.ssh/id_rsa.acm | |
| kubectx gke | |
| kubectl create secret generic git-creds \ | |
| --namespace=config-management-system \ |
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
| git init | |
| git add . | |
| git commit -m "Initial config repo commit" | |
| gcloud source repos create anthos_config | |
| git config credential.helper gcloud.sh | |
| git remote add origin https://source.developers.google.com/p/$PROJECT_ID/r/anthos_config | |
| git push origin master |
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
| export GCLOUD_EMAIL=$(gcloud config get-value account) | |
| echo $GCLOUD_EMAIL | |
| echo $USER | |
| git config --global user.email "$GCLOUD_EMAIL" | |
| git config --global user.name "$USER" |
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
| edit config-management-operator.yaml |
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
| export LAB_DIR=$HOME/acm-lab | |
| mkdir $LAB_DIR | |
| cd $LAB_DIR | |
| gsutil cp gs://config-management-release/released/latest/config-management-operator.yaml config-management-operator.yaml |