If you have btrfs:
1.As no-root user configure btrfs driver for podman
$ mkdir ~/.config/containers
$ touch ~/.config/containers/storage.conf
how-can-i-write-a-heredoc-to-a-file-in-bash-script
$ cat << EOF > ~/.config/containers/storage.conf
[storage]
driver="btrfs"
EOF
$ podman system reset
-
CGroups v2 configuration https://rootlesscontaine.rs/getting-started/common/cgroup2/ https://rootlesscontaine.rs/getting-started/common/cgroup2/#enabling-cpu-cpuset-and-io-delegation containers/podman#16412
-
Kind installation https://kind.sigs.k8s.io/docs/user/quick-start/#installing-from-release-binaries https://kind.sigs.k8s.io/docs/user/rootless/
$ sudo sh -c 'cat << EOF > /etc/systemd/system/[email protected]/delegate.conf
[Service]
Delegate=cpu cpuset io memory pids
EOF'
$ sudo systemctl daemon-reload
$ sudo sh -c 'cat << EOF > /etc/modules-load.d/iptables.conf
ip6table_nat
iptable_nat
EOF'
$ sudo systemctl reboot
$ cat << EOF > ~/kind.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30950
hostPort: 8080
EOF
$ cd ~
$ KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --config kind.yaml
$ export KUBECONFIG=${mktemp tmp.kubeconfig-XXXXXXXXXX}
$ $(kind get kubeconfig) > $KUBECONFIG
- Test deployment
$ cat << EOF > ~/kind-nginx-po.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 8080
protocol: TCP
EOF
$ cat << EOF > ~/kind-nginx-svc-nodeport.yaml
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- nodePort: 30950
port: 8080
protocol: TCP
targetPort: 80
selector:
run: nginx
type: NodePort
EOF
$ ./kubectl apply -f kind-nginx-po.yaml && ./kubectl apply -f kind-nginx-svc-nodeport.yaml
$ curl -L http://localhost:8080
- TODO check this https://www.redhat.com/sysadmin/podman-inside-container for testing in container
- TODO kubectl installation with alternatives
- TODO Check kind networking https://danielmiessler.com/p/tcpdump/ https://www.baeldung.com/linux/tcpdump-localhost-to-localhost