Kubernetes :4

DevOps Classroom Series – 08/Apr/2021

Pod

  • This is smallest deployable units of computing in k8s
  • A Pod consists of one or more containers with shared network and storage resources
  • Each Pod will recieve a unique ip address
  • To create any object in k8s we need to create a template
  • To write the spec navigate to api reference Refer Here
  • Refer Here for the pods specs created
  • Now lets try to apply the pod spec created Preview
  • Each pod will get one ip address Preview Preview

kubernetes namespace

  • K8s supports multiple virtual cluster backed by same physical cluster and these virtual clusters are called as namespace
  • In k8s for any object we have two kinds of scopes
    • cluster scope
    • namespace scope

Commonly used kubectl commands

  • get object: In the resources which are scoped to namespace we can use -n to specify the namespace
kubectl get pods -n default

Preview
  • describe object-type object-name: Preview
  • logs object-name: Preview
  • apply -f filename.yaml
  • Other Commands Preview
  • We can use short names Preview
  • To get to know the information of cluster Preview

Kubernetes HTTP Request Flow

The K8s API

  • K8s api uses JSON over http for its requests and responses.
  • k8s api allows clients to create, update, delete or read the description of object via standard http methods Preview Preview Preview Preview
  • Trace the HTTP requests: To trace http request we will be using kubectl get pods -n kube-system. To this we will be adding verbose level –v=8
kubectl get pods -n kube-system --v=8

Preview *