Day 33: Working with Namespaces and Services in Kubernetes
Anup D Ghattikar
Data Reseach Analyst | Software Developer | Python | Django | Mysql | Devops
Namespaces and Services in k8s.
Namespaces are a way to organize clusters into virtual sub-clusters — they can be helpful when different teams or projects share a Kubernetes cluster. Any number of namespaces are supported within a cluster, each logically separated from others but with the ability to communicate with each other.
Task 1:
kubectl create namespace <namespace-name
Update the Deployment.yaml file to include the Namespace
kubectl apply -f deployment.yml -n <namespace-name>
Kubectl get namespaces
Task 2:
Services:
The Service API, part of Kubernetes, is an abstraction to help you expose groups of Pods over a network. Each Service object defines a logical set of endpoints (usually these endpoints are Pods) along with a policy about how to make those pods accessible.
Networking:
Kubernetes (sometimes referred to as K8s) is an open-source platform that is used to manage and automate the deployment, scheduling, monitoring, maintenance, and operation of application containers across a cluster of machines.
Load Balancing:
The load balancer tracks the availability of pods with the Kubernetes Endpoints API. When it receives a request for a specific Kubernetes service, the Kubernetes load balancer sorts in order or round robins the request among relevant Kubernetes pods for the service.