From ab6bba11a9cd928e85253086d35b503846f29424 Mon Sep 17 00:00:00 2001 From: Sagar Utekar Date: Sat, 13 Apr 2024 06:41:57 +0530 Subject: [PATCH] Update guide.md --- kcdpune/guide.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/kcdpune/guide.md b/kcdpune/guide.md index 1d842c9..852df28 100644 --- a/kcdpune/guide.md +++ b/kcdpune/guide.md @@ -1,4 +1,5 @@ # Deploy an app +``` kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 kubectl get deployments @@ -6,17 +7,21 @@ export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{ echo Name of the Pod: $POD_NAME curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME:8080/proxy/ +```
# Explore app +``` kubectl get - list resources kubectl describe - show detailed information about a resource kubectl logs - print the logs from a container in a pod kubectl exec - execute a command on a container in a pod +```
# Expose app publicly +``` kubectl get services kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080 kubectl describe services/kubernetes-bootcamp @@ -28,19 +33,24 @@ minikube service kubernetes-bootcamp --url curl 127.0.0.1:51082 kubectl delete service -l app=kubernetes-bootcamp +```
+ # Scaling your app +``` kubectl get deployments kubectl scale deployments/kubernetes-bootcamp --replicas=4 kubectl describe deployments/kubernetes-bootcamp kubectl scale deployments/kubernetes-bootcamp --replicas=2 +```
# Update your app +``` kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=docker.io/jocatalin/kubernetes-bootcamp:v2 kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=gcr.io/google-samples/kubernetes-bootcamp:v10 kubectl get deployments kubectl rollout undo deployments/kubernetes-bootcamp kubectl delete deployments/kubernetes-bootcamp services/kubernetes-bootcamp - +```