Notes Kubernetes k8s - Install

Voir :

https://enix.io/fr/blog/kubernetes-c-est-quoi-definition-k8s/

https://blog.cybiere.fr/post/installation-cluster-kubernetes-kubeadm-flannel/

Microshift (OpenShift OKD)

Voir aussi :

|Monitor Kubernetes cloud costs with open source tools

Archi

Il est conseillé de configurer un pool de 3 nœuds minimum pour optimiser le rolling upgrade lors des mises à jour de sécurité (patch updates) ou de version mineure.

Install

Kind

Voir :

https://gitlab.com/lucj/k8s-exercices/-/blob/master/Installation/kind.md

chmod +x /usr/local/bin/kind kind create cluster kubectl cluster-info --context kind-kind

Install de kubectl Install de Minikube

Install de Docker Desktop Docker swarm

https://kubernetes.io/docs/tasks/tools/

Kubectl

Kind

Minicube

Kubeadm

k3s

Voir :

https://gitlab.com/lucj/k8s-exercices/-/blob/master/Installation/k3s.md

https://particule.io/blog/k3s/

https://blog.otvl.org/blog/k3s-loc-sp/

Voir aussi k0s

K3d (K3S dans un container)

https://gitlab.com/lucj/k8s-exercices/-/blob/master/Installation/k3d.md

kubeinit / kubespray

Deploiement de K8S avec Ansible

Minikube (limité)

Basé sur KVM ou VirtualBox

Voir :

https://gitlab.com/lucj/k8s-exercices/-/blob/master/Installation/minikube.md

# Start a cluster using the kvm2 driver: minikube start --driver=kvm2 # To make kvm2 the default driver: minikube config set driver kvm2 minikube addons enable metrics-server minikube dashboard

Minikube crée un Cluster Kube en créant des VMs

minikube start --vm-driver=none minikube status minicube ip ssh docker@<ip> # Pass: tcuser

$ minikube addons list
|-----------------------------|----------|--------------|--------------------------------|
| ADDON NAME | PROFILE | STATUS | MAINTAINER |
|-----------------------------|----------|--------------|--------------------------------|
| ambassador | minikube | disabled | 3rd party (Ambassador) |
| auto-pause | minikube | disabled | minikube |
| cloud-spanner | minikube | disabled | Google |
| csi-hostpath-driver | minikube | disabled | Kubernetes |
| dashboard | minikube | enabled ✅ | Kubernetes |
| default-storageclass | minikube | enabled ✅ | Kubernetes |
| efk | minikube | disabled | 3rd party (Elastic) |
| freshpod | minikube | disabled | Google |
| gcp-auth | minikube | disabled | Google |
| gvisor | minikube | disabled | minikube |
| headlamp | minikube | disabled | 3rd party (kinvolk.io) |
| helm-tiller | minikube | disabled | 3rd party (Helm) |
| inaccel | minikube | disabled | 3rd party (InAccel |
| | | | [info@inaccel.com]) |
| ingress | minikube | disabled | Kubernetes |
| ingress-dns | minikube | disabled | minikube |
| inspektor-gadget | minikube | disabled | 3rd party |
| | | | (inspektor-gadget.io) |
| istio | minikube | disabled | 3rd party (Istio) |
| istio-provisioner | minikube | disabled | 3rd party (Istio) |
| kong | minikube | disabled | 3rd party (Kong HQ) |
| kubeflow | minikube | disabled | 3rd party |
| kubevirt | minikube | disabled | 3rd party (KubeVirt) |
| logviewer | minikube | disabled | 3rd party (unknown) |
| metallb | minikube | disabled | 3rd party (MetalLB) |
| metrics-server | minikube | enabled ✅ | Kubernetes |
| nvidia-device-plugin | minikube | disabled | 3rd party (NVIDIA) |
| nvidia-driver-installer | minikube | disabled | 3rd party (NVIDIA) |
| nvidia-gpu-device-plugin | minikube | disabled | 3rd party (NVIDIA) |
| olm | minikube | disabled | 3rd party (Operator Framework) |
| pod-security-policy | minikube | disabled | 3rd party (unknown) |
| portainer | minikube | disabled | 3rd party (Portainer.io) |
| registry | minikube | disabled | minikube |
| registry-aliases | minikube | disabled | 3rd party (unknown) |
| registry-creds | minikube | disabled | 3rd party (UPMC Enterprises) |
| storage-provisioner | minikube | enabled ✅ | minikube |
| storage-provisioner-gluster | minikube | disabled | 3rd party (Gluster) |
| storage-provisioner-rancher | minikube | disabled | 3rd party (Rancher) |
| volcano | minikube | disabled | third-party (volcano) |
| volumesnapshots | minikube | disabled | Kubernetes |
| yakd | minikube | disabled | 3rd party (marcnuri.com) |
|-----------------------------|----------|--------------|--------------------------------|

kubeadm

Voir : How to Install Kubernetes Cluster on Debian 11-12

Initializes cluster master node

kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.5.0.0/16

Initialize cluster networking

kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml

Minikube

minikube start minikube service list minikube update-context

Microk8s

Ubuntu

Voir :

https://www.linuxtechi.com/install-configure-kubernetes-ubuntu-18-04-ubuntu-18-10/

https://gitlab.com/lucj/k8s-exercices/-/blob/master/Installation/microK8s.md

snap install microk8s --classic microk8s.kubectl get nodes microk8s.kubectl get pod --namespace=kube-system

Apprendre K8S

A installer :

Minicube

Docker Desktop

Kubernetes Vanilla

Cours en ligne :

KodeCloud

Voir aussi :

Automate Kubernetes Workloads with Ansible