docker v1.15.3

How To Setup Kubernetes Cluster Using Kubeadm
circle-info

references:

ha cluster step by step

[!TIP]

basic environment

cfssl

etcd

keepalive

extend etcd

  • prepare

[!TIP] setup certificate in primary control plane node

FILE
DESCRIPTION

ca.csr

The signing request that the Root will sign

ca.pem

The unsigned intermediate so it’s useless, you can discard this one

ca-key.pem

The private key for your CA, do not lose this or share it

configuration

circle-info

generate the default json file:

  • ca-config.json

  • CA

  • client

ca and client certs

  • result

  • check expired time

  • verify

copy certs

[!TIP] copy ected certificates to peer control nodes

peer

[!TIP] running in all masters

enable etcd service

[!TIP] running in all masters

HAProxy

[!TIP] for HA-Proxy version 2.0.6

kubeadm init

kubeadm-conf.yaml

[!TIP] create kubeconfig in all masters

init controller

[!TIP] init controller in primary control plane node ONLY

sync PKI

[!TIP] sync PKI in peer controller nodes ONLY

sample

  • Generate the certificate authority

    [!TIP] to generate:

    • /etc/kubernetes/pki/etcd/ca.crt

    • /etc/kubernetes/pki/etcd/ca.key

  • Create certificates for each member

  • copy certificates and kubeadm configs

  • create the static pod manifests

  • [optional]: check the cluster health

tips

kubeadm init

[!TIP] kubeadm init also exposes a flag called --skip-phases that can be used to skip certain phases. The flag accepts a list of phase names and the names can be taken from the above ordered list.

kubeadm init phase control-planearrow-up-right

  • control plane

  • all

  • apiserver

    [!TIP] options:

    • -h, --help

    • --apiserver-advertise-address <string>

    • --apiserver-bind-port <int32> Default: 6443

    • --apiserver-extra-args <comma-separated 'key=value' pairs>

    • --cert-dir <string> Default: "/etc/kubernetes/pki"

    • --config <string>

    • --control-plane-endpoint <string>

    • --dry-run

    • --feature-gates <string>

    • --image-repository <string> Default: "k8s.gcr.io"

    • --kubernetes-version <string> Default: "stable-1"

    • --patches <string>

    • --service-cidr <string> Default: "10.96.0.0/12"

    • --rootfs <string>

  • controller-manager

    [!TIP] options:

    • -h, --help

    • --cert-dir <string> Default: "/etc/kubernetes/pki"

    • --config <string>

    • --apiserver-extra-args <comma-separated 'key=value' pairs>

    • --dry-run

    • --image-repository <string> Default: "k8s.gcr.io"

    • --kubernetes-version <string> Default: "stable-1"

    • --patches <string>

    • --pod-network-cidr <string>

    • --rootfs <string>

  • scheduler

    [!TIP] options:

    • -h, --help

    • --cert-dir <string> Default: "/etc/kubernetes/pki"

    • --config <string>

    • --dry-run

    • --image-repository <string> Default: "k8s.gcr.io"

    • --kubernetes-version <string> Default: "stable-1"

    • --patches <string>

    • --scheduler-extra-args <comma-separated 'key=value' pairs>

    • --rootfs <string>

kubeadm init phase etcdarrow-up-right

  • etcd

  • local

    [!TIP] options:

    • -h, --help

    • --cert-dir <string> Default: "/etc/kubernetes/pki"

    • --config <string>

    • --image-repository <string> Default: "k8s.gcr.io"

    • --patches <string>

    • --rootfs <string>

kubeadm init phase upload-configarrow-up-right

[!TIP] options:

  • -h, --help

  • --certificate-key <string>

  • --config <string>

  • --kubeconfig <string> Default: "/etc/kubernetes/admin.conf"

  • --skip-certificate-key-print

  • --upload-certs

  • --rootfs <string>

kubeadm init phase mark-control-planearrow-up-right

kubeadm init phase bootstrap-tokenarrow-up-right

kubeadm init phase kubelet-finalizearrow-up-right

  • kubelet-finalize

  • kubelet-finalize-all

  • kubelet-finalize-cert-rotation

tear down

Last updated