Overview of Kubernetes Components and Plugins
This article provides a comprehensive overview of Kubernetes core components, such as Master and Worker nodes, and explains the purpose and usage of various plugins—including network, volume, ingress, DNS, dashboard, heapster, kubelet, and container runtime—along with practical command‑line examples for each.
Kubernetes (K8s) Components K8s clusters consist of core components, including Master and Worker nodes, which manage and run applications. The Master runs the API server, scheduler, etc., while Workers run kubelet and the container runtime.
Plugins extend K8s functionality. Examples include Network Plugins (e.g., Calico, Flannel), Volume Plugins (e.g., GlusterFS, NFS), and Ingress Plugins (e.g., Traefik, HAProxy) that provide networking, storage, and external traffic support.
Kubernetes DNS is a core component that resolves DNS queries for services and endpoints, enabling applications to access external resources via stable DNS names. It updates records automatically when services change.
Example commands for DNS:
kubectl run dns-example --image=dnsutils --restart=Never kubectl exec -ti dns-example nslookup myservice.mydomain.com cat <<eof | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: myservice
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
EOF dig myservice.mydomain.comKubernetes Dashboard provides a graphical UI to view and manage cluster objects (nodes, pods, services, deployments) and supports monitoring, alerts, and auto‑completion.
kubectl proxy kubectl get pods --namespace default kubectl edit pods mypod --namespace=default kubectl logs mypod --namespace=defaultHeapster is a monitoring plugin that collects CPU, memory, and network metrics, sending them to tools like InfluxDB or Grafana.
helm install stable/heapster --name heapster kubectl top pods kubectl top pods --all-namespaces heapster rules create rule.ymlIngress Controller forwards external traffic into the cluster using Ingress resources, supporting load balancing and SSL termination.
helm install stable/nginx-ingress cat <<eof | kubectl apply -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: example-ingress
annotations:
ingress.kubernetes.io/ssl-redirect: "true"
spec:
rules:
- host: example.com
http:
paths:
- path: /
backend:
serviceName: example-service
servicePort: 80
EOF curl https://example.com/Kubelet runs on each node as a daemon, receiving tasks from the API server, creating and destroying pods, and monitoring pod status.
cat <<eof | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: nginx:latest
EOF kubectl set image my-pod=my-image kubectl delete pod my-podContainer Runtime (Docker or compatible runtimes) provides the low‑level virtualization layer for K8s, handling image management, container execution, networking, and storage.
docker ps docker pull <image> docker images docker run <image>Network Plugin manages network connectivity on nodes. Types include Overlay (Flannel, Calico), Underlay, and CNI plugins.
helm install stable/flannel-crd --name flannel-crd helm install stable/flannel --set network-plugin=flannel-crd --version=v0.9.1 kubectl get pods --output=jsonpath='{range .items[*]}{.status.podIP}{end}' ip route show table local dig @<pod-ip> <host>Volume Plugin provides persistent storage for pods, supporting NFS, GlusterFS, AWS EBS, etc.
cat <<eof | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pv-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
EOF cat <<eof | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: nginx:latest
volumeMounts:
- mountPath: /data
name: data-volume
volumes:
- name: data-volume
persistentVolumeClaim:
claimName: my-pv-claim
EOF kubectl cp source-pod:/path/to/data destination-pod:/path/to/dataIngress Plugin (e.g., NGINX, Traefik) enables external access, SSL, load balancing, and URL rewriting.
helm install stable/nginx-ingress cat <<eof | kubectl apply -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: example-ingress
annotations:
ingress.kubernetes.io/ssl-redirect: "true"
spec:
rules:
- host: example.com
http:
paths:
- path: /
backend:
serviceName: example-service
servicePort: 80
EOF kubectl patch secret example-secret -p '{"data":{"tls.crt":"$(cat cert.pem | base64 | tr -d '
')","tls.key":"$(cat key.pem | base64 | tr -d '
')"}}' curl https://example.com/Other Plugins such as Job, CronJob, Scheduler, and Autoscaler extend Kubernetes functionality for batch processing, scheduled tasks, pod placement, and automatic scaling.
cat <<eof | kubectl apply -f -
apiVersion: batch/v1
kind: Job
metadata:
name: job-example
spec:
template:
spec:
containers:
- name: job-container
image: busybox
command: ["sh","-c","echo hello && sleep 30"]
restartPolicy: OnFailure
EOF cat <<eof | kubectl apply -f -
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: cron-job-example
spec:
schedule: "*/5 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: cron-job-container
image: busybox
command: ["sh","-c","echo hello && sleep 30"]
restartPolicy: OnFailure
EOF helm install stable/scheduler --name scheduler-example kubectl autoscale deployment example-deployment --min=1 --max=5Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
