[PDB-2669] Provide Official Docker PuppetDB Created: 2016/05/04  Updated: 2017/03/21  Resolved: 2017/03/21

Status: Closed
Project: PuppetDB
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Normal
Reporter: John Moser Assignee: John Moser
Resolution: Fixed Votes: 2
Labels: puppetdb, trivial
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Support
supports CPR-423 Provide Official Docker Puppetmaster Closed
Template:
Acceptance Criteria:

For minimal acceptance, the PuppetDB Docker container must:

  • Work out-of-the-box with any puppetserver, whether a Docker deployment or a standard install
  • Provide simple configuration (no significant complexity beyond normal configuration)
  • Provide persistence
  • Include adequate user-end documentation

The container must provide the maintainers with a minimal-effort maintenance cycle:

  • Containers should automatically rebuild on Docker Hub when updated in git
  • System patches (e.g. Ubuntu 14.04) should automatically trigger a rebuild on Docker Hub
  • Updating to new releases must be trivial

The first two are features of Docker Hub; the last is accomplished by a simple update process:

  • Add a new build directory for each release (e.g. puppetdb/pc2/)
  • Modify the Dockerfile there to reflect the new version (e.g. "pc2" instead of "pc1")
  • Add the new path as a tag target to Docker Hub (e.g. /puppetdb/pc2/ = pc2)

 Description   

Provide a PuppetDB docker container suitable for an official branch on docker hub. This adds onto PUP-6262 to provide a Puppetserver deployment with PuppetDB in one quick configuration.

Once provided, a user can create a Puppetserver with PuppetDB via such a docker-compose file:

```

  1. docker-compose.yml for Puppet
  2. e.g. /opt/containers/puppet/docker-compose.yml
    puppetserver:
    image: puppetserver:pc1
    environment:
    PUPPETSERVER_HOSTNAME: puppet.example.com
    PUPPETSERVER_GENCONFIG: yes
    ports:
  • "8140:8140"
    volumes:
  • /opt/containers/puppet/data/ssl:/etc/puppetlabs/puppet/ssl
  • /opt/containers/puppet/data/code:/etc/puppetlabs/code
    links:
  • puppetdb
    restart: always
    puppetdb:
    image: puppetdb:pc1
    environment:
    PUPPETSERVER_HOSTNAME: puppet.example.com
    PUPPETSERVER_GENCONFIG: yes
    PUPPETDB_SERVER: "db"
    PUPPETDB_DATABASE: "puppetdb"
    PUPPETDB_PASSWORD: "puppetdb"
    expose:
  • 8081
    links:
  • db
    restart: always
    db:
    image: postgres:9.5
    environment:
    POSTGRES_USER: "puppetdb"
    POSTGRES_PASSWORD: "puppetdb"
    expose:
  • 5432
    volumes:
  • /opt/containers/puppet/data/db:/var/lib/postgresql/data
    restart: always
    ```


 Comments   
Comment by John Moser [ 2016/05/04 ]

Currently scaffolded based on the puppetserver module. Visible in the feature/puppetdb branch:

https://github.com/bluefoxicy/docker-puppet/tree/feature/puppetdb/puppetdb

Doesn't actually run yet; I'm not a puppetdb user and am kind of blind on this one.

Comment by Wyatt Alt [ 2016/05/04 ]

John Moser thanks for putting this together. If we go through with it I imagine a coordinated release (rather than an independent PDB effort) would be required across at least the products you've raised tickets against, and maybe more. The relevant people have been pinged between this ticket and the PUP one; we'll update you when the situation clarifies.

Comment by John Moser [ 2016/05/05 ]

Both approaches make sense. I've focused mostly on the Puppetserver; PuppetDB is actually unfamiliar to me.

I do hope to extend these to Puppetserver-Enterprise, including puppetlabs's Puppet Enterprise ENC. This would allow Enterprise users to stand up any docker-compatible system (Alpine, CentOS, Ubuntu, etc.) and immediately deploy Puppetlabs Enterprise software products. As with PuppetDB, I'm not a user of Puppetlabs Enterprise products.

Running inside Docker isolates Puppet and MCollective agents from the system, and would result in Facter returning facts about the container instead of the host. Those products are excluded.

Comment by Gareth Rushgrove [ 2016/05/13 ]

Hi John Moser. I'm Gareth, one of the engineers at Puppet. As it happens I've been working on official docker images for various bits of Puppet software recently. I'll look to get the repository I'm working on opened up in the next week or so and update here when I do. Certainly open to collaborating on that. My implementation is pretty similar to what you have, along with a bunch of build toolchain stuff and testing.

In the meantime, I'd love to understand your usecases. What made you consider running Puppet in Docker in the first place? What advantages do you see in doing so?

Thanks again. Hopefully you'll like what I have so far, it's still definitely work in progress.

Comment by Neil Katin [ 2016/07/31 ]

I'll throw in my 2 cents for a use-case for puppetdb-in-docker.

I'm running puppet on fedora 24. There are no puppetdb packages for fedora; having puppetdb in docker would make it easy to run puppetdb without forcing a different OS on the host.

Comment by Gareth Rushgrove [ 2016/08/01 ]

We now have Docker images available on Hub for various bits of Puppet software.

You can find the images, including a PuppetDB image, at:
https://hub.docker.com/u/puppet/

The tools used to build, including Dockerfiles, are in:
https://github.com/puppetlabs/puppet-in-docker

Comment by Ryan Senior [ 2017/03/21 ]

Thanks Gareth Rushgrove!

Generated at Wed Nov 13 16:56:21 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.