Skip to content

Instantly share code, notes, and snippets.

@abdennour
Created June 1, 2019 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdennour/e2b5ecd41214f3b44d235355b054fe98 to your computer and use it in GitHub Desktop.
Save abdennour/e2b5ecd41214f3b44d235355b054fe98 to your computer and use it in GitHub Desktop.
Kubernetes The easy way
  1. Initializes cluster master node:
 kubeadm init --apiserver-advertise-address $(hostname -i)
  1. Initialize cluster networking:
 kubectl apply -n kube-system -f \
    "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 |tr -d '\n')"
  1. (Optional) Create an nginx deployment:
 kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/application/nginx-app.yaml
  1. From the stdout of kubeadm init .. in master.md, retrieve the JOIN command:
# 192.168.0.13 is the host IP of master

kubeadm join 192.168.0.13:6443 --token 6u2w5b.3hejl7kb4t31nsb2 \
    --discovery-token-ca-cert-hash sha256:fe3dfe55327161f20b7358e4d0785cd4515cd10303adfcd6a9c535a5fea1ca9d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment