Running Kubernetes on Google Cloud Service

Following example will use pharmer to create a Kubernetes cluster with 1 worker nodes and 3 master nodes (i,e, 4 nodes in your cluster) on Google Cloud Service.

Before you start

As a prerequisite, you need to have pharmer installed. To install pharmer use the setup guide

Pharmer storage

To store your cluster and credential resource, you can configure pharmer to use local file system or postgres database. In this document we will use local file system (vfs) as a storage provider. To know more click here

Credential importing

Follow this guide for creating credential here

Cluster provisioning

There are two steps to create a Kubernetes cluster using pharmer. In first step pharmer create basic configuration file with user choice. Then in second step pharmer applies those information to create cluster on specific provider.

Here, we discuss how to use pharmer to create a Kubernetes cluster on gce

Cluster Creating

We want to create a cluster with following information:

  • Provider: gce
  • Cluster name: gce
  • Location: us-central1-f
  • Number of master nodes: 3
  • Number of worker nodes: 1
  • Worker Node sku: n1-standard-2 (cpu: 2, memory: 7.5 Gb)
  • Kubernetes version: v1.13.5
  • Credential name: gce

For location code and sku details click hrere

Available options in pharmer to create a cluster are:

 $ pharmer create cluster -h
 Create a Kubernetes cluster for a given cloud provider

Usage:
  pharmer create cluster [flags]

Aliases:
  cluster, clusters, Cluster

Examples:
pharmer create cluster demo-cluster

Flags:
      --credential-uid string       Use preconfigured cloud credential uid
  -h, --help                        help for cluster
      --kubernetes-version string   Kubernetes version
      --masters int                 Number of masters (default 1)
      --namespace string            Namespace (default "default")
      --network-provider string     Name of CNI plugin. Available options: calico, flannel, kubenet, weavenet (default "calico")
      --nodes stringToInt           Node set configuration (default [])
  -o, --owner string                Current user id (default "tahsin")
      --provider string             Provider name
      --zone string                 Cloud provider zone name

Global Flags:
      --alsologtostderr                  log to standard error as well as files
      --analytics                        Send analytical events to Google Guard (default true)
      --config-file string               Path to Pharmer config file
      --env string                       Environment used to enable debugging (default "prod")
      --kubeconfig string                Paths to a kubeconfig. Only required if out-of-cluster.
      --log_backtrace_at traceLocation   when logging hits line file:N, emit a stack trace (default :0)
      --log_dir string                   If non-empty, write log files in this directory
      --logtostderr                      log to standard error instead of files (default true)
      --master string                    The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.
      --stderrthreshold severity         logs at or above this threshold go to stderr
  -v, --v Level                          log level for V logs
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging

So, we need to run following command to create cluster with our information.

$ pharmer create cluster gce-1 \
    --masters 3 \
    --provider gce \
    --zone us-central1-f \
    --nodes n1-standard-2=1 \
    --credential-uid gce \
    --kubernetes-version v1.13.5

To know about pod networks supports in pharmer click here

The directory structure of the storage provider will be look like:

$ ~/.pharmer/store.d/$USER/clusters/
/home/<user>/.pharmer/store.d/<user>/clusters/
├── g1
│   ├── machine
│   │   ├── g1-master-0.json
│   │   ├── g1-master-1.json
│   │   └── g1-master-2.json
│   ├── machineset
│   │   └── n1-standard-2-pool.json
│   ├── pki
│   │   ├── ca.crt
│   │   ├── ca.key
│   │   ├── etcd
│   │   │   ├── ca.crt
│   │   │   └── ca.key
│   │   ├── front-proxy-ca.crt
│   │   ├── front-proxy-ca.key
│   │   ├── sa.crt
│   │   └── sa.key
│   └── ssh
│       ├── id_g1-sshkey
│       └── id_g1-sshkey.pub
└── g1.json

6 directories, 15 files

Here,

  • machine: conntains information about the master machines to be deployed
  • machineset: contains information about the machinesets to be deployed
  • pki: contains the cluster certificate information containing ca, front-proxy-ca, etcd/ca and service account keys sa
  • ssh: has the ssh credentials on cluster’s nodes. With this key you can ssh into any node on a cluster
  • g1.json: contains the cluster resource information

