Skip to content

Latest commit

 

History

History
86 lines (56 loc) · 2.8 KB

kuberneters.md

File metadata and controls

86 lines (56 loc) · 2.8 KB

...menustart

...menuend

K8s Key Ideas

Learn Kubernetes Basics

  • Cluster Diagram

  • access API server through kubectl proxy.

    $ curl http://localhost:8001/api/v1/namespaces/$NAMESPACE/pods/$POD_NAME/proxy/
    Hello Kubernetes bootcamp! | Running on: kubernetes-bootcamp-5c69669756-jwzln | v=1
  • Nodes

Using a Service to Expose Your App

  • Services allow your applications to receive traffic.
  • Services can be exposed in different ways by specifying a type in the ServiceSpec:
    • ClusterIP (default)
    • NodePort
    • LoadBalancer
    • ExternalName
  • A Service routes traffic across a set of Pods.
    • Services match a set of Pods using labels and selectors

Scale Your App

$ kubectl scale deployments/kubernetes-bootcamp --replicas=4
deployment.extensions/kubernetes-bootcamp scaled
$ kubectl get deployments
NAME                  DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
kubernetes-bootcamp   4         4         4            4           1m

Update Your App

$ kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=jocatalin/kubernetes-bootcamp:v2
deployment.extensions/kubernetes-bootcamp image updated

$ kubectl rollout status deployments/kubernetes-bootcamp
deployment "kubernetes-bootcamp" successfully rolled out
  • Rollback an update
$ kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=gcr.io/google-samples/kubernetes-bootcamp:v10
deployment.extensions/kubernetes-bootcamp image updated
$ kubectl rollout undo deployments/kubernetes-bootcamp
deployment.extensions/kubernetes-bootcamp