Skip to content

Commit fbfaf98

Browse files
committed
readme with commands
1 parent 321b48d commit fbfaf98

File tree

4 files changed

+137
-30
lines changed

4 files changed

+137
-30
lines changed

inventory-app-istio/kustomization.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

inventory-app-istio/prometheus-np-service.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

presentation/README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Presentation Commands
2+
3+
## Architecture
4+
> Describe the architecture of the application. Describe the artifacts you created to build the docker images and to deploy the application to Kubernetes.
5+
6+
* Docker architecture
7+
8+
* Kubernetes architecture
9+
10+
* Application
11+
12+
* Show nginx CORS config
13+
`inventory-api/inventory-api-ingress.yaml`
14+
15+
* TLS
16+
* Show Certificate in Browser
17+
* Show Secret in Kubernetes
18+
`kubectl get secrets`
19+
`kubectl describe secret inventory-app-tls-secret`
20+
21+
## Configuration
22+
> Show how you configured the pre-requisites for the application (Load Balancer, Service Mesh, Storage Class, Registry etc).
23+
24+
* Show microk8s nodes
25+
* `kubectl get nodes`
26+
* `kubectl describe node mtfunke-vu-ubuntu`
27+
(point to IP adress and CPU)
28+
29+
* Show microk8s status
30+
`microk8s status`
31+
(point to plugins like MetalLB and HELM3 and ISTIO)
32+
33+
* Show MetalLB Load Balancer
34+
`kubectl -n metallb-system describe configmap config`
35+
36+
* Show default StorageClass
37+
`kubectl get sc`
38+
39+
* Show registry
40+
`microk8s ctr images ls |grep localhost`
41+
42+
## Deployment HELM
43+
> Show how you build the container images and publish to a registry. Show how you deploy the application. Show how to scale the application horizontally (stateless parts only). Show how to uninstall the application.
44+
45+
* Build and tag Docker container images API
46+
* `docker build -t inventory-api:v10 inventory-app/inventory-api/api-server/`
47+
* `docker tag inventory-api:v10 localhost:32000/inventory-api:v10`
48+
* `docker push localhost:32000/inventory-api:v10`
49+
50+
* Build and tag Docker container images UI
51+
* `docker build -t inventory-ui:v10 inventory-app/inventory-ui/ui-client/`
52+
* `docker tag inventory-ui:v10 localhost:32000/inventory-ui:v10`
53+
* `docker push localhost:32000/inventory-ui:v10`
54+
55+
* Crate namespace
56+
`kubectl create namespace inventory-app-helm`
57+
58+
* Install HELM chart
59+
`helm install inventory-app-helm inventory-app/helm/inventory-app-chart/ -n inventory-app-helm`
60+
61+
* Scale horizontally
62+
`kubectl -n inventory-app-helm scale deployment/inventory-api-deployment --replicas=5`
63+
64+
* Uninstall HELM chart
65+
`helm uninstall inventory-app-helm -n inventory-app-helm`
66+
67+
68+
## Upgrade
69+
> Show how you re-build the application after a source code change. Show how you upgrade the running application in two ways: deployment rollout and canary update.
70+
71+
* Implement API change
72+
* `app.py`
73+
* `..v3 DEMO CHANGE`
74+
75+
* Build Docker Image
76+
* `docker build -t inventory-api:v7 inventory-app/inventory-api/api-server/`
77+
78+
* Tag and push Image for Localhost
79+
* `docker tag inventory-api:v7-helm localhost:32000/inventory-api:v7-helm`
80+
* `docker push localhost:32000/inventory-ui:v7-helm`
81+
82+
* Change HELM chart appVersion
83+
* `helm/inventory-app-chart/charts/inventoryAPI/Chart.yaml`
84+
85+
* Upgrade HELM
86+
* `helm upgrade inventory-app-helm inventory-app/helm/inventory-app-chart/ -n inventory-app-helm`
87+
88+
* Watch rollout
89+
* `kubectl -n inventory-app-helm get pods -w`
90+
91+
* Canary update
92+
* Run two versions in paralell
93+
* apply (manually) deployment for canary update
94+
`kubectl -n inventory-app-helm apply -f inventory-api-canary.yaml`
95+
* Show labels
96+
`kubectl -n inventory-app-helm get pods --show-labels -w`
97+
98+
## GCloud
99+
* See video recording for commands and further explanations.
100+
101+
## Istio
102+
* see `../inventory-app-istio/README.md`
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Source: inventory-app-chart/charts/inventoryAPI/templates/deployment.yaml
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: inventory-api-canary
6+
labels:
7+
app: inventory-app
8+
group: backend
9+
spec:
10+
replicas: 3
11+
selector:
12+
matchLabels:
13+
app: inventory-api
14+
version: v5
15+
template:
16+
metadata:
17+
labels:
18+
app: inventory-api
19+
group: backend
20+
version: v5
21+
spec:
22+
containers:
23+
- name: inventory-api-container
24+
image: "localhost:32000/inventory-api:v5"
25+
ports:
26+
- containerPort: 5000
27+
envFrom:
28+
- configMapRef:
29+
name: postgres-config
30+
env:
31+
- name: POSTGRES_PASSWORD
32+
valueFrom:
33+
secretKeyRef:
34+
name: postgres-secret
35+
key: POSTGRES_PASSWORD

0 commit comments

Comments
 (0)