You can view your cluster configuration file by following command.

$ pharmer get cluster g1 -o yaml
kind: Cluster
apiVersion: cluster.pharmer.io/v1beta1
metadata:
  name: g1
  uid: dc86e18d-7853-11e9-8b47-e0d55ee85d14
  generation: 1558063718895666700
  creationTimestamp: '2019-05-17T03:28:38Z'
spec:
  clusterApi:
    kind: Cluster
    apiVersion: cluster.k8s.io/v1alpha1
    metadata:
      name: g1
      namespace: default
      creationTimestamp:
    spec:
      clusterNetwork:
        services:
          cidrBlocks:
          - 10.96.0.0/12
        pods:
          cidrBlocks:
          - 192.168.0.0/16
        serviceDomain: cluster.local
      providerSpec:
        value:
          kind: GCEMachineProviderSpec
          apiVersion: gceproviderconfig/v1alpha1
          metadata:
            creationTimestamp:
          roles:
          - Master
          zone: us-central1-f
          machineType: ''
          os: ubuntu-1604-xenial-v20170721
          disks:
          - initializeParams:
              diskSizeGb: 30
              diskType: pd-standard
    status: {}
  config:
    masterCount: 3
    cloud:
      cloudProvider: gce
      region: us-central1
      zone: us-central1-f
      instanceImage: ubuntu-1604-xenial-v20170721
      os: ubuntu-1604-lts
      instanceImageProject: ubuntu-os-cloud
      networkProvider: calico
      ccmCredentialName: gce
      sshKeyName: g1-sshkey
      gce:
        NetworkName: default
        NodeTags:
        - g1-node
    kubernetesVersion: v1.13.5
    caCertName: ca
    frontProxyCACertName: front-proxy-ca
    credentialName: gce
    apiServerExtraArgs:
      cloud-config: "/etc/kubernetes/ccm/cloud-config"
      cloud-provider: gce
      kubelet-preferred-address-types: ExternalDNS,ExternalIP,Hostname,InternalDNS,InternalIP
    controllerManagerExtraArgs:
      cloud-config: "/etc/kubernetes/ccm/cloud-config"
      cloud-provider: gce
status:
  phase: Pending
  cloud:
    loadBalancer:
      dns: ''
      ip: ''
      port: 0

You can modify this configuration by:

$ pharmer edit cluster g1

Applying

If everything looks ok, we can now apply the resources. This actually creates resources on gce. Up to now we’ve only been working locally.

To apply run:

$ pharmer apply g1

Now, pharmer will apply that configuration, this create a Kubernetes cluster. After completing task the configuration file of the cluster will be look like

$ pharmer get cluster g1 -o yaml
kind: Cluster
apiVersion: cluster.pharmer.io/v1beta1
metadata:
  name: g1
  uid: dc86e18d-7853-11e9-8b47-e0d55ee85d14
  generation: 1558063718895666700
  creationTimestamp: '2019-05-17T03:28:38Z'
