Skip to content

About

Vox Pupuli Container for r10k

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

5 watching

Forks

Vox Pupuli R10K

CI License Sponsored by betadots GmbH

Introduction

This container is designed for deploying Puppet code using r10k. It includes the r10k gem along with all necessary dependencies pre-installed, ensuring a seamless deployment process.

Breaking Changes / Migration Notes

see MIGRATION.md

Usage

To run r10k, simply execute the container. The r10k binary is set as the default entrypoint. The container runs with group 0 (GID 0) and works under any UID. The default UID is 64604. Mounted volumes must be writable by group 0. Use chgrp -R 0 <dir> && chmod -R g+rwX <dir> to set the required permissions. On Kubernetes, fsGroup: 0 does this for you. The UID of mounted files does not matter.

To use Git over SSH, mount the private key in /home/puppet/.ssh/. The key can be owned by the running UID with mode 0600. Alternatively, it can be owned by another UID if it is readable by group 0. For example, mount a Kubernetes secret with fsGroup: 0. Provide a known_hosts file in /home/puppet/.ssh/.

You can use a shared volume with a Puppet server and mount it at /etc/puppetlabs/code/environments.

podman run -it --rm -v code_dir:/etc/puppetlabs/code/environments:Z ghcr.io/voxpupuli/r10k:latest deploy environment -mv
services:
  r10k:
    image: ghcr.io/voxpupuli/r10k:5.0.0-latest
    environment:
      - PUPPET_CONTROL_REPO=https://github.com/my-org/control-repo.git
    volumes:
      - puppetserver-code-dir:/etc/puppetlabs/code/environments:Z
    entrypoint: ["/container-entrypoint.sh"]
    command: ["deploy", "environment", "-mv"]

Scheduled deploys

The image includes supercronic for scheduled deployments. The default entrypoint starts container-entrypoint.sh. Override the entrypoint to use supercronic as the long-running process. Run each script in /container-entrypoint.d/ before starting supercronic. This preserves the setup normally performed by the default entrypoint.

Create a crontab file with the desired schedule. Supercronic supports seven-field cron expressions with seconds as the first field. The fields represent second, minute, hour, day of month, month, day of week, and year. This example deploys all environments every 15 minutes:

0 */15 * * * * * /usr/local/bin/r10k deploy environment -mv

Mount the crontab and override the entrypoint when starting the container:

podman run -d --name r10k-scheduled \
  -v ./crontab:/crontab:ro \
  -v code_dir:/etc/puppetlabs/code/environments:Z \
  --entrypoint /bin/sh \
  ghcr.io/voxpupuli/r10k:latest \
  -c 'for f in /container-entrypoint.d/*.sh; do "$f"; done; exec supercronic /crontab'

The exec command makes supercronic the main container process. Job output and errors are written to the container's standard output and standard error streams. Use podman logs r10k-scheduled to view the output.

Environment Variables

Name Description
PUPPET_CONTROL_REPO The control repo url to get the Puppetfile from. Defaults to https://github.com/voxpupuli/controlrepo.git

Build

Build Arguments

Name Description
RUBYGEM_R10K The r10k version to install
RUBYGEM_OPENVOX The openvox version to install
PUPPET_CONTROL_REPO The control repo url to get the Puppetfile from. Defaults to https://github.com/voxpupuli/controlrepo.git

Version Schema

The version schema has the following layout:

<r10k.major>.<r10k.minor>.<r10k.patch>-v<container.major>.<container.minor>.<container.patch>
<r10k.major>.<r10k.minor>.<r10k.patch>-latest
latest

Example usage:

docker pull ghcr.io/voxpupuli/r10k:4.1.0-v1.2.3
docker pull ghcr.io/voxpupuli/r10k:4.1.0-latest
docker pull ghcr.io/voxpupuli/r10k:latest
Name Description
r10k.major Describes the contained major r10k version
r10k.minor Describes the contained minor r10k version
r10k.patch Describes the contained patch r10k version
container.major Describes breaking changes without backward compatibility
container.minor Describes new features or refactoring with backward compatibility
container.patch Describes if minor changes or bugfixes have been implemented

How to release?

see RELEASE.md

How to contribute?

see CONTRIBUTING.md

About

Vox Pupuli Container for r10k

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

5 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages