Kubernetes Getting Started (GKS)

Today I start giving GKS service a spin

Steps

  1. Install CloudSDK: https://cloud.google.com/sdk/docs/install#linux
  2. Get kubectl installed as part of SDK: gcloud components install kubectl
  3. Make kubectl point to the kubernetes cluster in gcloud bu going to the cluster in the web console and clicking “connect”
  4. 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