podman-kube-generate(1) General Commands Manual podman-kube-generate(1) (NAME) podman-kube-generate - YAML (SYNOPSIS) podman kube generate [] ... | ... | ... (DESCRIPTION) podman kube generate YAML ( v1) . (Pod) . . YAML . (Bind-mounted volumes) hostPath (named volumes) persistentVolumeClaim . hostPath : DirectoryOrCreate Directory File . claimName persistentVolumeClaim . . hostPath (hyphen) . / root . persistentVolumeClaim -host . persistentVolumeClaim -pvc . (init container) once YAML once . YAML . always YAML . : YAML (rootless) SELinux : * "privileged: true" (pod spec) * type: spc_t securityContext seLinuxOptions * chcon -t container_file_t -R / . YAML podman-play-kube(1) . --infra-name YAML io.podman.annotations.infra.name . Deployment DaemonSet restartPolicy Always . Job restartPolicy OnFailure Never . YAML kube generate Never . (OPTIONS) --filename, -f=filename (STDOUT) . kube generate . --podman-only YAML ( ). --replicas, -r=replica count Deployment replicas ( ) . : --type=deployment . --service, -s . Service Pod . (portmap bindings) NodePort . . --type, -t=pod | deployment | daemonset | job (kind) YAML. Pod Deployment Job DaemonSet . Pod . (EXAMPLES) YAML : $ podman kube generate some-mariadb # Save the output of this file and use kubectl create -f to import # it into Kubernetes. # # Created with podman-4.8.2 # NOTE: If you generated this yaml from an unprivileged and rootless podman container on an SELinux # enabled system, check the podman generate kube man page for steps to follow to ensure that your pod/container # has the right permissions to access the volumes added. --- apiVersion: v1 kind: Pod metadata: creationTimestamp: "2024-01-09T02:24:55Z" labels: app: some-mariadb-pod name: some-mariadb-pod spec: containers: - args: - mariadbd env: - name: MARIADB_ROOT_PASSWORD value: x image: docker.io/library/mariadb:10.11 name: some-mariadb ports: - containerPort: 3306 hostPort: 34891 volumeMounts: - mountPath: /var/lib/mysql name: mariadb_data-pvc volumes: - name: mariadb_data-pvc persistentVolumeClaim: claimName: mariadb_data YAML Deployment : $ podman kube generate --type deployment --replicas 3 dep-ctr # Save the output of this file and use kubectl create -f to import # it into Kubernetes. # # Created with podman-4.5.0-dev apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: "2023-03-27T20:45:08Z" labels: app: dep-ctr-pod name: dep-ctr-pod-deployment spec: replicas: 3 selector: matchLabels: app: dep-ctr-pod template: metadata: annotations: io.podman.annotations.ulimit: nofile=524288:524288,nproc=127332:127332 creationTimestamp: "2023-03-27T20:45:08Z" labels: app: dep-ctr-pod name: dep-ctr-pod spec: containers: - command: - top image: docker.io/library/alpine:latest name: dep-ctr YAML /home/user/my-data /volume : $ podman kube generate my-container-with-bind-mounted-data # Save the output of this file and use kubectl create -f to import # it into Kubernetes. # # Created with podman-3.1.0-dev apiVersion: v1 kind: Pod metadata: creationTimestamp: "2021-03-18T16:26:08Z" labels: app: my-container-with-bind-mounted-data name: my-container-with-bind-mounted-data spec: containers: - command: - /bin/sh image: docker.io/library/alpine:latest name: test-bind-mount volumeMounts: - mountPath: /volume name: home-user-my-data-host restartPolicy: Never volumes: - hostPath: path: /home/user/my-data type: Directory name: home-user-my-data-host YAML priceless-data /volume : $ podman kube generate my-container-using-priceless-data # Save the output of this file and use kubectl create -f to import # it into Kubernetes. # # Created with podman-3.1.0-dev apiVersion: v1 kind: Pod metadata: creationTimestamp: "2021-03-18T16:26:08Z" labels: app: my-container-using-priceless-data name: my-container-using-priceless-data spec: containers: - command: - /bin/sh image: docker.io/library/alpine:latest name: test-bind-mount volumeMounts: - mountPath: /volume name: priceless-data-pvc restartPolicy: Never volumes: - name: priceless-data-pvc persistentVolumeClaim: claimName: priceless-data YAML : $ sudo podman kube generate -s demoweb # Save the output of this file and use kubectl create -f to import # it into Kubernetes. # # Created with podman-0.12.2-dev apiVersion: v1 kind: Pod metadata: creationTimestamp: 2018-12-18T15:16:06Z labels: app: demoweb name: demoweb-libpod spec: containers: - command: - python3 - /root/code/graph.py image: quay.io/baude/demoweb:latest name: practicalarchimedes tty: true workingDir: /root/code --- apiVersion: v1 kind: Service metadata: creationTimestamp: 2018-12-18T15:16:06Z labels: app: demoweb name: demoweb-libpod spec: ports: - name: "8050" nodePort: 31269 port: 8050 targetPort: 0 selector: app: demoweb type: NodePort status: loadBalancer: {} (SEE ALSO) podman(1), podman-container(1), podman-pod(1), podman-kube-play(1), podman-kube-down(1) (HISTORY) Brent Baude (bbaude at redhat dot com) podman-kube-generate(1)