Last active
June 21, 2024 15:24
-
-
Save leenagupte/31531dcea660455c3a615f0c3626bfc6 to your computer and use it in GitHub Desktop.
CKAD training setup
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
Link to CKAD training (will need to sign in): | |
https://trainingportal.linuxfoundation.org/learn/course/kubernetes-for-developers-lfd259/deployment-configuration/deployment-configuration | |
console.cloud.google.com | |
This is already done: | |
- VPC Network -> VPC Networks | |
- Firewall | |
Need to set up this again: | |
Compute Engine -> VM Instances | |
https://scribehow.com/shared/Create_Compute_Engine_instance_with_Ubuntu_and_SSH_key__hhUkshvOTJmXLpJ1mBg4ZA | |
CP: | |
ssh -i ~/.ssh/lfclass student@34.78.179.101 | |
Worker: | |
ssh -i ~/.ssh/lfclass student@34.78.100.81 | |
On both nodes: | |
wget https://cm.lf.training/LFD259/LFD259_V2024-02-22_SOLUTIONS.tar.xz --user=LFtraining --password=Penguin2014 | |
tar -xvf LFD259_V2024-02-22_SOLUTIONS.tar.xz | |
On CP node: | |
find $HOME -name k8scp.sh | |
cp LFD259/SOLUTIONS/s_02/k8scp.sh . | |
bash k8scp.sh | tee $HOME/cp.out | |
On Worker node: | |
find $HOME -name k8sWorker.sh | |
cp LFD259/SOLUTIONS/s_02/k8sWorker.sh . | |
bash k8sWorker.sh | tee $HOME/cp.out | |
kudeadm step: | |
The kubeadm joinstatement can be found nearthe end of thekubeadm initoutput on the cp node. It should also be in the filecp.outas well. Your nodes will use adifferent IP address and hashes than the example below. You’ll need to pre-pend sudo to run the script copied from the cp node. | |
student@worker: ̃$ sudo kubeadm join --token 118c3e.83b49999dc5dc034 \10.128.0.3:6443 --discovery-token-ca-cert-hash \sha256:40aa946e3f53e38271bae24723866f56c86d77efb49aedeb8a70cc189bfe2e1d | |
Bash completion: | |
student@cp: ̃$ sudo apt-get install bash-completion vim -y | |
student@cp: ̃$ source <(kubectl completion bash) | |
student@cp: ̃$ echo "source <(kubectl completion bash)" >> $HOME/.bashrc | |
Add taints: | |
student@cp:~$ kubectl taint nodes --all node-role.kubernetes.io/control-plane- | |
Needed for Lab 5: (Can get this from lab 3) | |
Need to tag and push the image | |
student@worker: ̃$ find $HOME -name local-repo-setup.sh | |
student@worker: ̃$ cp /home/student/LFD259/SOLUTIONS/s_03/local-repo-setup.sh $HOME | |
student@worker: ̃$ chmod +x $HOME/local-repo-setup.sh | |
student@worker: ̃$ . $HOME/local-repo-setup.sh # dot <space> scriptname to set correct variables | |
student@worker: ̃$ sudo podman pull $repo/tagtest # if needed export repo=10.97.40.62:5000 | |
sudo podman tag simpleapp $repo/simpleapp | |
sudo podman push $repo/simpleapp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment