- GoCD server version
v17.9.0
or above - Docker Swarm Cluster
- Copy the file
build/libs/docker-swarm-elastic-agents-VERSION.jar
to the GoCD server under${GO_SERVER_DIR}/plugins/external
and restart the server. - The
GO_SERVER_DIR
is usually/var/lib/go-server
on Linux andC:\Program Files\Go Server
on Windows.
The plugin settings are used to provide global level configurations for the plugin. Configurations such as docker swarm cluster configuration and private registry settings are provided in plugin settings.
-
Login to
GoCD server
as admin and navigate to Admin > Plugins -
Click on Settings icon of
GoCD Elastic agent plugin for Docker Swarm
to update plugin settings configuration.Field Name Mandatory Description Go server url Yes GoCD server url( https://YOUR_HOST_OR_IP_ADDRESS:8154/go
). The docker elastic agent will use this URL to register itself with GoCD.
The GoCD hostname or ip must resolve in your container. Don't uselocalhost
or127.0.0.1
Environment variables No The environment variable for docker container Agent auto-register timeout Yes Agent auto-register timeout(in minutes). Plugin will kill the agent container if it fails to register within provided time limits Maximum docker containers Yes Maximum docker containers to run at any given point in time. Plugin will not create more container when running container count reached to specified limits Docker URI Yes Docker swarm cluster uri.
If your Go Server is running on local machine then use(for mac and linux) —unix:///var/run/docker.sock
Docker CA Certificate No Docker swarm cluster CA certificate Docker Client Key No Docker swarm cluster client key Docker Client Certificate No Docker swarm cluster client certificate Private Docker Registry Yes Optionally specify the private docker registry settings
The Elastic Agent Profile is used to define the configuration of a docker container(GoCD docker agent). The profile is used to configure the docker image, set memory limits, provide docker command and environment variables etc...
-
Login to
GoCD server
as admin and navigate to Admin > Elastic Agent Profiles -
Click on Add to create new elastic agent profile
Field Name Mandatory Description Id Yes Unique id for current profile Plugin id Yes Select GoCD Docker Swarm Elastic Agents
for Plugin idDocker image Yes GoCD elastic agent docker image name. Pre build GoCD agent docker images are available here Memory soft limit Yes Soft memory limit. Container will start with memory specified here Maximum hard limit Yes Hard memory limit for container Docker Command No Commands that you want to execute on container start.
Note: This will override the existing docker entry-point defined in docker image.Environment Variables No Environment variables for container. This will overrides the environment variables defined in plugin settings.(enter each per line) Secrets No Allows users bind a docker secret with container(enter each per line) Network attachments No Allows user to attach docker networks to container(enter each per line) Volume Mounts No Allows user to mount/bind volume to docker container(enter each per line) Host entries No This allows users to add host entries in /etc/hosts
(enter each per line)Constraints No You can limit the set of nodes where a task can be scheduled by defining constraint expressions.
Multiple constraints find nodes that satisfy every expression (AND match, enter each per line)