Starting up
- Install Docker in your workstation
- Install Google SDK and config in your workstation
- Install kubernetes components in your workstation
Config GCP and GKE
- create a project
gcloud projects create my-production-env --name="my-production-env"
enable Billing for your project
enable
set this project as default, if you have multi projeccts
gcloud config set project my-production-env
- get and set your default region
gcloud compute regions list
gcloud config set compute/region asia-east1
gcloud compute zones list
gcloud config set compute/zone asia-east1-a
- get and create a Google container cluster (this action will auto create compute, count will be num-nodes * zones)
gcloud container get-server-config
gcloud container clusters create CLUSTERNAME --disk-size=10 --num-nodes=1 \
--machine-type=g1-small --additional-zones=asia-east1-b,asia-east1-c --image-type=cos --async
- Check status of your cluster
kubectl cluster-info
gcloud container clusters list
- Set as default cluster
gcloud config set container/cluster CLUSTERNAME
- Connect to the cluster
gcloud container clusters get-credentials CLUSTERNAME
kubectl proxy
- Then open the Dashboard interface by navigating to the following location in your browser:
http://localhost:8001/ui
- upgrade GKE
gcloud container clusters upgrade CLUSTER_NAME --cluster-version=CLUSTER_VERSION
- get kubernetes namespace
$ kubectl get namespaces
NAME STATUS AGE
default Active 3h
kube-public Active 3h
kube-system Active 3h
- create a kubernetes namespace
kubectl create namespace NAME [--dry-run]