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
# perform the command from this lab environment: | |
# https://studyk8s.club/cka-upgrade-k8s | |
# plan the upgrade | |
kubeadm upgrade plan | |
# upgrade the version of kubeadm | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https ca-certificates curl gpg | |
mkdir -p /etc/apt/keyrings/ |
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
# perform the commands from the following lab environment: | |
# https://studyk8s.club/cka-new-user | |
# view the config | |
k config-view | |
cat ~/.kube/config | |
echo $KUBECONFIG | |
cat /etc/kubernetes/admin.conf | |
# list the cluster users |
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
# perform the commands from the following lab environment: | |
# https://studyk8s.club/cka-ectd-backup | |
# set etcdctl environment variable api to version 3 | |
export ECTDCTL_API=3 | |
# etcd help menu | |
etcdctl snapshot -h | |
# backup etcd |
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
# perform the commands from the following site: | |
# https://studyk8s.club/cka-warmup | |
# list all the api resources | |
k api-resources | |
# help menu is your friend | |
k -h | |
# help menu goes many levels deep |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: email-service | |
name: email-service | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
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
# add bitnami repo for access to prometheus helm chart | |
helm repo add bitnami https://charts.bitnami.com/bitnami | |
# install prometheus operator via helm chart | |
helm install prometheus bitnami/kube-prometheus | |
# watch as pods are created | |
kubectl get po -w | |
# customize the helm chart for grafana dashboard |
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 | |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | |
chmod 700 get_helm.sh | |
./get_helm.sh |
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 | |
kind create cluster —image kindest/node:v1.28.0 --name kind128 |
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 | |
apt update && apt install -y bash-completion | |
echo 'source <(kubectl completion bash)' >> ~/.bashrc | |
echo 'source /usr/share/bash-completion/bash_completion' >> ~/.bashrc | |
echo 'alias k=kubectl' >> ~/.bashrc | |
echo 'complete -o default -F __start_kubectl k' >> ~/.bashrc | |
source ~/.bashrc |
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 | |
# from a shell to kind-control-plane | |
# install bash completion with apt package manager | |
apt update && apt install -y bash-completion | |
# add kubectl bash completion to bashrc | |
echo 'source <(kubectl completion bash)' >> ~/.bashrc | |
# add the source for bash completion to bashrc |