Repository navigation
Kubernetess
Source tutorial
https://www.youtube.com/watch?v=X48VuDVv0do&list=PPSV
Pod - the smallest unit of kubernetess cluster.
Replicaset - is managing replicas of the pod. In practice you don't have to create them, update, delete or manage in any way.
brew install minikube
brew install docker
minikube start --vm-driver=docker
kubectl get nodes
minikube status
kubectl get services
kubectl get pod
kubectl get pod -o wide //more concrete pod info
kubectl get replicaset
kubectl get deployment [deployment] -o yaml
kubectl get deployment [deployment] -o yaml > [savefilename.yaml]
kubectl logs [podname]
kubectl describe pod [podname]
kubectl descripe service [service name]
kubectl get all
kubectl create -h. // -h help,
Create deployment has all the information or blueprints to create the pod. The most basic (minimalistic) configuration for deployment - name and image to use
kubectl create deployment nginx-depl --image=nginx
kubeclt get deployment //to see list of deploymnets
kubectl logs nginx-depl-[podname]
kubectl edit deployment nginx-depl
kubectl create deployment mongo-depl --image=mongo
kubectl logs mongo-depl-[podname]
-it - means interactive terminal
kubectl exec -it [podname] -- bin/bash
exit //for leaving container
kubectl get deployment
kubectl delete deployment [deployment]
kubectl get pod // you should see Pod in status [Terminating]
kubectl apply -f nginx-deployment.yaml
Demo kubernetess file:
http://kubernetes.io/docs/tasks/run-application/run-stateless-application-deployment
Kubernetess file has following structure:
- metadata
- specification
- status - automatically generated and added by Kubernetess
Types of file:
- component
- service - opens component to the outer world
kubectrl api-resources --namespaced=false //shows resources without namespace
kubectrl api-resources --namespaced=true
brew install kubectx
kubens // list kubernetess namespaces
Component which should be used in produciton. Instead of direct expose to the service.
--watch - to not refresh table, this one waits, and refresh console for you...
kubectl get ingress -n kubernetes-dashboard --watch
Package manager for kuberneters.
Keeps histroy of helm charts executions. Removed in Helm 3.