Skip to content

Latest commit

 

History

History
100 lines (69 loc) · 3.54 KB

install.md

File metadata and controls

100 lines (69 loc) · 3.54 KB

Kubernetes Elastic Agent plugin for GoCD

Requirements

  • GoCD server version v18.2.0 or above
  • Kubernetes Cluster

Installation

Copy the file build/libs/kubernetes-elastic-agent-plugin-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 and C:\Program Files\Go Server on Windows.

Configuration

Configure Plugin Settings

  1. Login to GoCD server as admin and navigate to Admin > Plugins

  2. Click on Settings icon of Kubernetes Elastic Agent Plugin to update plugin settings configuration.

    1. Optionally specify Go Server URL, if GoCD secure site URL is not configured.
    2. Optionally Specify Agent auto-register Timeout, Defaults to 10 mintues.
    3. Optionally Specify Maximum pending pods, Defaults to 10 pods.
    4. Specify Kubernetes Cluster URL.
    5. Optionally Specify Namespace, Defaults to default.
    6. Specify Security token, The token must have permission to do following operations -
      - nodes: list, get
      - events: list, watch
      - namespace: list, get
      - pods, pods/log: *
      
    7. Optionally, Specify Cluster ca certificate data.

    "Kubernetes Plugin settings"

Create an elastic profile

  1. Login to GoCD server as admin and navigate to Admin > Elastic Agent Profiles Elastic Profiles

  2. Click on Add to create new elastic agent profile

    1. Specify id for profile.
    2. Select Kubernetes Elastic Agent Plugin for Plugin id
    3. Configure Kubernetes GoCD elastic agent Pod using:
      • Config Properties

        1. Specify GoCD elastic agent docker image name.
        2. Specify Maximum Memory limit. Container memory will be limit to the value specified here.
        3. Specify Maximum CPU limit. Container memory will be limit to the value specified here.
        4. Optionally specify Environment Variables. These variables are passed to the container for use.

        Create elastic profile using config properties

      • Pod Configuration

        1. Specify GoCD elastic agent Pod Yaml configuration.

        Create elastic profile using pod configuration

    4. Save your profile.

Configure job to use an elastic agent profile

  1. Click the gear icon on Pipeline

Pipeline

  1. Click on Quick Edit button

Quick edit

  1. Click on Stages
  2. Create/Edit a job
  3. Enter the unique id of an elastic profile in Job Settings

Configure a job

  1. Save your changes

Troubleshooting

Enabling debug level logging can help you troubleshoot an issue with the elastic agent plugin. To enable debug level logs, edit the /etc/default/go-server (for Linux) to add:

export GO_SERVER_SYSTEM_PROPERTIES="$GO_SERVER_SYSTEM_PROPERTIES -Dplugin.cd.go.contrib.elasticagent.kubernetes.log.level=debug"

If you're running the server via ./server.sh script —

$ GO_SERVER_SYSTEM_PROPERTIES="-Dplugin.cd.go.contrib.elasticagent.kubernetes.log.level=debug" ./server.sh