Posts

Showing posts from January 4, 2022

Kubernetes object

 Kubernetes is a powerful container orchestration platform that uses various objects to manage the deployment, scaling, and operation of application containers. Here’s a step-by-step guide to some of the key Kubernetes objects with examples: 1. Pod A Pod is the smallest and simplest Kubernetes object. It represents a single instance of a running process in your cluster. Example: Create a file named pod-example.yaml : apiVersion: v1 kind: Pod metadata: name: my-pod spec: containers: - name: my-container image: nginx:latest ports: - containerPort: 80 Commands: kubectl apply -f pod-example.yaml kubectl get pods kubectl describe pod my-pod 2. Service A Service is an abstraction that defines a logical set of Pods and a policy by which to access them. This can be used to expose your application. Example: Create a file named service-example.yaml : apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app: my-app po...