kdebisschop / rundeck-rancher-node-plugin

Manage Rancher-controlled Docker containers in Rundeck
Apache License 2.0
5 stars 0 forks source link
copier node-executor rancher rundeck rundeck-nodes

Rancher Nodes Plugin for Rundeck

This plugin implements Rundeck nodes for Rancher-managed Docker containers.

Requirements

The containers must have bash installed for the Node Executer to work.

Features

Rancher Node Resource

Collects nodes from a Rancher controller host.

Features:

Configuration:

Note:

Note that Rancher uses container ID to construct the URL used to make API requests. When services are upgraded, new containers are created so the API urls used in the node operations cannot work anymore. The container does not exist, so the URL will fail. As long nodes are defined by containers, there is probably no way to avoid this.

The result is that file copies and node executions will not work when performed in the same execution context after an upgrade because the node set is defined in that job context. The Rundeck solution to this issue is to do the upgrade then:

  1. Run a "Refresh Nodes" workflow step
  2. Run the node execute or file copy step as a job reference

Note that refreshing nodes, Rundeck changes the nodes in the global context, but not the running job. So it is essential that the execution is in a job reference and not in the same job context.

Rancher Node Executor

Execute jobs on remote Docker containers managed by the Rancher host.

Features:

Rancher File Copier

Copy files to a node. Can be configured to use Rancher CLI if it is installed and available. Otherwise, assembles files from Base64-encoded parts transmitted via Rancher API.

To distribute to all containers in a stack's service, omit the filter for "seen".

Upgrade Service

Upgrades an existing service. Has required inputs:

Had many optional inputs:

New Stack

Create a new stack. Has two required inputs:

Environment ID most correspond to an existing Rancher environment. Stack name must not exist in that environment.

Add Service

Adds a service to an existing stack. Required inputs:

Optional inputs:

Manage Service

Activate, deactivate, or restart a service.

Road Map

Compatibility

This has been tested with Rundeck 3.1.3 and Rancher 1.6.26.