- INFO: Running Agent Registration Process, CATTLE_URL=http://10.12.6.16:8080/v1
- INFO: Attempting to connect to: http://10.12.6.16:8080/v1
- INFO: http://10.12.6.16:8080/v1 is accessible
- INFO: Inspecting host capabilities
- INFO: Boot2Docker: false
- INFO: Host writable: true
- INFO: Token: xxxxxxxx
- INFO: Running registration
- INFO: Printing Environment
- INFO: ENV: CATTLE_ACCESS_KEY=98B35AC484FBF820E0AD
- INFO: ENV: CATTLE_AGENT_IP=10.0.9.4
- INFO: ENV: CATTLE_HOME=/var/lib/cattle
- INFO: ENV: CATTLE_REGISTRATION_ACCESS_KEY=registrationToken
- INFO: ENV: CATTLE_REGISTRATION_SECRET_KEY=xxxxxxx
- INFO: ENV: CATTLE_SECRET_KEY=xxxxxxx
- INFO: ENV: CATTLE_URL=http://10.12.6.16:8080/v1
- INFO: ENV: DETECTED_CATTLE_AGENT_IP=10.12.5.172
- INFO: ENV: RANCHER_AGENT_IMAGE=rancher/agent:v1.2.9
- INFO: Launched Rancher Agent: c27ee0f3dc4c783b0db647ea1f73c35b3843a4b8d60b96375b1a05aa77d83136
- ubuntu@sb4-k8s-1:~$
-
-3. Return to Rancher environment (e.g. SB4) and wait for services to complete
- (~ 10-15 mins)
-
-.. image:: Return_to_Rancher_environment_eg_SB4_and_wait_for_services_to_complete_10-15_mins.jpeg
-
-Configure kubectl and helm
-==========================
-In this example we are configuring kubectl and helm that have been installed
-(as a convenience) onto the rancher and kubernetes hosts. Typically you would
-install them both on your PC and remotely connect to the cluster. The following
-procedure would remain the same.
-
-1. Click on CLI and then click on “Generate Config”
-
-.. image:: Click_on_CLI_and_then_click_on_Generate_Config.jpeg
-
-2. Click on “Copy to Clipboard” - wait until you see a "token" - do not copy
- user+password - the server is not ready at that point
-
-.. image:: Click_on_Copy_to_Clipboard-wait_until_you_see_a_token-do_not_copy_user+password-the_server_is_not_ready_at_that_point.jpeg
-
-3. Create a .kube directory in user directory (if one does not exist)::
-
- ubuntu@sb4-kSs-1:~$ mkdir .kube
- ubuntu@sb4-kSs-1:~$ vi .kube/config
-
-4. Paste contents of Clipboard into a file called “config” and save the file::
-
- apiVersion: v1
- kind : Config
- clusters:
- - cluster:
- api-version: v1
- insecure-skip-tls-verify: true
- server: "https://10.12.6.16:8080/r/projects/1a7/kubernetes:6443"
- name: "SB4"
- contexts:
- - context:
- cluster: "SB4"
- user: "SB4"
- name: "SB4"
- current-context: "SB4"
- users:
- - name: "SB4"
- user:
- token: "QmFzaWMgTlRBd01qZzBOemc)TkRrMk1UWkNOMFpDTlVFNlExcHdSa1JhVZreE5XSm1TRGhWU2t0Vk1sQjVhalZaY0dWaFVtZGFVMHQzWW1WWVJtVmpSQT09"
-
-5. Validate that kubectl is able to connect to the kubernetes cluster::
-
- ubuntu@sb4-k8s-1:~$ kubectl config get-contexts
- CURRENT NAME CLUSTER AUTHINFO NAMESPACE
- * SB4 SB4 SB4
- ubuntu@sb4-kSs-1:~$
-
-and show running pods::
-
- ubuntu@sb4-k8s-1:~$ kubectl get pods --all-namespaces -o=wide
- NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE
- kube-system heapster—7Gb8cd7b5 -q7p42 1/1 Running 0 13m 10.42.213.49 sb4-k8s-1
- kube-system kube-dns-5d7bM87c9-c6f67 3/3 Running 0 13m 10.42.181.110 sb4-k8s-1
- kube-system kubernetes-dashboard-f9577fffd-kswjg 1/1 Running 0 13m 10.42.105.113 sb4-k8s-1
- kube-system monitoring-grafana-997796fcf-vg9h9 1/1 Running 0 13m 10.42,141.58 sb4-k8s-1
- kube-system monitoring-influxdb-56chd96b-hk66b 1/1 Running 0 13m 10.4Z.246.90 sb4-k8s-1
- kube-system tiller-deploy-cc96d4f6b-v29k9 1/1 Running 0 13m 10.42.147.248 sb4-k8s-1
- ubuntu@sb4-k8s-1:~$
-
-6. Validate helm is running at the right version. If not, an error like this
- will be displayed::
-
- ubuntu@sb4-k8s-1:~$ helm list
- Error: incompatible versions c1ient[v2.9.1] server[v2.6.1]
- ubuntu@sb4-k8s-1:~$
-
-7. Upgrade the server-side component of helm (tiller) via `helm init --upgrade`::
-
- ubuntu@sb4-k8s-1:~$ helm init --upgrade
- Creating /home/ubuntu/.helm
- Creating /home/ubuntu/.helm/repository
- Creating /home/ubuntu/.helm/repository/cache
- Creating /home/ubuntu/.helm/repository/local
- Creating /home/ubuntu/.helm/plugins
- Creating /home/ubuntu/.helm/starters
- Creating /home/ubuntu/.helm/cache/archive
- Creating /home/ubuntu/.helm/repository/repositories.yaml
- Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
- Adding local repo with URL: http://127.0.0.1:8879/charts
- $HELM_HOME has been configured at /home/ubuntu/.helm.
-
- Tiller (the Helm server-side component) has been upgraded to the current version.
- Happy Helming!
- ubuntu@sb4-k8s-1:~$