spec:
  clusterApi:
    kind: Cluster
    apiVersion: cluster.k8s.io/v1alpha1
    metadata:
      name: g1
      namespace: default
      creationTimestamp:
      annotations:
        gce.clusterapi.k8s.io/firewallg1-allow-api-public: 'true'
        gce.clusterapi.k8s.io/firewallg1-allow-cluster-internal: 'true'
    spec:
      clusterNetwork:
        services:
          cidrBlocks:
          - 10.96.0.0/12
        pods:
          cidrBlocks:
          - 192.168.0.0/16
        serviceDomain: cluster.local
      providerSpec:
        value:
          kind: GCEMachineProviderSpec
          apiVersion: gceproviderconfig/v1alpha1
          metadata:
            creationTimestamp:
          project: ackube
          caKeyPair:
            cert: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN1RENDQWFDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFOTVFzd0NRWURWUVFERXdKallUQWUKRncweE9UQTFNVGN3TXpJNE16bGFGdzB5T1RBMU1UUXdNekk0TXpsYU1BMHhDekFKQmdOVkJBTVRBbU5oTUlJQgpJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBdVZ2RE1SRjNRdlY4UDhyQzAxRkFNT095CkQxZnpiUWVGRWpSaUUzVytoeVdEUzRMK2xGVkNxOXVJcEhRRnozOUdvMmdCTzk0L3FaSkM0ZkMyWFY5UGRZckgKSFY3MDlnUFNrNmZTSjh0Zk54bFBISHRmbDFTNTcyZk51anF3ank4NXpsTXhUeXFpUWtTZFhReTkrclBZdmZWVApkVDNvY293YjJnNHVzN3dMaEt3bkt5c2l0V0dvUlFZRkJ3SC95SlZPUnhEdG5BZnZLVEIxcnpPdktrWUJTSjA1CitZK0R1OEdqWjFJa053VTJwWjE4aGw0eVNya0Q4VmpnYktmYUtkdy9UZno4QzBJbEZnY2U0SUhRcWVtcW02UmwKTytMRHdHK3JQeHBIQUFLRVk0aHlBOGhaV3l0QVpyZHFHY1lRT0RxUW9hZDJYQlFGSkJSN1pDQm1XZEFjc1FJRApBUUFCb3lNd0lUQU9CZ05WSFE4QkFmOEVCQU1DQXFRd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBTkJna3Foa2lHCjl3MEJBUXNGQUFPQ0FRRUFhU1ZZQ0RlWHgvSGJGWWtWaldhYzYvNmZ5cGVnWmYvOGx5b1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RTCt3REJ3dmVlVEFPS1ovTkFMTkRvQXczOVREVlhnRG5RZDVmZUxyam84MS9vOE9lSVJxClh0YTJ1K2xsUVlROG9EUzlwYllDYmprMllSZGdxN0lNK1pqcm9ic0NnWUJjM1R0M1JTWEJwMWtQRkwzWm9FREwKSUpzekpmbnM4TmpJQUxka3VBVitWZGh6WlNCTld6UmVqbEV0RXdSUHd1bmUzZ3NvaEFTZWJ1UlcvVExwTzFuawpDTXVsRFpWZkZGQWtPTmtHSDllUlNVUVN5V3d0ZGtONlNKSEpBNUNSMzhNTndneUI0TXpaNjlGZjZ3OFhRanMvCkdMNmM3c1NNZFJybDBGdWE5S2Z4QVFLQmdCTE1SZmhaK2ZURCtMdEUvTllSZmFhL216eVhXcXFhbkQ2VU1tVmEKRGlKa3pOZHhFSG16VkNNUGxiY1lQUXVycGw5ZmxIck93U2kzZGdZSDJETVhMNmhwaGdUUU1uN3cydWlrdUdSdwpTLzZCRlpaUzVFRUJ4SXNlWWE3MFhqbFFVRWV0K3RmUE1aT3BmMzJKdU5YdThxUnM5WnQ1cE96NWFkTW91dlNJClloYXhBb0dCQUtRT1BtMW1RL0tZdHBCWjE2djdKak5ieW5iNmNETjFHZ1VOYVZ3bjdDbTZTbVRVYXMxbitoMC8KdElMYlpmUWdxSHN1LzFaQk0vY2xNZU9NVGV6N2J3TmJhY01HTVphU2JTQkJsay9CRmRuV3NOSndydy9UOHFObAphbW9UaitVam1GSTEzS1BCWjY3aHVkb01ieWdHNGkvSTIyc2J2NFlsSlpKdGp4U1JucXQwCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
          clusterConfiguration:
            etcd: {}
            networking:
              serviceSubnet: ''
              podSubnet: ''
              dnsDomain: ''
            kubernetesVersion: ''
            controlPlaneEndpoint: ''
            apiServer: {}
            controllerManager: {}
            scheduler: {}
            dns:
              type: ''
            certificatesDir: ''
            imageRepository: ''
    status:
      apiEndpoints:
      - host: 35.222.174.181
        port: 6443
      providerStatus:
        apiVersion: gceproviderconfig/v1alpha1
        kind: GCEClusterProviderStatus
        metadata:
          creationTimestamp:
  config:
    masterCount: 3
    cloud:
      cloudProvider: gce
      project: ackube
      region: us-central1
      zone: us-central1-f
      instanceImage: ubuntu-1604-xenial-v20170721
      os: ubuntu-1604-lts
      instanceImageProject: ubuntu-os-cloud
      networkProvider: calico
      ccmCredentialName: gce
      sshKeyName: g1-sshkey
      gce:
        NetworkName: default
        NodeTags:
        - g1-node
    kubernetesVersion: v1.13.5
    caCertName: ca
    frontProxyCACertName: front-proxy-ca
    credentialName: gce
    apiServerExtraArgs:
      cloud-config: "/etc/kubernetes/ccm/cloud-config"
      cloud-provider: gce
      kubelet-preferred-address-types: ExternalDNS,ExternalIP,Hostname,InternalDNS,InternalIP
    controllerManagerExtraArgs:
      cloud-config: "/etc/kubernetes/ccm/cloud-config"
      cloud-provider: gce
