Kubernetes on podman wih kind without terraform.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Cyril CONSTANTIN 8776475bd2 up 4 weeks ago
LICENSE Initial commit 5 months ago
README.md up 4 weeks ago
check_status.sh up 4 weeks ago
containers.conf up 4 weeks ago
create_cluster.sh up 4 weeks ago
env.sh up 4 weeks ago
kind-config.yaml up 4 weeks ago
registries.conf up 4 weeks ago
storage.conf up 4 weeks ago

README.md

kubosm

Kubernetes on podman wih kind.

local storage

$ sudo lvcreate --size 64G --name kubernetes blue
ok
$ sudo  mkfs.ext4 /dev/blue/kubernetes
$ sudo mount /dev/blue/kubernetes /datas/kubernetes   # fstab
$ sudo chown $(whoami):$(whoami) /datas/kubernetes

install and configure programs

$ sudo apt install kubectl kind podman
$ podman info | grep "^  cgroupVersion: v2$"
$ systemctl --version
systemd 257 (257.13-1~deb13u1) # systemd > 252 : OK
+PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE
$ sudo mkdir /etc/systemd/system/user@.service.d
$ cat > /etc/systemd/system/user@.service.d/delegate.conf <<EOF
[Service]
Delegate=yes
EOF
$ sudo systemctl daemon-reload

init

$ cd /git
$ git clone https://git.ccyr.eu/constcyr/kubosm.git
Clonage dans 'kubosm'...
$ cd /git/kubosm

build

$ systemctl --user start podman.service
$ systemctl --user status podman.service
● podman.service - Podman API Service
Loaded: loaded (/usr/lib/systemd/user/podman.service; disabled; preset: enabled)
Active: active (running) since Wed 2026-05-27 14:49:51 CEST; 3s ago
$ bash kind.sh
Running as unit: run-p43465-i43765.scope; invocation ID: f14e52fea7a94c638b823b132fb47b7c
using podman due to KIND_EXPERIMENTAL_PROVIDER
enabling experimental podman provider
Creating cluster "kubosm" ...
 ✓ Ensuring node image (kindest/node:v1.32.2) 🖼 
 ✓ Preparing nodes 📦  
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹️ 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 
Set kubectl context to "kind-kubosm"
You can now use your cluster with:
kubectl cluster-info --context kind-kubosm
Have a nice day! 👋
$ podman ps 
CONTAINER ID  IMAGE                                                                                           COMMAND     CREATED        STATUS        PORTS                                               NAMES
63cb3321854e  docker.io/kindest/node@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f              3 minutes ago  Up 3 minutes  127.0.0.1:6443->6443/tcp, 127.0.0.1:8080->8080/tcp  kubosm-control-plane
$ kubectl cluster-info --context kind-kubosm
Kubernetes control plane is running at https://127.0.0.1:6443
CoreDNS is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
$ kind load docker-image debian:stable-slim --name kubosm
using podman due to KIND_EXPERIMENTAL_PROVIDER
enabling experimental podman provider
Image: "debian:stable-slim" with ID "sha256:a46b31c2389d51329eea0637614ad105716df53be6b623379b7a2a94e03abc54" not yet present on node "kubosm-control-plane", loading...
$ kubectl get namespaces 
NAME                 STATUS   AGE
default              Active   15m
kube-node-lease      Active   15m
kube-public          Active   15m
kube-system          Active   16m
local-path-storage   Active   15m
$ kubectl get nodes 
NAME                   STATUS   ROLES           AGE   VERSION
kubosm-control-plane   Ready    control-plane   16m   v1.32.2

check

 $ docker ps
CONTAINER ID   IMAGE                  COMMAND                  CREATED        STATUS          PORTS                                               NAMES
e7fbc32b2ed5   kindest/node:v1.27.1   "/usr/local/bin/entr…"   15 hours ago   Up 19 minutes   0.0.0.0:8080->8080/tcp, 127.0.0.1:41823->6443/tcp   kubosm-control-plane
f7c98a3a3a2a   kindest/node:v1.27.1   "/usr/local/bin/entr…"   15 hours ago   Up 19 minutes                                                       kubosm-worker
$ kind get clusters
kubosm
$ source env.sh
$ kubectl cluster-info --context kind-kubosm
Kubernetes control plane is running at https://127.0.0.1:41823
CoreDNS is running at https://127.0.0.1:41823/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
$ kubectl get deployments
NAME    READY   UP-TO-DATE   AVAILABLE   AGE
nginx   1/1     1            1           4m1s
$ kubectl get services
NAME         TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)          AGE
kubernetes   ClusterIP   10.96.0.1     <none>        443/TCP          18h
nginx        NodePort    10.96.85.96   <none>        8080:30201/TCP   21s

