Skip to content

Commit

Permalink
Update guide.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagar2366 authored Apr 13, 2024
1 parent 3aa312f commit ab6bba1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion kcdpune/guide.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# Deploy an app
```
kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1
kubectl get deployments
export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
echo Name of the Pod: $POD_NAME
curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME:8080/proxy/
```
<br/>


# 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
```
<br/>

# Expose app publicly
```
kubectl get services
kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080
kubectl describe services/kubernetes-bootcamp
Expand All @@ -28,19 +33,24 @@ minikube service kubernetes-bootcamp --url <Separate terminal>
curl 127.0.0.1:51082
kubectl delete service -l app=kubernetes-bootcamp
```
<br/>


# 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
```
<br/>

# 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

```

0 comments on commit ab6bba1

Please sign in to comment.