status:
  phase: Ready
  cloud:
    loadBalancer:
      dns: ''
      ip: 35.222.174.181
      port: 6443

Here,

  • status.phase: is ready. So, you can use your cluster from local machine.
  • status.clusterApi.status.apiEndpoints is the cluster’s apiserver address

To get the kubectl configuration file(kubeconfig) on your local filesystem run the following command.

$ pharmer use cluster g1

If you don’t have kubectl installed click here

Now you can run kubectl get nodes and verify that your kubernetes v1.13.5 is running.

Now you can run kubectl get nodes and verify that your kubernetes 1.13.5 is running.

$ kubectl get nodes
NAME                       STATUS   ROLES    AGE     VERSION
g1-master-0                Ready    master   6m21s   v1.13.5
g1-master-1                Ready    master   3m10s   v1.13.5
g1-master-2                Ready    master   2m7s    v1.13.5
n1-standard-2-pool-5pft6   Ready    node     56s     v1.13.5

Cluster Scaling

Scaling a cluster refers following meanings

  • Add new master and worker machines
  • Increment the number of nodes of a certain machine-set and machine-deployment
  • Decrement the number of nodes of a certain machine-set and machine-deployment
  • Introduce a new machine-set and machine-deployment with a number of nodes
  • Delete existing machine, machine-set and machine-deployments

You can see the machine and machine-sets deployed in the cluster

$ kubectl get machines
NAME                       AGE
g1-master-0                3m
g1-master-1                3m
g1-master-2                3m
n1-standard-2-pool-5pft6   3m


$ kubectl get machinesets
NAME                 AGE
n1-standard-2-pool   3m

Deploy new master machines

You can create new master machine by the deploying the following yaml

kind: Machine
apiVersion: cluster.k8s.io/v1alpha1
metadata:
  name: g1-master-3
  creationTimestamp: '2019-05-17T03:28:40Z'
  labels:
    cluster.k8s.io/cluster-name: g1
    node-role.kubernetes.io/master: ''
    set: controlplane
spec:
  metadata:
    creationTimestamp:
  providerSpec:
    value:
      kind: GCEMachineProviderSpec
      apiVersion: gceproviderconfig/v1alpha1
      metadata:
        creationTimestamp:
      roles:
      - Master
      zone: us-central1-f
      machineType: n1-standard-2
      os: ubuntu-1604-xenial-v20170721
      disks:
      - initializeParams:
          diskSizeGb: 30
          diskType: pd-standard
  versions:
    kubelet: v1.13.5
    controlPlane: v1.13.5

Create new worker machines

You can create new worker machines by deploying the following yaml

kind: Machine
apiVersion: cluster.k8s.io/v1alpha1
metadata:
  name: worker-1
  creationTimestamp: '2019-05-17T03:28:40Z'
  labels:
    cluster.k8s.io/cluster-name: g1
    node-role.kubernetes.io/master: ''
    set: node
spec:
  providerSpec:
    value:
      kind: GCEMachineProviderSpec
      apiVersion: gceproviderconfig/v1alpha1
      roles:
      - Master
      zone: us-central1-f
      machineType: n1-standard-2
      os: ubuntu-1604-xenial-v20170721
      disks:
      - initializeParams:
          diskSizeGb: 30
          diskType: pd-standard
  versions:
    kubelet: v1.13.5

