Skip to main content

Configuring and running your Kubernetes cluster

Setting up a new cluster is a two-step process. First, a configuration file (cluster.yaml) must be created specifying details about the cluster configuration. Second, the cluster.yaml file will be executed to install Kubernetes.

  1. Create the configuration file using ./rke config, and follow the prompts.

    Most values can be set to the default. You will be asked how many servers are being added to the cluster, what their IP/hostnames are, and what “role” each server should be configured as.

    For a standard 3-node cluster it is recommended to answer “y” to the prompts for “Control Plane Host”, “Worker Host”, and “etcd host”. The SSH user should be set to your linux username.

    Set all other prompts to the recommended default value.

    Example values:

    [+] Cluster Level SSH Private Key Path [~/.ssh/id_rsa]: 
    [+] Number of Hosts [1]: 
    --> [+] SSH Address of host (1) [none]: localhost
    [+] SSH Port of host (1) [22]: 
    [+] SSH Private Key Path of host (localhost) [none]: 
    [-] You have entered empty SSH key path, trying fetch from SSH key parameter
    [+] SSH Private Key of host (localhost) [none]: 
    [-] You have entered empty SSH key, defaulting to cluster level SSH key: ~/.ssh/id_rsa
    --> [+] SSH User of host (localhost) [ubuntu]: <your user name>
    --> [+] Is host (localhost) a Control Plane host (y/n)? [y]: y
    --> [+] Is host (localhost) a Worker host (y/n)? [n]: y
    --> [+] Is host (localhost) an etcd host (y/n)? [n]: y
    [+] Override Hostname of host (localhost) [none]: 
    [+] Internal IP of host (localhost) [none]: 
    [+] Docker socket path on host (localhost) [/var/run/docker.sock]: 
    [+] Network Plugin Type (flannel, calico, weave, canal) [canal]: 
    [+] Authentication Strategy [x509]: 
    [+] Authorization Mode (rbac, none) [rbac]: 
    [+] Kubernetes Docker image [rancher/hyperkube:v1.15.5-rancher1]: 
    [+] Cluster domain [cluster.local]: 
    [+] Service Cluster IP Range [10.43.0.0/16]: 
    [+] Enable PodSecurityPolicy [n]: 
    [+] Cluster Network CIDR [10.42.0.0/16]: 
    [+] Cluster DNS Service IP [10.43.0.10]: 
    [+] Add addon manifest URLs or YAML files [no]: 

    You now have a file called cluster.yml.

  2. Install the cluster.

    rke up

    rke connects to each host and installs Kubernetes. At the end of the process, you now have a new file called kube_config_cluster.yml. This file contains your Kubernetes client authentication credentials and kubectl can use it to connect to the cluster.

  3. Rename and move the kube_config_cluster.yml file to ~/.kube/config so that kubectl uses it for all of its commands by default.

    mkdir ~/.kube
    cp kube_config_cluster.yml ~/.kube/config
  4. Verify the setup.

    kubectl get nodes

You are now ready to install DigiCert ONE on your virtual machine.