Last active
June 12, 2021 12:00
-
-
Save claudioacioli/05176c31b7aae0165c176a067aa234d7 to your computer and use it in GitHub Desktop.
Revisions
-
claudioacioli revised this gist
Jun 12, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Download and make it executable: ```bash curl -LO "https://gist.github.com/claudioacioli/05176c31b7aae0165c176a067aa234d7/raw/64e6f283c6a22e1d75b3d5f56c09016f02fbb25e/clearkube" chmod 744 clearkube ``` ### Usage -
claudioacioli revised this gist
Jun 12, 2021 . 1 changed file with 24 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ # clearkube When you are studding k8s and you need to clear your minikube cluster all time. ### Install Download and make it executable: ```bash curl -LO "https://gist.github.com/claudioacioli/05176c31b7aae0165c176a067aa234d7/raw/64e6f283c6a22e1d75b3d5f56c09016f02fbb25e/clearkube" chmod 544 clearkube ``` ### Usage Create a sample deployment and expose it on port 8080: [See more on minikube start](https://minikube.sigs.k8s.io/docs/start/) ```bash kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4 kubectl expose deployment hello-minikube --type=NodePort --port=8080 ``` Then clear it with: ```bash ./clearkube hello-minikube ``` -
claudioacioli created this gist
Jun 12, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #!/bin/sh if [ -n "$1" ] then POD_NAME=$(kubectl get pods -o go-template --template '{{range.items}}{{.metadata.name}}{{"\n"}}{{end}}') fi; [ -n "$1" ] && kubectl delete -n default deployment "$1" [ -n "$POD_NAME" ] && kubectl delete -n default pod "$POD_NAME" [ -n "$1" ] && kubectl delete -n default service "$1" [ -z "$1" ] && printf "\nYou need pass a deployment name like:\n\n \$ clearkube my_deployment_name\n"