Sign inSign up

voxpupuli/r10k

Sponsored OSS

By voxpupuli

Updated 24 days ago

Vox Pupuli r10k container

Image
1

7.5K

voxpupuli/r10k repository overview

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

NameDescription
PUPPET_CONTROL_REPOThe control repo url to get the Puppetfile from. Defaults to https://github.com/voxpupuli/controlrepo.git

Build

Build Arguments
NameDescription
RUBYGEM_R10KThe r10k version to install
RUBYGEM_OPENVOXThe openvox version to install
PUPPET_CONTROL_REPOThe 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
NameDescription
r10k.majorDescribes the contained major r10k version
r10k.minorDescribes the contained minor r10k version
r10k.patchDescribes the contained patch r10k version
container.majorDescribes breaking changes without backward compatibility
container.minorDescribes new features or refactoring with backward compatibility
container.patchDescribes if minor changes or bugfixes have been implemented

How to release?

see RELEASE.md

How to contribute?

see CONTRIBUTING.md

Tag summary

Content type

Image

Digest

sha256:b8a011cde

Size

38.1 MB

Last updated

24 days ago

docker pull voxpupuli/r10k

This week's pulls

Pulls:

70

Last week