Developing MinIO Operator with Podman - cesnietor/dev-docs GitHub Wiki
Developing for MinIO Operator requires to have a Kubernetes environment due to the nature of the product itself.
Podman is an alternative to Docker Desktop (requires subscription) and with few tweaks and considerations it can be a good replacement.
You can download the binaries but for Mac you still require a dockerd daemon and Virtual machine as per Docker docs:
"The macOS binary includes the Docker client only. It does not include the dockerd daemon which is required to run containers."
Note: This assumes you are using Mac M2 Pro.
See also:
Prerequirements:
- Kind
- MinIO Operator cloned
- Uninstall or Stop and Quit Docker Desktop App.
If you want the desktop UI experience, install Podman Desktop for Mac.
TL;DR:
brew install podman-desktop
No CLI: docs
TL;DR:
brew install podman
podman machine init
podman machine start
podman info
See podman machine command docs for more custom configuration like memory, cpu, etc.
- Set your Podman machine configuration by creating a new one and start it.
Refer to Podman Desktop docs for more info. - Disable Kubernetes since we'll be using Kind.
- Disable rootless default config for podman (needed for Kind to work).
podman system connection ls
podman system connection default podman-machine-default-root
- Create a symlink (alias is not enough)
ln -s /opt/podman/bin/podman /usr/bin/docker
If not set, the
make docker
command in /operator will fail.
List images:
√ ~ % docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
minio/k8s-operator latest 8a6672234bde 14 hours ago 204MB
kindest/node <none> 0dc0bbd0350c 3 weeks ago 858MB
Using docker
since we already created a symlink.
- Start your Kind cluster. See docs.
- Build image in your
/operator
folder like:
make build TAG="minio/operator:<YOUR_TAG>"
- Kind
load docker-images
is strictly for docker so usepodman save
andimage-archive
instead. This will store your images in a.tar
file so that Kind can upload them without issues. See discussion.
podman save --output images.tar localhost/minio/operator:<YOUR_TAG>
kind load image-archive images.tar
- Podman adds a
localhost/
to the image name when creating a new image e.g.localhost/<IMAGE_NAME>
. See discussion. - You will now have to deal with the new
.tar
file created for your images. (add it to your .gitignore)