Kubernetes Kubeadm with Flannel Networking up & running

Okay, so I am going to try and make this brief  for you to get going. You need a Kubernetes cluster working with Kubeadm? good you are in the right place.

First, lets get over the problems. What you need to see at the end is the following:

kube-system dummy-2088944543-1x359 1/1 Running 1 1d
kube-system etcd-master 1/1 Running 1 1d
kube-system kube-apiserver-master 1/1 Running 0 1d
kube-system kube-controller-manager-master 1/1 Running 1 1d
kube-system kube-discovery-1769846148-1khb9 1/1 Running 1 1d
kube-system kube-dns-2924299975-pg660 4/4 Running 4 1d
kube-system kube-flannel-ds-25l4t 2/2 Running 2 1d
kube-system kube-flannel-ds-9jtd5 2/2 Running 2 1d
kube-system kube-flannel-ds-lvskl 2/2 Running 8 1d
kube-system kube-proxy-l1hn5 1/1 Running 1 1d
kube-system kube-proxy-p1kbt 1/1 Running 1 1d
kube-system kube-proxy-x2b1m 1/1 Running 1 1d
kube-system kube-scheduler-master 1/1 Running 1 1d

Not this …

kube-system dummy-2088944543-1x359 1/1 Running 1 1d
kube-system etcd-master 1/1 Running 1 1d
kube-system kube-apiserver-master 1/1 Running 0 1d
kube-system kube-controller-manager-master 1/1 Running 1 1d
kube-system kube-discovery-1769846148-1khb9 1/1 Running 1 1d
kube-system kube-dns-2924299975-pg660 4/4 CrashLoopBackOff 4 1d
kube-system kube-flannel-ds-25l4t 2/2 Running 2 1d
kube-system kube-flannel-ds-9jtd5 2/2 Running 2 1d
kube-system kube-flannel-ds-lvskl 2/2 Running 8 1d
kube-system kube-proxy-l1hn5 1/1 CrashLoopBackOff 1 1d
kube-system kube-proxy-p1kbt 1/1 CrashLoopBackOff 1 1d
kube-system kube-proxy-x2b1m 1/1 CrashLoopBackOff 1 1d
kube-system kube-scheduler-master 1/1 Running 1 1d

To get it right, follow the following steps:

  • First initiate your cluster with kubeadm
# Don't forget to copy the joining output for this command, you will need it kubeadm join --token  
kubeadm init --api-advertise-addresses= --pod-network-cidr=10.244.0.0/16
  • Once your kubeadm is ready for joining running the following (to avoid getting the crashLoopBackOff message):
# Overwrite the exisiting address with the new advertised address
jq \
'.spec.containers[0].command |= .+ ["--advertise-address=_put_ip_here"]' \
/etc/kubernetes/manifests/kube-apiserver.json > /tmp/kube-apiserver.json
mv /tmp/kube-apiserver.json /etc/kubernetes/manifests/kube-apiserver.json

# setup the correct proxy parameters
kubectl -n kube-system get ds -l 'component=kube-proxy' -o json \
| jq '.items[0].spec.template.spec.containers[0].command |= .+ ["--proxy-mode=userspace"]' \
| kubectl apply -f - && kubectl -n kube-system delete pods -l 'component=kube-proxy'
kubectl apply -f 
  • finally, join your nodes using the following command (you should have noted that from earlier):
kubeadm join --token=_token_ _master-ip_

Once having followed these steps, you should be able to see all the services running for all your nodes (it takes about a minute to get the services running and in good shape so wait!).

For testing purposes run the following command to get a pod started.

kubectl run --image=weaveworks/hello-world hello 

I hope this helps!

Advertisements

SSH Configuration: The Easy Way

So having problems using SSH to log into your servers? don’t fret, I am writing this to make your life easier.

There are two ways to use SSH, one using “PasswordAuthentication” and one using ssh-generated public and private Keys. The keyed methods is the one you will end up using most of the time. Now. here is how to go about it:
Continue reading

vRealize Automation Capsule

 

Okay, so recently I have had the chance to play around with vRealize Automation (vRA). Therefore, I am using this chance to share with you the outcomes of this interesting endeavor of mine. I have formulated this article to be in the form of questions and answers, so feel free to jump around to any question you feel like you want an answer to. The questions are:

  • What are the core components of vRA?
  • What are the logical components of vRA?
  • What are the important roles supported in vRA?
  • What are the steps for basic configuration of vRA?
  • What is vRealize Application Services?
  • What are the other topics that I didn’t discuss in this capsule?

Continue reading