Get ready for your next interview with our comprehensive question library
Kubernetes is an open-source container orchestration platform that automates deployment, scaling, and management of containerized applications. The main components include:
Master Node Components:
# Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.20
Namespaces provide a way to partition cluster resources between multiple users or teams. They create virtual clusters within a physical cluster, enabling:
kubectl create namespace development
kubectl get pods --namespace=development
Service types determine how services are exposed:
# NodePort Service
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: NodePort
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
nodePort: 30007
Systematic troubleshooting approach:
# Check pod status
kubectl get pods -o wide
# Describe pod for events
kubectl describe pod <pod-name>
# Check logs
kubectl logs <pod-name>
# Check previous container logs if restarting
kubectl logs <pod-name> --previous
# Check node resources
kubectl top nodes
kubectl describe node <node-name>
Common issues:
Pod lifecycle phases:
Upgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumAccess all premium content - interview questions, and other learning resources
We regularly update our features and content, to ensure you get the most relevant and updated premium content.
1000 monthly credits
Cancel anytime