Category : Kubernetes | Sub Category : Learn Kubernetes | By Prasad Bonam Last updated: 2023-11-22 07:09:52 Viewed : 214
Lets go through the key components of Kubernetes architecture with examples:
Master Node:
API Server:
kubectl
is a command-line tool that interacts with the API server. For instance, kubectl get pods
fetches information about running pods.Controller Manager:
yamlapiVersion: v1
kind: ReplicationController
metadata:
name: my-replication-controller
spec:
replicas: 3
selector:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-container
image: my-image
Scheduler:
Node (Minion) / Worker Node:
Kubelet:
yamlapiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: container-1
image: image-1
- name: container-2
image: image-2
Container Runtime:
Kube Proxy:
yamlapiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app: my-app
ports:
- protocol: TCP
port: 80
targetPort: 8080
Pod:
yamlapiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: my-image
Controller:
yamlapiVersion: apps/v1
kind: ReplicaSet
metadata:
name: my-replicaset
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-container
image: my-image
Service:
app: frontend
.yamlapiVersion: v1
kind: Service
metadata:
name: frontend-service
spec:
selector:
app: frontend
ports:
- protocol: TCP
port: 80
targetPort: 8080
Volume:
yamlapiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: my-image
volumeMounts:
- name: my-volume
mountPath: /data
volumes:
- name: my-volume
emptyDir: {}
Namespace:
yamlapiVersion: v1
kind: Pod
metadata:
name: my-pod
namespace: my-namespace
spec:
containers:
- name: my-container
image: my-image
Label:
yamlapiVersion: v1
kind: Pod
metadata:
name: my-pod
labels:
app: my-app
spec:
containers:
- name: my-container
image: my-image
Annotation:
yamlapiVersion: v1
kind: Pod
metadata:
name: my-pod
annotations:
description: "This is my pod"
spec:
containers:
- name: my-container
image: my-image
Understanding these examples should provide you with a practical overview of how these components are used in Kubernetes architecture.