Skip to content

Commit 0470094

Browse files
committed
Update docker documentation for agent containers
* Specifies how to start a container so it can use the PE stack.
1 parent 2444141 commit 0470094

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Plans:
1717
* [Provision](documentation/provision.md)
1818
* [Upgrade](documentation/upgrade.md)
1919
* [Convert](documentation/convert.md)
20+
* [Status](documentation/status.md)
2021

2122
Reference:
2223

Diff for: documentation/docker_examples.md

+48
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,54 @@ This will run an interactive bash shell in the running container.
6969
### Upgrades
7070
There is also a upgrade.sh script that is similar to the provision.sh script. This script will upgrade an already provisioned PE stack to the version specified in the update_params.json file.
7171
72+
## Attaching agent containers
73+
Because we are using containers we can start up numerous container instances and attach them all to the same PE stack. In a matter of minutes you can easily attach hunders of new nodes to the PE stack (if resources allow). This is very useful for testing out scenarios involving different puppet versions or operating systems and even features like the orchestrator.
74+
75+
To attach a container to the PE stack you first must get the network name of the PE stack. This can be done with a command like: `docker inspect pe-xl-core-0.puppet.vm`. You need to use either the container id or the container name of the MoM when inspecting.
76+
77+
The network name we want to grab is 'extra-large-ha_default'. (Yours will be different, but the output will be similar)
78+
79+
```shell
80+
docker inspect pe-xl-core-0.puppet.vm -f "{{json .NetworkSettings.Networks }}" | jq
81+
{
82+
"extra-large-ha_default": {
83+
"IPAMConfig": null,
84+
"Links": null,
85+
"Aliases": [
86+
"pe_xl_core_0",
87+
"5cf7047a36cd"
88+
],
89+
"NetworkID": "204ae562a25510b2425f9fe3f1599c487e40dbcaaaaf02c2f73f6fa81f45d674",
90+
"EndpointID": "d91d7060fcc623a9f16cea09eecf83e9ee4454252e1af34053ef090f9c01c9c3",
91+
"Gateway": "172.25.0.1",
92+
"IPAddress": "172.25.0.6",
93+
"IPPrefixLen": 16,
94+
"IPv6Gateway": "",
95+
"GlobalIPv6Address": "",
96+
"GlobalIPv6PrefixLen": 0,
97+
"MacAddress": "02:42:ac:19:00:06",
98+
"DriverOpts": null
99+
}
100+
}
101+
```
102+
103+
**NOTE** In these example you may see the use of `jq`. This is a [cli utility for parsing JSON](https://stedolan.github.io/jq/). I recommend installing it. As a alternative you can pipe output to `python -m json.tool`.
104+
105+
### Starting agent containers
106+
Once you have the network name you only need to specify the network when starting a container. Puppet [publishes container images](https://hub.docker.com/r/puppet/puppet-agent) for all version of the puppet agent. So you can easily switch agent versions with a single command. Which container image you use is entirely up to you. If it doesn't have puppet preinstalled you can use the special curl command from the PE console to install it.
107+
108+
Example:
109+
`docker run -ti --network=extra-large-ha_default --entrypoint=/bin/bash puppet/puppet-agent:latest`
110+
`docker run -ti --network=extra-large-ha_default --entrypoint=/bin/bash puppet/puppet-agent:6.15.0`
111+
`docker run -ti --network=extra-large-ha_default --entrypoint=/bin/bash puppet/puppet-agent:6.3.0`
112+
`docker run -ti --network=extra-large-ha_default --entrypoint=/bin/bash ruby:latest`
113+
114+
For most tasks these images are great. However, if you wish to use puppet orchestrator with the pcp transport. The one requirement is that all images used must be systemd aware, otherwise pxp will not start. If you do not plan on using pcp
115+
there is no need for containers with systemd.
116+
117+
At this time we have not added documention for starting a container with systemd. Instructions coming soon.
118+
119+
72120
### Other notes
73121
1. The provision plan is not fully idempotent.
74122
2. Some tasks may fail when run due to resource constraints.

0 commit comments

Comments
 (0)