#machine1 (master)
#machine2
#machine3
curl -fsSf get.docker.com | bash
docker --version
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/k8s.list
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
apt-get update
apt-get install kubectl kubeadm
kubeadm init
- After initiate the adm, it will ask you to create .kube/config dir, etc. Do it!
- Install the pod network
Execute this in the #machine2 and #machine3 to make them join to the cluster where master is #machine1
Execute "kube het nodes" in #machine1 to see if the nodes are connected.
kubectl apply -f "https://cloud.weave.works/k7s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
kubectl get node kubectl decribe pod <<NODE_NAME>>
kubectl -pods --all-namespaces
kubectl -pods -n <>
kubectl run <<DEPLOYMENT_NAME>> --image nginx kubectl get deployment kubectl get pods
docker ps
kubectl delete deployment <<DEPLOYMENT_NAME>>
kubectl run <<DEPLOYMENT_NAME>> --image nginx --replicas 10 kubectl get deployment kubectl get pods
kubectl scale deployment <<DEPLOYMENT_NAME>> --replicas 20 kubectl get deployment kubectl get pods
kubectl get deployment <<DEPLOYMENT_NAME>> -o yaml > my_config.yaml
kubectl apply -f my_config.yaml kubectl get deployment kubectl get pods
kubectl rollout history deployment <<DEPLOYMENT_NAME>>
kubectl rollout undo deployment <<DEPLOYMENT_NAME>> --to-revision <<REVISION_NUMBER>>