Skip to main content
Version: Deploy 22.2

How to use the Podman plugin

This topic provides information on how to use the Podman plugin.

Deploy a podman Container

  1. Create an application and a deployment package.
  2. Hover over the deployment package, click Explorer action menu > New, and then select podman.ContainerSpec.
  3. Hover over the deployment package containing the new podman.ContainerSpec, click Explorer action menu > Deploy, and select the target environment.
  4. Click Continue and then click Deploy to execute the plan.

Sample Manifest

<?xml version="1.0" encoding="UTF-8"?>
<udm.DeploymentPackage version="demo_podman_host" application="demo_create_container_app">
<application />
<orchestrator />
<deployables>
<podman.ContainerSpec name="/nginx_container">
<tags />
<containerName>demo_nginx</containerName>
<image>nginx</image>
<labels />
<environment />
<restartPolicyMaximumRetryCount>40</restartPolicyMaximumRetryCount>
<networks />
<dnsOptions />
<links />
<portBindings />
<volumeBindings />
</podman.ContainerSpec>
</deployables>
<applicationDependencies />
<dependencyResolution>LATEST</dependencyResolution>
<undeployDependencies>false</undeployDependencies>
</udm.DeploymentPackage>

Deploy a podman Pod

  1. Create an application and a deployment package.
  2. Hover over the deployment package, click Explorer action menu > New, and then select podman.Service.
  3. Hover over the deployment package containing the new podman.Pod, click Explorer action menu > Deploy.
  4. Click Continue and then click Deploy to execute the plan.

Sample Manifest

<?xml version="1.0" encoding="UTF-8"?>
<udm.DeploymentPackage version="podman_pod" application="podman_pod_demo_app">
<application />
<orchestrator />
<deployables>
<podman.PodSpec name="/tomcat_service">
<cgroup_parent />
<name>tomcat-service</name>
<infra_image>tomcat</infra_image>
<labels />
<hostname />
<cpu_period>1</cpu_period>
<cpu_quota>1</cpu_quota>
<infra_command />
<no_infra />
<no_manage_hosts />
<pod_create_command />
<pod_devices />
</podman.PodSpec>
</deployables>
<applicationDependencies />
<dependencyResolution>LATEST</dependencyResolution>
<undeployDependencies>false</undeployDependencies>
</udm.DeploymentPackage>

Note: You can deploy a podman Pod.

Deploy a Podman Volume

Create an independent volume

  1. Create an application and a deployment package.
  2. Hover over the deployment package, click Explorer action menu > New, and then select podman.VolumeSpec.
  3. Enter a name for the service in the Name field and specify a Volume Name for the volume.
  4. Hover over the deployment package containing the new podman.VolumeSpec, click Explorer action menu > Deploy and select the target environment.
  5. Click Continue and then click Deploy to execute the plan.
  6. To check if the volume is created, run this command:
    podman volume ls

Attach a volume to a Podman container

  1. Hover over the created container, click Explorer action menu > New, and then select MountedVolumeSpec.
  2. Enter a name for the application version, specify a name for the volume, enter the directory of the Podman container where the volume will be attached in the Mountpoint field, and set the default value to false in the Read Only field.
  3. Deploy the created package to the target environment.

The Podman container is created with the mounted volume attached at the mount point.

Sample Manifest

<?xml version="1.0" encoding="UTF-8"?>
<udm.DeploymentPackage version="podman_volume" application="podman_volume_demo">
<application />
<orchestrator />
<deployables>
<podman.VolumeSpec name="/test_volume">
<tags />
<volumeName>testvolume</volumeName>
<driver>default</driver>
<driverOptions />
<labels />
</podman.VolumeSpec>
<podman.ContainerSpec name="/nginx_container">
<container_name>nginx-container</container_name>
<image>nginx</image>
<labels />
<environment />
<portBindings />
<volumeBindings>
<podman.MountedVolumeSpec name="/nginx_container/testvolume">
<volumeName>testvolume</volumeName>
<mountpoint>/tmp</mountpoint>
</podman.MountedVolumeSpec>
</volumeBindings>
</podman.ContainerSpec>
</deployables>
<applicationDependencies />
<dependencyResolution>LATEST</dependencyResolution>
<undeployDependencies>false</undeployDependencies>
</udm.DeploymentPackage>

Create a Podman Network

  1. Create an application and a deployment package.
  2. Hover over the deployment package, click Explorer action menu > New, and then select podman.NetworkSpec. Perform the same action again to create a podman.ContainerSpec.
  3. In the Network Name field, specify the name of the private network that will be created.
  4. Click Save to create the network.
  5. For the created container, go to the Network tab and add the name of the network, which will bind the
    containers.
  6. Deploy the application to the target environment.
  7. Log in to your Podman host and run this command:
    podman network inspect <network_name>
  8. To verify if the network is created with the Podman host, run this command:
    podman network ls

Map a Podman container port to a Podman host

Port mapping is used to map the host port with the container port.

Create a port mapper

  1. Create a container inside an application with a deployment package.
  2. Hover over the created container, click Explorer action menu > New, and then select PortSpec.
  3. Enter a name for the application version.
  4. In the Host Port field, enter the port of the Podman host that will be mapped to the container, the container port, and specify the protocol over which the connection will be established.
  5. Deploy the application to the target environment.
  6. Log in to your podman host and run this command:
    podman network inspect <network_name>
  7. To verify if the network is created with the podman host, run this command:
    podman network ls

Sample Manifest

<?xml version="1.0" encoding="UTF-8"?>
<udm.DeploymentPackage version="network_package" application="podman_demo_network">
<application />
<orchestrator />
<deployables>
<podman.NetworkSpec name="/custom_network">
<tags />
<networkName>custom_network</networkName>
<networkOptions />
</podman.NetworkSpec>
<podman.ContainerSpec name="/mysql-container">
<tags />
<containerName>mysql-container</containerName>
<image>mysql</image>
<labels />
<environment />
<networks>
<value>custom_network</value>
</networks>
<dnsOptions />
<links />
<portBindings>
<podman.PortSpec name="/mysql-container/port_map">
<hostPort>92</hostPort>
<containerPort>80</containerPort>
<protocol>tcp</protocol>
</podman.PortSpec>
</portBindings>
<volumeBindings />
</podman.ContainerSpec>
</deployables>
<applicationDependencies />
<dependencyResolution>LATEST</dependencyResolution>
<undeployDependencies>false</undeployDependencies>
</udm.DeploymentPackage>