- List all pods:
kubectl get pods
- List all services:
kubectl get services
- List all replicasets:
kubectl get replicasets
- List pods and services together:
kubectl get pods,svc
- List all deployments:
kubectl get deployments
- Describe a specific resource (pod, service, deployment):
kubectl describe <resource> <name>
- Delete a specific pod, service, or deployment:
kubectl delete <resource> <name>
- Scale a deployment to a specific number of replicas:
kubectl scale deploy <name> --replicas=<number>
- Get the URL of a service (Minikube):
minikube service <service-name> --url
- Create voting app pod and service:
kubectl create -f voting-app-pod.yaml kubectl create -f voting-app-service.yaml
- Create Redis pod and service:
kubectl create -f redis-pod.yaml kubectl create -f redis-service.yaml
- Create Postgres pod and service:
kubectl create -f postgres-pod.yaml kubectl create -f postgres-service.yaml
- Create result app pod and service:
kubectl create -f result-pod.yaml kubectl create -f result-service.yaml
- Create worker pod:
kubectl create -f worker-pod.yaml
Note
Note: If services are already terminated, they should be restarted before creating deployments.
- Create worker app deployment:
kubectl create -f worker-app-deploy.yaml
- Create Postgres deployment:
kubectl create -f postgres-deploy.yaml
- Create voting app deployment:
kubectl create -f voting-app-deploy.yaml
- Create Redis deployment:
kubectl create -f redis-deploy.yaml
- Create result app deployment:
kubectl create -f result-app-deploy.yaml
- Resource Cleanup:
kubectl delete -f .