Puppet Docker Creating a Docker service using a Puppet manifest

0 votes
I want to create a distributed application across multiple swarm nodes for which i need to create a docker service. How can i achieve this objective using puppet?
Aug 14, 2019 in Puppet by Priya
610 views

1 answer to this question.

0 votes
  • Docker services are used to create distributed applications across multiple swarm nodes. 

  • Each Docker service replicates a set of containers across the swarm.

  • To create a Docker service, add the following code to the manifest file:

docker::services {'redis':
    create => true,
    service_name => 'redis',
    image => 'redis:latest',
    publish => '6379:639',
    replicas => '5',
    mounts => ['type=bind,source=/etc/my-redis.conf,target=/etc/redis/redis.conf,readonly'],
    extra_params => ['--update-delay 1m', '--restart-window 30s'],
    command => ['redis-server', '--appendonly', 'yes'],
  }
  • To base the service off an image, include the image parameter and include the publish parameter to expose the service port (use an array to specify multiple published ports). 

  • To set the amount of containers running in the service, include the replicas parameter. 

  • To attach one or multiple filesystems to the service, use the mounts parameter. 

  • For information regarding the extra_params parameter, see docker service create --help

  • The command parameter can either be specified as an array or a string.

answered Aug 14, 2019 by Sirajul
• 59,230 points
Puppet+Docker: How to Update/Remove a docker service?

Related Questions In Puppet

0 votes
1 answer

Puppet+Docker: Restarting docker service via puppet manifest

Try adding this: service { 'docker': ensure ...READ MORE

answered Aug 13, 2019 in Puppet by Sirajul
• 59,230 points
859 views
0 votes
1 answer

Puppet+Docker: How to Update/Remove a docker service?

Update a docker service: To update the service, add ...READ MORE

answered Aug 14, 2019 in Puppet by Sirajul
• 59,230 points
496 views
0 votes
1 answer

Puppet+Docker: How do i configure a swarm if i am using windows server 2016.

There are a few considerations to be ...READ MORE

answered Aug 16, 2019 in Puppet by Sirajul
• 59,230 points
589 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,090 points
2,467 views
0 votes
0 answers
0 votes
1 answer

Managing a NTP service using Puppet

You’ve just  finished installing the puppetlabs-ntp module. The next step ...READ MORE

answered Jul 25, 2019 in Puppet by Sirajul
• 59,230 points
2,122 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP