-
Notifications
You must be signed in to change notification settings - Fork 0
/
HowtoUse.txt
23 lines (23 loc) · 1.23 KB
/
HowtoUse.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Tutorial: https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app
Build/push container to Container registry:
docker build -t gcr.io/${PROJECT_ID}/protect-your-photo-from-recognition:v1 .
docker push gcr.io/${PROJECT_ID}/protect-your-photo-from-recognition:v1
Deploy container to Kubernetes:
kubectl create deployment hello-web --image=gcr.io/${PROJECT_ID}/protect-your-photo-from-recognition:v1
make app accessible from Internet:
kubectl expose deployment hello-web --type=LoadBalancer --port 80 --target-port 8050
Perform a rolling update:
docker build -t gcr.io/${PROJECT_ID}/protect-your-photo-from-recognition:v2 .
docker push gcr.io/${PROJECT_ID}/protect-your-photo-from-recognition:v2
kubectl set image deployment/hello-web protect-your-photo-from-recognition=gcr.io/${PROJECT_ID}/protect-your-photo-from-recognition:v2
Check containers:
kubectl get pods
kubectl get service
If you remove cluster and want to use kubectl:
gcloud container clusters get-credentials cluster-1 --zone us-central1-c --project ${PROJECT_ID}
where cluster-1 name of a new cluster, his zone and project id
Stop & remove containers:
docker container stop $(docker container ls -aq)
docker container rm $(docker container ls -aq)
Remove images:
docker image prune -a