-
Notifications
You must be signed in to change notification settings - Fork 6
k8s deploy/delete scripts #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gustavomassa
wants to merge
9
commits into
kubeshark:master
Choose a base branch
from
gustavomassa:feature/k8s-deploy-script
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a0b5529
Remove deprecated warnings
gustavomassa 28a238b
fix .yaml instead of .yml
gustavomassa 79e3e9a
Rename to be able to get deploy order by number
gustavomassa 99d5c5e
delete script
gustavomassa eac14c3
Renamed ingress-controller, we don't want to deploy it automatically
gustavomassa 53d18bd
Improvements to delete script
gustavomassa e491a21
Deploy script
gustavomassa acd1d8d
echo front-end external ip
gustavomassa a1f3bf3
Merge branch 'master' into feature/k8s-deploy-script
gustavomassa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 characters
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| if [ "$EUID" -eq 0 ] | ||
| then echo "Run without sudo/root" | ||
| exit | ||
| fi | ||
|
|
||
| NC='\033[0m' | ||
| RED='\033[0;31m' | ||
|
|
||
| delete () { | ||
| echo "Deleting sock-shop namespace resources" | ||
| kubectl delete all --all -n sock-shop | ||
| kubectl delete namespace sock-shop || true | ||
|
|
||
| echo "Deleting monitoring namespace resources" | ||
| kubectl delete all --all -n monitoring | ||
| kubectl delete namespace monitoring || true | ||
|
|
||
| echo "Deleting default namespace resources" | ||
| kubectl delete all --all | ||
| } | ||
|
|
||
| # Check kubectl and current cluster context | ||
| echo -e "Delete sock-shop from ${RED}\"$(kubectl config current-context)\"${NC} cluster" | ||
| read -p "Continue (y/n)?" CONT | ||
| if [ "$CONT" = "y" ]; then | ||
| delete | ||
| else | ||
| exit | ||
| fi | ||
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 characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| set -e | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if [ "$EUID" -eq 0 ] | ||||||||||||||||||||||
| then echo "Run without sudo/root" | ||||||||||||||||||||||
| exit | ||||||||||||||||||||||
| fi | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| NC='\033[0m' | ||||||||||||||||||||||
| RED='\033[0;31m' | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| deploy () { | ||||||||||||||||||||||
| echo "Deploying sock-shop namespace" | ||||||||||||||||||||||
| kubectl create -f manifests/sock-shop-ns.yaml | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "Deploying sock-shop core" | ||||||||||||||||||||||
| kubectl apply $(ls manifests/*[[:digit:]]*.yaml | awk ' { print " -f " $1 } ') | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "Deploying sock-shop-mizu extras" | ||||||||||||||||||||||
| kubectl apply $(ls manifests/extras/*[[:digit:]]*.yaml | awk ' { print " -f " $1 } ') | ||||||||||||||||||||||
|
Comment on lines
+14
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "Deploying monitoring namespace" | ||||||||||||||||||||||
| kubectl create -f manifests-monitoring/00-monitoring-ns.yaml | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "Deploying Prometheus" | ||||||||||||||||||||||
| kubectl apply $(ls manifests-monitoring/*-prometheus-*.yaml | awk ' { print " -f " $1 } ') | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "Deploying Grafana" | ||||||||||||||||||||||
| kubectl apply $(ls manifests-monitoring/*-grafana-*.yaml | awk ' { print " -f " $1 }' | grep -v grafana-import) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # wait for Grafana to be ready | ||||||||||||||||||||||
| while [[ $(kubectl get pods -l app=grafana -l component=core -n monitoring -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for grafana core pod" && sleep 2; done | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "Importing Grafana Dashboards" | ||||||||||||||||||||||
| kubectl apply -f manifests-monitoring/23-grafana-import-dash-batch.yaml | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # TODO: Forward Grafana and Prometheus ports | ||||||||||||||||||||||
| # Grafana: 3000:$NODE_IN_CLUSTER:31300 | ||||||||||||||||||||||
| # Prometheus: 9090:$NODE_IN_CLUSTER:31090 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo -e "sock-shop is running, you can access through front-end service: ${RED}\"$(kubectl get svc -l name=front-end -n sock-shop | awk ' { print $4 } ')\"${NC}" | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Check kubectl and current cluster context | ||||||||||||||||||||||
| echo -e "Deploy sock-shop to ${RED}\"$(kubectl config current-context)\"${NC} cluster" | ||||||||||||||||||||||
| read -p "Continue (y/n)?" CONT | ||||||||||||||||||||||
| if [ "$CONT" = "y" ]; then | ||||||||||||||||||||||
| deploy | ||||||||||||||||||||||
| else | ||||||||||||||||||||||
| exit | ||||||||||||||||||||||
| fi | ||||||||||||||||||||||
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,4 +37,4 @@ spec: | |
| configMap: | ||
| name: alertmanager | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,4 +42,4 @@ spec: | |
| configMap: | ||
| name: prometheus-alertrules | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,4 +48,4 @@ spec: | |
| emptyDir: | ||
| medium: Memory | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
File renamed without changes.
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,4 +39,4 @@ spec: | |
| emptyDir: | ||
| medium: Memory | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,4 +28,4 @@ spec: | |
| - name: mysql | ||
| containerPort: 3306 | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,4 +48,4 @@ spec: | |
| emptyDir: | ||
| medium: Memory | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,4 +39,4 @@ spec: | |
| emptyDir: | ||
| medium: Memory | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,4 +32,4 @@ spec: | |
| ports: | ||
| - containerPort: 80 | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,4 +42,4 @@ spec: | |
| - containerPort: 9090 | ||
| name: exporter | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,4 +34,4 @@ spec: | |
| - SETUID | ||
| readOnlyRootFilesystem: true | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,4 +50,4 @@ spec: | |
| emptyDir: | ||
| medium: Memory | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,4 +40,4 @@ spec: | |
| emptyDir: | ||
| medium: Memory | ||
| nodeSelector: | ||
| beta.kubernetes.io/os: linux | ||
| kubernetes.io/os: linux | ||
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
File renamed without changes.
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the
|| truedo?If the delete operation fail, why would we want to suppress the error?