Kubernetes Getting Started (GKS)
Today I start giving GKS service a spin
Steps
- Install CloudSDK: https://cloud.google.com/sdk/docs/install#linux
- Get kubectl installed as part of SDK:
gcloud components install kubectl
- Make kubectl point to the kubernetes cluster in gcloud bu going to the cluster in the web console and clicking “connect”
- run kubectl commands
Eg.
# show namespaces
$ kubectl get namespaces --show-labels
# create a new namespace ref: https://kubernetes.io/docs/tasks/administer-cluster/namespaces-walkthrough/
$ cat test.json
{
"apiVersion": "v1",
"kind": "Namespace",
"metadata": {
"name": "hbtest",
"labels": {
"name": "production"
}
}
}
$ kubectl create -f ./test.json