Kubernetes: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 3: Line 3:
# '''Kind:''' Kubernetes environment for clusters and more than a single node
# '''Kind:''' Kubernetes environment for clusters and more than a single node
# '''K3s:'''  Kubernetes environment for a low spec machine that uses fewer resources
# '''K3s:'''  Kubernetes environment for a low spec machine that uses fewer resources
{| class="wikitable sortable"
|-
! Nature !! Minikube  !! Kind  !! K3s
|-
! Runtimes
| <code>VM</code> || <code>Container</code> || <code>Native</code>
|-
! CPU Architectures
| <code>AMD64</code> || <code>AMD64</code> || <code>AMD64, ARMv7, ARM64</code>
|-
! Container Runtimes
| <code>Docker, CRI-O, containerd, gvisor</code> || <code>Docker</code> || <code>Docker, containerd</code>
|-
! Startup Time
| <code>5:19 / 3:15</code> || <code>2:48 / 1:06</code> || <code>0:15 / 0:15</code>
|-
! Memory
| <code>2GB</code> || <code>8GB (Windows, MacOS)</code> || <code>512 MB</code>
|-
! Root Access Required
| <code>✕</code> || <code>✕</code> || <code>✓</code>
|-
! Multi-Cluster
| <code>✓</code>  || <code>✓</code>  || <code>✕</code>
|-
! Multi-Node
| <code>✕</code> || <code>✓</code>  || <code>✓</code>
|-
! Project Home
| [https://minikube.sigs.k8s.io/ Minikube] || [https://kind.sigs.k8s.io/ Kind]  || [https://k3s.io/ K3s]
|}


==Install==
==Install==

Revision as of 10:11, 13 June 2021

Preferred Kubernetes environments are Minikube, Kind and K3s. It's depends on your use case.

  1. Minikube: Getting started with Fully Kubernetes environment
  2. Kind: Kubernetes environment for clusters and more than a single node
  3. K3s: Kubernetes environment for a low spec machine that uses fewer resources
Nature Minikube Kind K3s
Runtimes VM Container Native
CPU Architectures AMD64 AMD64 AMD64, ARMv7, ARM64
Container Runtimes Docker, CRI-O, containerd, gvisor Docker Docker, containerd
Startup Time 5:19 / 3:15 2:48 / 1:06 0:15 / 0:15
Memory 2GB 8GB (Windows, MacOS) 512 MB
Root Access Required
Multi-Cluster
Multi-Node
Project Home Minikube Kind K3s

Install

Minikube

Get-ComputerInfo OsName,OsVersion,OsBuildNumber
choco install docker-desktop -y
choco install minikube -y

# minikube start --driver=hyperv
# minikube start --driver=none
minikube start

minikube delete
minikube start --v=7
kubectl get nodes

Kind

choco install kubernetes-cli -y
choco install kind -y

# kind create cluster
# kind delete cluster

kind create cluster --name k8s-ns12-pc04
# kind delete cluster --name k8s-ns12-pc04
kubectl cluster-info --context kind-k8s-ns12-pc04
cat <<EOF > kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
EOF

K3s

choco install multipass -y
multipass launch -n node1
multipass list

multipass set local.driver=hyperv
multipass set local.driver=virtualbox

Get-NetConnectionProfile
Set-NetConnectionProfile -InterfaceIndex 13 -NetworkCategory Private

multipass list
cat C:\Windows\System32\drivers\etc\hosts.ics

multipass delete --purge --all
multipass exec node1 -- bash -c "curl -sfL https://get.k3s.io | sh -"
multipass exec node1 -- sudo kubectl get nodes

Knowledge

choco -v
wsl -l -v
wsl --list --verbose
Restart-Service LxssManager
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
apt install -y conntrack
apt install -yqq daemonize dbus-user-session fontconfig
docker --help
docker version

kubectl proxy
kubectl --help
kubectl version

kubectl get nodes
kubectl cluster-info
kubectl cluster-info dump
kubectl cluster-info --context kind-kind

kubectl get all --all-namespaces
kubectl get all --namespace kubernetes-dashboard

kubectl patch node $NODENAME -p '{"metadata":{"finalizers":[]}}' --type=merge
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')

References