Kubernetes 1.3 HA Walkthrough – kubectl

Posted by

Table of Contents

You can find all of the config files on the GitHub page.

Install kubectl

kubectl is the program that we will use to interact with the Kubernetes environment. In my environment I installed it on my Windows 10 desktop running bash for Windows.

curl -O https://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/linux/amd64/kubectl
chmod +x kubectl
sudo mv kubectl /usr/local/bin

Set the active cluster

Note that I’m setting the server to my HAproxy load balancer. This will most likely be different in your environment.

kubectl config set-cluster kubernetes-the-hard-way \
–certificate-authority=/var/lib/kubernetes/ca.pem \
–embed-certs=true \
–server=https://kube-controller13.vmware.local:6443

Set the credentials

kubectl config set-credentials admin –token ‘VMware1!’

Set the default context

kubectl config set-context default-context \
–cluster=kubernetes-the-hard-way \
–user=admin
kubectl config use-context default-context

Get the component status and verify everything is okay

kubectl get componentstatuses

NAME                 STATUS    MESSAGE              ERROR
scheduler            Healthy   ok
controller-manager   Healthy   ok
etcd-1               Healthy   {"health": "true"}
etcd-0               Healthy   {"health": "true"}
etcd-2               Healthy   {"health": "true"}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s