-
Set zone
gcloud config set compute/zone us-central1-f
-
sample code
gsutil -m cp -r gs://spls/gsp053/orchestrate-with-kubernetes . cd orchestrate-with-kubernetes/kubernetes
-
Create cluster
gcloud container clusters create bootcamp \ --machine-type e2-small \ --num-nodes 3 \ --scopes "https://www.googleapis.com/auth/projecthosting,storage-rw"
-
Learn command
kubectl explain deployment
kubectl explain deployment --recursive
kubectl explain deployment.metadata.name
-
Ubah konfigurasi
nano vi deployments/auth.yaml
-
Create Deployment
kubectl create -f deployments/auth.yaml
-
Verify / View
kubectl get deployments kubectl get replicasets kubectl get pods
-
Buat service
kubectl create -f services/auth.yaml
-
Deploy and expose
kubectl create -f deployments/hello.yaml kubectl create -f services/hello.yaml
-
More
kubectl create secret generic tls-certs --from-file tls/ kubectl create configmap nginx-frontend-conf --from-file=nginx/frontend.conf kubectl create -f deployments/frontend.yaml kubectl create -f services/frontend.yaml
-
Scale
kubectl explain deployment.spec.replicas
kubectl scale deployment hello --replicas=5
kubectl get pods | grep hello- | wc -l
kubectl scale deployment hello --replicas=3
-
Update deployment
kubectl edit deployment hello