Skip to main content

Simple module to manage podman resources

Project description

inmanta-module-podman

pypi version build status

This package is an adapter that is meant to be used with the inmanta orchestrator: https://docs.inmanta.com

Features

This module allows to manage podman resources, on a unix host. It contains the following resources:

  1. podman::Network: to manage a podman network (subnets, routes, dns, driver, labels, options, ...).
  2. podman::NetworkDiscovery: to discover existing podman networks owned by a user on a host.
  3. podman::Pod: to manage a podman pod, including its networking, port publishing, id mapping and shared resources.
  4. podman::Container: to manage a podman container (image, command, environment, volumes, networks, healthcheck, security label, resource limits, auto-update, ...).
  5. podman::Image, podman::ImageFromRegistry and podman::ImageFromSource: to make sure a container image is present on a host, either pulled from a registry or built from a Containerfile.
  6. podman::ImageDiscovery: to discover existing container images owned by a user on a host.
  7. podman::AutoUpdate: to configure the podman auto-update service for a given user.
  8. podman::services::SystemdContainer, podman::services::SystemdPod and podman::services::SystemdAutoUpdate: to wrap a container, a pod or the auto-update service into a systemd service. These services can either be generated as plain systemd unit files (calling the podman cli) or as quadlet unit files.

Example

The following example shows how to run a container as a systemd service, using a quadlet unit file. The container is a simple nginx web server, exposing its port 80 on the host port 8080.

import mitogen
import podman
import podman::container_like
import podman::services
import std

host = std::Host(
    name="localhost",
    os=std::linux,
    via=mitogen::Local(),
)

# Make sure the container image is present on the host
image = podman::ImageFromRegistry(
    host=host,
    name="docker.io/library/nginx:latest",
)

# Define the container
web = podman::Container(
    host=host,
    name="nginx-web",
    image=image.name,
    publish=[
        podman::container_like::Publish(host_port="8080", container_port="80"),
    ],
)

# Wrap the container into a systemd service, using a quadlet unit file
podman::services::SystemdContainer(
    container=web,
    state="running",
    enabled=true,
    systemd_unit_dir="/etc/systemd/system",
    systemd_container_dir="/etc/containers/systemd",
    quadlet=true,
)

Find more examples in the tests folder of this module!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inmanta_module_podman-1.11.2.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inmanta_module_podman-1.11.2-py3-none-any.whl (43.0 kB view details)

Uploaded Python 3

File details

Details for the file inmanta_module_podman-1.11.2.tar.gz.

File metadata

  • Download URL: inmanta_module_podman-1.11.2.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for inmanta_module_podman-1.11.2.tar.gz
Algorithm Hash digest
SHA256 42c758fa48ed2a01a400f9b24bd60f19e17e72a1459e9623d085c892f8b712cc
MD5 dda33f9908ee1b4274d7c45aa7cd8099
BLAKE2b-256 4cf4923e47c1b71dcf98b142cc477aa9174df5c08b9ae51f5fac34e351ff1026

See more details on using hashes here.

Provenance

The following attestation bundles were made for inmanta_module_podman-1.11.2.tar.gz:

Publisher: continuous-delivery.yml on edvgui/inmanta-module-podman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file inmanta_module_podman-1.11.2-py3-none-any.whl.

File metadata

File hashes

Hashes for inmanta_module_podman-1.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 66364b9d93111cba3f0a5c53d3fbd4e0bdd0aaefa286ca264244460541ef2baa
MD5 1959781967290b84fd07b96f6a65ea34
BLAKE2b-256 e467f624e11132498efbcd2599fef0d046bbe699eba465121614d0797df7dd1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for inmanta_module_podman-1.11.2-py3-none-any.whl:

Publisher: continuous-delivery.yml on edvgui/inmanta-module-podman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page