Why are podman pods not reproducible using kubernetes yaml file?
I found the same article, and the same problem than you. None of the following tests worked for me:
- Add and remove environment variables
- Add and remove
restartPolicy
part - Play with the
capabilities
part
As soon as you move back the command
part, everything fires up again.
Check it with the following wordpress.yaml
:
# Generation of Kubernetes YAML is still under development!## Save the output of this file and use kubectl create -f to import# it into Kubernetes.## Created with podman-2.2.1apiVersion: v1kind: Podmetadata: labels: app: wordpress-pod name: wordpress-podspec: containers: - command: - apache2-foreground name: wptest-web env: - name: WORDPRESS_DB_NAME value: wp - name: WORDPRESS_DB_HOST value: 127.0.0.1 - name: WORDPRESS_DB_USER value: wordpress - name: WORDPRESS_DB_PASSWORD value: w0rdpr3ss image: docker.io/library/wordpress:latest ports: - containerPort: 80 hostPort: 8080 protocol: TCP resources: {} securityContext: allowPrivilegeEscalation: true capabilities: {} privileged: false readOnlyRootFilesystem: false seLinuxOptions: {} workingDir: /var/www/html - command: - mysqld name: wptest-db env: - name: MYSQL_ROOT_PASSWORD value: myrootpass - name: MYSQL_USER value: wordpress - name: MYSQL_PASSWORD value: w0rdpr3ss - name: MYSQL_DATABASE value: wp image: docker.io/library/mariadb:latest resources: {} securityContext: allowPrivilegeEscalation: true capabilities: {} privileged: false readOnlyRootFilesystem: false seLinuxOptions: {} workingDir: /status: {}
Play & checks:
# Create containers, pod and run everything$ podman play kube wordpress.yaml# OutputPod:5a211c35419b4fcf0deda718e47eec2dd10653a5c5bacc275c312ae75326e746Containers:bfd087b5649f8d1b3c62ef86f28f4bcce880653881bcda21823c09e0cca1c85b5aceb11500db0a91b4db2cc4145879764e16ed0e8f95a2f85d9a55672f65c34b# Check running state$ podman container ls; podman pod ls# OutputCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES5aceb11500db docker.io/library/mariadb:latest mysqld 13 seconds ago Up 10 seconds ago 0.0.0.0:8080->80/tcp wordpress-pod-wptest-dbbfd087b5649f docker.io/library/wordpress:latest apache2-foregroun... 16 seconds ago Up 10 seconds ago 0.0.0.0:8080->80/tcp wordpress-pod-wptest-webd8bf33eede43 k8s.gcr.io/pause:3.2 19 seconds ago Up 11 seconds ago 0.0.0.0:8080->80/tcp 5a211c35419b-infraPOD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS5a211c35419b wordpress-pod Running 20 seconds ago d8bf33eede43 3
A bit more explanation about the bug:
The problem is that entrypoint
and cmd
are not parsed correctly from the images, as it should and you would expect. It was working on previous versions, and it is already identified and fixed for the future ones.
For complete reference:
Comment found at podman#8710-comment.748672710 breaks this problem into two pieces:
- "make podman play use ENVs from image" (podman#8654 already fixed in mainstream)
- "podman play should honour both ENTRYPOINT and CMD from image" (podman#8666)
- This one is replaced by "play kube: fix args/command handling" (podman#8807 the one already merged to mainstream)