forked from sdague/kube101-lisa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.sh
86 lines (49 loc) · 1.65 KB
/
commands.sh
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
84
85
86
#!/bin/sh
# Full list of commands from Kube 101 LISA workshop.
#
# In order to ensure there is a complete list of commands that
# everyone has access to even if the screens have passed, this is
# listed below.
#
# The comment before each set of commands matches the slide title they
# were on.
#
# Note: some commands require a specific podname, those are listed as
# $podname in the below script.
# Step 2: Build Image
ibmcloud login --sso
ibmcloud cr namespace-add status_page
ibmcloud cr build --tag \
registry.ng.bluemix.net/status_page/web:1 status_page
# Step 3: Connect to Kube Cluster
ibmcloud ks cluster-config kubelisa
# Step 4: Explore the Cluster
kubectl get all -o wide
# Step 5: Deploy the Application
kubectl apply -f deploy/status-deployment.yaml
kubectl get all -o wide
# Connect to Application
kubectl get nodes -o wide
kubectl get service -l app=status-web -o wide
# What's going on?
kubectl get all -o wide
kubectl describe pod/$podname
# Step 6: Deploy Datastore
kubectl apply -f deploy/redis-deployment.yaml
# Step 8: Pod Lifecycle
kubectl get pods -l app=status-web
kubectl delete pod/$podname
## Upgrade
# Step 1: Make a bad image
ibmcloud cr build --tag registry.ng.bluemix.net/status_page/web:2 status_page
# Step 2: Upgrade image
kubectl apply -f deploy/status-deployment.yaml
kubectl get pods -l app=status-web
# Step 3: Find out what's wrong - logs
kubectl logs $podname
# Fix it, watch the upgrade complete
ibmcloud cr build --tag registry.ng.bluemix.net/status_page/web:3 status_page
kubectl apply -f deploy/status-deployment.yaml
kubectl get pods -l app=status-web
# Interactive debug
kubectl -it exec $podname bash