top of page

Kubernetes Details

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Jul 12, 2022
  • 2 min read

ree


Commands

To get pods

kubectl get pod

To get deployment

kubectl get deployment

To get service

kubectl get service

To get help

kubectl -h


To create deployment

kubectl create deployment deployment-name --image image url


To get replicaset

kubectl get replicaset


To describe deployment

kubectl describe deployment deployment-name


To descibe pod

kubectl describe pod


To chnage deployment

kubectl edit deployment


To check log for a pod

kubectl logs pod-name


To go inside pod

kubectl exec -it podname --bin/bash


To delete deployment

kubectl delete deployment deployment-name


To deploy application with deployment file

kubectl apply -f deploy.yml


Kubernetes namespaces

K8 provides below namespaces

ree

to create namespace

kubectl create namespace my-namespace


to deploy in a namespace

kubectl apply -f user-service.yml --namespace=my-namespace


to get deployemnt in a namespace

kubectl get deployment -n my-namespace


To get pod in a namespace

kubectl get pod -n my-namespace


We can configure namespace in deployment file under metadata section

metadata:

namespace: my-namespace


Kubernetes Health Check

2 types of health check

  1. Readiness Probe

ree

Liveness Probe: to check if application is live or not, this is constant checking say every 5 min.

ree

ree

Ingress Component

route the traffic base on routing rule within k8 cluster.


There are 2 types services ,external service -ip for external service are exposed to outside world and for internal service is only exposed in the k8 cluster. User connect on external traffic and then access say DB which is on internal service inside k8 cluster. cluster ip denote ip for internal service while node port and load balancer type denote external service.


Ingress component allow external traffic on k8 cluster based on routing mechanism. We normally access application service with dns name and there should be routing mechanism which can route this dns to respective services. This is where ingress service is being used where we configure hostname, port, path & service.

ree

Ingress make use of Ingress Controller to identify traffic and route it accordingly.


ree

Please check below sample ingress where we define host. For this host, it define routing rule such as path, service and port. Based on this rule, ingress call respective backend service and serve the request.


ree

Please note that host name and its ip we need to map in host.properties




 
 
 

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page