Create new machinesets

You can create new machinesets by deploying the following yaml

kind: MachineSet
apiVersion: cluster.k8s.io/v1alpha1
metadata:
  name: n1-standard-2-pool
spec:
  replicas: 1
  selector:
    matchLabels:
      cluster.k8s.io/cluster-name: g1
      cluster.pharmer.io/mg: n1-standard-2
  template:
    metadata:
      labels:
        cluster.k8s.io/cluster-name: g1
        cluster.pharmer.io/cluster: g1
        cluster.pharmer.io/mg: n1-standard-2
        node-role.kubernetes.io/node: ''
        set: node
    spec:
      providerSpec:
        value:
          kind: GCEMachineProviderSpec
          apiVersion: gceproviderconfig/v1alpha1
          metadata:
            creationTimestamp:
          roles:
          - Node
          zone: us-central1-f
          machineType: n1-standard-2
          os: ubuntu-1604-xenial-v20170721
          disks:
          - initializeParams:
              diskSizeGb: 30
              diskType: pd-standard
      versions:
        kubelet: v1.13.5

Create new machine-deployments

You can create new machine-deployments by deploying the following yaml

kind: MachineDeployment
apiVersion: cluster.k8s.io/v1alpha1
metadata:
  name: n1-standard-2-pool
spec:
  replicas: 1
  selector:
    matchLabels:
      cluster.k8s.io/cluster-name: g1
      cluster.pharmer.io/mg: n1-standard-2
  template:
    metadata:
      labels:
        cluster.k8s.io/cluster-name: g1
        cluster.pharmer.io/cluster: g1
        cluster.pharmer.io/mg: n1-standard-2
        node-role.kubernetes.io/node: ''
        set: node
    spec:
      providerSpec:
        value:
          kind: GCEMachineProviderSpec
          apiVersion: gceproviderconfig/v1alpha1
          metadata:
            creationTimestamp:
          roles:
          - Node
          zone: us-central1-f
          machineType: n1-standard-2
          os: ubuntu-1604-xenial-v20170721
          disks:
          - initializeParams:
              diskSizeGb: 30
              diskType: pd-standard
      versions:
        kubelet: v1.13.5

Scale Cluster

You can also update number of nodes of an existing machine-set and machine-deployment using

$ kubectl edit <machineset-name>
$ kubectl edit <machinedeployment-name>

and update the spec.replicas field

Delete nodes

You can delete machines using

$ kubectl delete machine <machine-name>

Warning: if the machine is controlled by a machineset, a new machine will be created. You should update/delete machineset in that case

You can delete machine-set and machine-deployments using

$ kubectl delete machineset <machineset-name>
$ kubectl delete machinedeployment <machinedeployment-name>

Cluster Upgrading

Upgrade master machines

You can deploy new master machines with specifying new version in spec.version.controlPlane and spec.version.kubelet. After new master machines are ready, you can safely delete old ones

Upgrade worker machines

You can upgrade worker machines by editing machine-deployment

$ kubectl edit machinedeployments <machinedeployment-name>

and updating the spec.version.kubelet

To upgrade machinesets, you have to deploy new machinesets with specifying new version in spec.template.spec.version.kubelet After new machines are ready, you can safely delete old machine-sets

Cluster Deleting

To delete your cluster run

$ pharmer delete cluster g1

Then, the yaml file looks like

$ pharmer get cluster g1 -o yaml
kind: Cluster
apiVersion: cluster.pharmer.io/v1beta1
metadata:
  name: g1
  uid: 379d4d7f-77c1-11e9-b997-e0d55ee85d14
  generation: 1558000735696016100
  creationTimestamp: '2019-05-16T09:58:55Z'
  deletionTimestamp: '2019-05-16T10:38:54Z'
...
...
status:
  phase: Deleting
...
...

Here,

  • metadata.deletionTimestamp: is set when cluster deletion command was applied.

Now, to apply delete operation of the cluster, run

$ pharmer apply g1

Congratulations !!! , you’re an official pharmer user now.