Kubernetes

Introduction

Introduction

Pods are collections of docker containers. Can be just one docker container or more

Nodes are where pods are deployed. Could be one node, or more.

Cluster is a collection of nodes

Kubernetes (k8s)

minikube

Developed by developers of k8s.

k3s

Developed by Rancher

systemctl status k3s
systemctl stop k3s
systemctl start k3s

microk8s

Developed by Canonical.

Might need to change firewall rules

https://ubuntu.com/tutorials/install-a-local-kubernetes-with-microk8s#2-deploying-microk8s

If need to hard reset

sudo microk8s reset --destroy-storage
sudo microk8s kubectl delete --all deployments --namespace=foo

Enable things. Registry allows the use of local Docker builds.

sudo microk8s enable dns dashboard storage registry

check all running

microk8s kubectl get all --all-namespaces

read off ip of dashboard. go to https://ip:443

get token

sudo microk8s config

Enable loadbalancer. Separate as asks questions.

sudo microk8s enable metallb

Run dashboard. Go to IP and port for service/kubernetes-dashboard.

sudo microk8s dashboard-proxy

Kompose

using kompose to convert docker-compose file to kubernetes file First convert the docker compose file to a kubernetes file.

kompose --file docker-compose.yml --build convert

But change image name to local


    spec:
      containers:
      - image: localhost:32000/homepage-nodejs