-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSOLUTION.txt
More file actions
83 lines (51 loc) · 2.13 KB
/
SOLUTION.txt
File metadata and controls
83 lines (51 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Task 1 : Create Production Environment
SSH to kraken-jumphost and run :
cd /work/dm
sed -i s/SET_REGION/us-east1/g prod-network.yaml
gcloud deployment-manager deployments create prod-network --config=prod-network.yaml
gcloud config set compute/zone us-east1-b
gcloud container clusters create kraken-prod \
--num-nodes 2 \
--network kraken-prod-vpc \
--subnetwork kraken-prod-subnet\
--zone us-east1-b
gcloud container clusters get-credentials kraken-prod
cd /work/k8s
for F in $(ls *.yaml); do kubectl create -f $F; done
Task 2 : Setup the Admin instance
Still in kraken-jumphost's SSH, run
gcloud config set compute/zone us-east1-b
gcloud compute instances create kraken-admin --network-interface="subnet=kraken-mgmt-subnet" --network-interface="subnet=kraken-prod-subnet"
Create alert
Open monitoring
Create an alert
Configure the policy to email your email and set
Resource Type : VM Instance
Metric : CPU utilization
Filter : instance_name
Value : kraken-admin
Condition : is above
Threshold : 50%
For : 1 minute
Task 3 : Verify the Spinnaker deployment
Switch to cloudshell, run
gcloud config set compute/zone us-east1-b
gcloud container clusters get-credentials spinnaker-tutorial
DECK_POD=$(kubectl get pods --namespace default -l "cluster=spin-deck" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward --namespace default $DECK_POD 8080:9000 >> /dev/null &
Go to cloudshell webpreview
Go to applications -> sample
Open pipelines and manually run the pipeline if it has not already running.
Approve the deployment to production.
Check the production frontend endpoint (use http, not the default https)
Back to cloudshell, run to push a change
gcloud config set compute/zone us-east1-b
gcloud source repos clone sample-app
cd sample-app
touch a
git config --global user.email "$(gcloud config get-value account)"
git config --global user.name "Student"
git commit -a -m "change"
git tag v1.0.1
git push --tags
Congratulations, you're all done with the lab