Skip to content

Latest commit

 

History

History
52 lines (49 loc) · 1.87 KB

kubernetes.md

File metadata and controls

52 lines (49 loc) · 1.87 KB

Kubernetes Undercloud | Intel Nuc(s) / Optiplex(s) / Etc

Install Kubernetes

In this section we will install kubernetes onto the Fedora host(s) that we are using for the Kargo Hypervisor.

4. Deploy Kubespray

a. Export Variables

export SSH_USER='kc2admin'
export SSH_PASS='kc2admin'
export HOSTS="192.168.1.51 192.168.1.52 192.168.1.53"
export VIRTUAL_IP="192.168.1.50"
export CLUSTER_DOMAIN="kubespray.home.arpa"

b. Deploy Kubespray

touch /tmp/kubeconfig;
docker run -it --rm --pull always \
    --volume /tmp/kubeconfig:/config:z \
    -e KUBE_API_FQDN="api.${CLUSTER_DOMAIN}" \
    -e HOSTS="${HOSTS}" \
    -e VRRP_IP="${VIRTUAL_IP}" \
  quay.io/containercraft/konductor:kubespray -e crio_version="1.22" \
    --user ${SSH_USER} -e ansible_ssh_pass=${SSH_PASS} -e ansible_sudo_pass=${SSH_PASS}

5) copy kubectl into kubeconfig path

mkdir -p ~/.kube && cp /tmp/kubeconfig ~/.kube/kubespray && chmod 600 ~/.kube/kubespray

5) Point KUBECONFIG to new kubespray config && Test

export KUBECONFIG=~/.kube/kubespray
kubectl get po -A

6) For Single, or 3 Node Clusters:

kubectl taint nodes --all --overwrite node-role.kubernetes.io/master-
kubectl label nodes --all --overwrite node-role.kubernetes.io/master=''
kubectl label nodes --all --overwrite node-role.kubernetes.io/control-plane=''
kubectl label nodes --all --overwrite node-role.kubernetes.io/worker=''

5) Point KUBECONFIG to new kubespray config && Test


OPTIONAL: Install Prometheus for Metrics

helm install kube-prometheus bitnami/kube-prometheus --namespace prometheus --create-namespace

*This section also works on Raspberry Pi's
**These steps are valid for building a kubernetes cluster