Load and save images

$ podman save docker.io/library/registry:3 | xz > /datas/kubernetes/backups/registry.tar.xz
$ podman save docker.io/kindest/node@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f | xz > /datas/kubernetes/backups/kindest.tar.xz
$ podman pull docker.io/debian:sid
Trying to pull docker.io/library/debian:sid...
Getting image source signatures
Copying blob 02991db6507c done   | 
Copying config ee36d5c9a7 done   | 
Writing manifest to image destination
ee36d5c9a7c2d8d4edf03c44e7a90f050e0980131b584002ed4100208494cd40
$ podman tag docker.io/debian:sid localhost:5001/debian:sid
$ docker push localhost:5001/debian:sid
The push refers to repository [localhost:5001/debian]
An image does not exist locally with the tag: localhost:5001/debian
$ kubectl create deployment debian --image=localhost:5001/debian:sid
deployment.apps/debian created
$ podman build -t bash https://git.ccyr.eu/constcyr/debian_podman.git
STEP 1/4: FROM docker.io/library/debian:sid
STEP 2/4: LABEL maintainer="Cyril CONSTANTIN"
--> 002453ba3ffb
STEP 3/4: LABEL io.containers.capabilities="sys_chroot"
--> 4b6cff2dd7f8
STEP 4/4: CMD ["/usr/bin/bash"]
COMMIT bash
--> cdeda6a6472a
Successfully tagged localhost/bash:latest
cdeda6a6472aeacdfc2de36c1de3d3c9868342ea1cc48f7ff61970ab069ed016
$ kubectl create deployment bash --image=localhost:5001/bash:latest
deployment.apps/bash created

DEPRECATED TESTS

$ systemd-run --scope -p "Delegate=yes" --user kind create cluster --config=./kind-config.yaml
$ systemd-run --scope -p "Delegate=yes" --user kind create cluster --name osmkub
$ kind get clusters
osmkub
$ kubectl config get-contexts
CURRENT   NAME          CLUSTER       AUTHINFO      NAMESPACE
*         kind-osmkub   kind-osmkub   kind-osmkub   
$ podman ps
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
$ podman ps -a
CONTAINER ID  IMAGE                                                                                           COMMAND     CREATED       STATUS                     PORTS                                               NAMES
60c8ec5cd33a  docker.io/kindest/node@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f              45 hours ago  Exited (137) 42 hours ago  127.0.0.1:6443->6443/tcp, 127.0.0.1:8080->8080/tcp  osmkub-control-plane
$ podman start 60c8ec5cd33a
60c8ec5cd33a
$ podman ps
CONTAINER ID  IMAGE                                                                                           COMMAND     CREATED       STATUS         PORTS                                               NAMES
60c8ec5cd33a  docker.io/kindest/node@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f              45 hours ago  Up 36 seconds  127.0.0.1:6443->6443/tcp, 127.0.0.1:8080->8080/tcp  osmkub-control-plane
$ kubectl cluster-info --context kind-osmkub 
Kubernetes control plane is running at https://127.0.0.1:6443
CoreDNS is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
$ ss -l --tcp |grep 6443
LISTEN 0      4096                  127.0.0.1:6443          0.0.0.0:*

Copy containers.conf and storage.conf from /usr/share Modify them with /data/kubernetes

offline

docker pull kindest/node:v1.17.0@sha256:9512edae126da271b66b990b6fff768fbb7cd786c7d39e86bdf55906352fdf62
docker save kindest/node:v1.17.0@sha256:9512edae126da271b66b990b6fff768fbb7cd786c7d39e86bdf55906352fdf62 | gzip > /datas/kubernetes/kind.v1.17.0.tar.gz
docker load -i kind.v1.17.0.tar.gz
docker image tag kindest/node:v1.17.0@sha256:9512edae126da271b66b990b6fff768fbb7cd786c7d39e86bdf55906352fdf62 kindest/node:v1.17.0
docker image ls kindest/node

rootless