-
Notifications
You must be signed in to change notification settings - Fork 1
Kubernetes Setup
Franknaw edited this page Feb 2, 2021
·
2 revisions
-
Vagrant file for provisioning virtual machine environments.
-
Ansible file for provisioning Kubernetes master node.
-
Ansible file for provisioning Kubernetes secondary nodes.
-
Bring cluster up.
vagrant up
-
Stop cluster.
vagrant halt
-
Destroy cluster
vagrant destroy
-
Connect to master node
vagrant ssh k8s-master
-
Connect to secondary nodes
vagrant ssh node-1
vagrant ssh node-2
-
Connect to master node and run some Kubernetes commands
kubectl get nodes
kubectl cluster-info
kubectl describe node node-1
-
List all services in the namespace
kubectl get services
-
List all pods in all namespaces
kubectl get pods --all-namespaces
-
List all pods in the current namespace, with more details
kubectl get pods -o wide
-
List a particular deployment
kubectl get deployment my-dep
-
List all pods in the namespace
kubectl get pods
-
Get a pod's YAML
kubectl get pod my-pod -o yaml
-
https://192.168.50.10:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s
-
Get list of API's
kubectl api-resources -o wide
-
Get list of sub API's
for kind in `kubectl api-resources | tail +2 | awk '{ print $1 }' | sort`; do kubectl explain $kind ; done | grep -e "KIND:" -e "VERSION:" | awk '{print $2}' | paste -sd' \n'
- https://kubernetes.io/blog/2019/03/15/kubernetes-setup-using-ansible-and-vagrant/
- https://docs.projectcalico.org/archive/v3.17/getting-started/kubernetes/quickstart
- https://kubernetes.io/docs/reference/kubectl/cheatsheet/
- https://medium.com/google-cloud/kubernetes-101-pods-nodes-containers-and-clusters-c1509e409e16