-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jbris
committed
Dec 12, 2023
1 parent
50abd43
commit 0fb1674
Showing
16 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl create deployment hello-node --image=registry.k8s.io/e2e-test-images/agnhost:2.39 -- /agnhost netexec --http-port=8080 | ||
|
||
kubectl get deployments | ||
|
||
kubectl get pods | ||
|
||
kubectl get events | ||
|
||
kubectl config view | ||
|
||
kubectl logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl delete service hello-node | ||
kubectl delete deployment hello-node | ||
|
||
minikube stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl create deployment hello-node --image=registry.k8s.io/e2e-test-images/agnhost:2.39 -- /agnhost netexec --http-port=8080 | ||
|
||
kubectl get deployments | ||
|
||
kubectl get pods | ||
|
||
kubectl get events | ||
|
||
kubectl config view | ||
|
||
kubectl logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl expose deployment hello-node --type=LoadBalancer --port=8080 | ||
|
||
kubectl get services | ||
|
||
minikube service hello-node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
minikube start | ||
|
||
minikube dashboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 | ||
|
||
kubectl get deployments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl proxy | ||
|
||
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
PODE_NAME=$1 | ||
|
||
kubectl get pods | ||
|
||
kubectl describe pods | ||
|
||
kubectl logs $PODE_NAME | ||
|
||
kubectl exec $POD_NAME -- ls | ||
|
||
curl http://localhost:8001 | ||
|
||
curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME:8080/proxy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl describe deployment | ||
|
||
kubectl get pods -l app=kubernetes-bootcamp | ||
|
||
kubectl get services -l app=kubernetes-bootcamp | ||
|
||
export POD_NAME="$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')" | ||
echo "Name of the Pod: $POD_NAME" | ||
|
||
kubectl label pods "$POD_NAME" version=v1 | ||
|
||
kubectl describe pods "$POD_NAME" | ||
|
||
kubectl get pods -l version=v1 | ||
|
||
kubectl delete service -l app=kubernetes-bootcamp | ||
|
||
kubectl exec -ti $POD_NAME -- curl http://localhost:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl get pods | ||
|
||
kubectl get services | ||
|
||
kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080 | ||
|
||
kubectl get services | ||
|
||
kubectl describe services/kubernetes-bootcamp | ||
|
||
export NODE_PORT="$(kubectl get services/kubernetes-bootcamp -o go-template='{{(index .spec.ports 0).nodePort}}')" | ||
echo "NODE_PORT=$NODE_PORT" | ||
|
||
curl http://"$(minikube ip):$NODE_PORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
minikube service kubernetes-bootcamp --url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl get deployments | ||
|
||
kubectl get rs | ||
|
||
kubectl scale deployments/kubernetes-bootcamp --replicas=4 | ||
|
||
kubectl get deployments | ||
|
||
kubectl get pods -o wide | ||
|
||
kubectl describe deployments/kubernetes-bootcamp | ||
|
||
kubectl describe services/kubernetes-bootcamp | ||
|
||
export NODE_PORT="$(kubectl get services/kubernetes-bootcamp -o go-template='{{(index .spec.ports 0).nodePort}}')" | ||
|
||
echo NODE_PORT=$NODE_PORT | ||
|
||
curl http://"$(minikube ip):$NODE_PORT" | ||
|
||
kubectl scale deployments/kubernetes-bootcamp --replicas=2 | ||
|
||
kubectl get deployments | ||
|
||
kubectl get pods -o wide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
minikube service kubernetes-bootcamp --url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=gcr.io/google-samples/kubernetes-bootcamp:v10 | ||
|
||
kubectl get deployments | ||
|
||
kubectl get pods | ||
|
||
kubectl describe pods | ||
|
||
kubectl rollout undo deployments/kubernetes-bootcamp | ||
|
||
kubectl delete deployments/kubernetes-bootcamp services/kubernetes-bootcamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl get pods | ||
|
||
kubectl describe pods | ||
|
||
kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=jocatalin/kubernetes-bootcamp:v2 | ||
|
||
kubectl describe services/kubernetes-bootcamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
kubectl describe services/kubernetes-bootcamp | ||
|
||
export NODE_PORT="$(kubectl get services/kubernetes-bootcamp -o go-template='{{(index .spec.ports 0).nodePort}}')" | ||
echo "NODE_PORT=$NODE_PORT" | ||
|
||
curl http://"$(minikube ip):$NODE_PORT" | ||
|
||
kubectl rollout status deployments/kubernetes-bootcamp | ||
|
||
kubectl describe pods |