Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: 1.8.4 until I triage issues with 1.8.6 in SDNC

...

#PurposeCommand and Example
1

Download kubectl on the server

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.64/bin/linux/amd64/kubectl
Expand
titleExample of download kubectl process

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 49.8M  100 49.8M    0     0  15.3M      0  0:00:03  0:00:03 --:--:-- 15.3M

2

Enable the kubectl command

chmod +x kubectl

sudo mv kubectl /usr/local/bin/kubectl

vi ~/.bashrc

  • append the following to enable kubectl command auto-completion
    • source <(kubectl completion bash)

source ~/.bashrc

3

Generate config from the Rancher UI

  • From the Rancher UI, go to a Kubernetes CLI page through KUBERNETES -> CLI
  • Click on the Generate Config button to generate the config

  • The following content will be brought up; click on the Copy to Clipboard button to copy the generated config and use it in next step:


4

Create the kube config on the server

mkdir ~/.kube

vi ~/.kube/config

Paste the generated config from rancher UI (from last step) to this file, then save the file.

5

Validate the kube config

6

Validate the nodes added

kubectl get nodes

Expand
titleAn example

$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
sdnc-k8s Ready <none> 15m v1.7.7-rancher1
sdnc-k8s-2 Ready <none> 1m v1.7.7-rancher1
$

...