You are viewing version 2.22 of the documentation, which is no longer maintained. For up-to-date documentation, see the latest version.

Armory Agent for Kubernetes Quick Start Installation

Install quickly using this guide.

This guide is for experienced Kubernetes and Spinnaker users.

Compatibility matrix

MySQL storage for Clouddriver is required for the Agent.

The Armory Agent is compatible with the Armory Platform and open source Spinnaker. It consists of a lightweight service that you deploy on Kubernetes and a plugin that you install into Spinnaker.

Armory (Spinnaker) Version Armory Agent Plugin Version Armory Agent Version
2.19.x (1.19.x) 0.2.3 0.2.0
2.20.x (1.20.x) 0.3.13 0.2.0
2.21.x (1.21.x) 0.4.8 0.2.0
2.22.x (1.22.x) 0.5.0-rc.15 0.2.0

The Agent consists of a service deployed as a Kubernetes Deployment and a plugin to Spinnaker’s Clouddriver service. Be sure to check out the architecture.

Step 1: Agent plugin installation

You modify the current Clouddriver deployment as well as add a new Kubernetes Service.

The easiest installation path is to modify an existing spinnakerservice.yaml with kustomize. To start, download additional manifests into the directory with your SpinnakerService:

# AGENT_PLUGIN_VERSION is found in the compatibility matrix above
curl https://armory.jfrog.io/artifactory/manifests/kubesvc-plugin/agent-plugin-$AGENT_PLUGIN_VERSION.tar.gz | tar -xJvf -

Then include the manifests in your current kustomization:

# Existing kustomization.yaml
namespace: spinnaker  #   could be different
resources:
  # Pre-existing SpinnakerService resource (may have a different name)
  - spinnakerservice.yaml

bases:
  # Add the agent service
  - agent-service

patchesStrategicMerge:
  # Include plugin configuration
  - agent-plugin/config.yaml
  # Change plugin version as well the name of your SpinnakerService in this manifest
  - agent-plugin/clouddriver-plugin.yaml
  # Alternatively you can include this remote manifest
#  - https://armory.jfrog.io/artifactory/manifests/kubesvc-plugin/clouddriver-plugin-<AGENT_PLUGIN_VERSION>.yaml

You can then set the plugin options in agent-plugin/config.yaml.

  • For topologies like Infrastructure mode and Agent mode, in which the Agent is installed in a different cluster from Spinnaker, you should configure TLS through a load balancer.

  • For Spinnaker installations with one Clouddriver instance and no Redis, you can use kubesvc.cluster. However, a Spinnaker installation with Redis is recommended.

  • When running Spinnaker in HA, make sure to modify the following files:

    • agent-service/kustomization.yaml according to its comments
    • agent-plugin/clouddriver-plugin.yaml and agent-plugin/config.yaml references to Clouddriver should be to HA versions (i.e: -rw, -ro, etc)

When you’re ready, deploy with:

kustomize build . | kubectl apply -f -

Note:

  • If you gave SpinnakerService a name other than spinnaker, you will need to change it in files under agent-plugin.
  • If you are using the Agent on an OSS installation, use the following download URL https://armory.jfrog.io/artifactory/manifests/kubesvc-plugin/agent-oss-plugin-${AGENT_PLUGIN_VERSION}-tar.gz or replace the apiVersion with spinnaker.io/v1alpha2.

Alternate methods

If you are not using kustomize, you can still use the same manifests.

  • Deploy agent-service/clouddriver-grpc-service.yaml or agent-service/clouddriver-ha-grpc-service.yaml if using Clouddriver “HA” (caching, rw, ro).
  • Merge agent-plugin/config.yaml and agent-plugin/clouddriver-plugin.yaml into your existing SpinnakerService.

Step 2: Agent installation

Kustomize

Create the directory structure described below with kustomization.yaml, kubesvc.yaml, and kubecfg/ containing the kubeconfig files required to access target deployment clusters:

.
├── kustomization.yaml
├── kubesvc.yaml
├── kubecfgs/
│   ├── kubecfg-01.yaml
│   ├── kubecfg-02.yaml
│   ├── ...
│   └── kubecfg-nn.yaml
# ./kustomization.yaml

# Namespace where you want to deploy the agent
namespace: spinnaker
bases:
  - https://armory.jfrog.io/artifactory/manifests/kubesvc/armory-agent-0.2.0-kustomize.tar.gz

configMapGenerator:
  - name: kubesvc-config
    behavior: merge
    files:
      - kubesvc.yaml

secretGenerator:
  - name: kubeconfigs-secret
    files:
    # a list of all needed kubeconfigs
    - kubecfgs/kubecfg-account01.yaml
    - ...
    - kubecfgs/kubecfg-account1000.yaml

kubesvc.yaml contains the Agent options:

# ./kubesvc.yaml

kubernetes:
  accounts:
  - name: account01
    # /kubeconfigfiles/ is the path to the config files
    # as mounted from the `kubeconfigs-secret` Kubernetes secret
    kubeconfigFile: /kubeconfigfiles/kubecfg-account01.yaml
    ...
  - ...
...
  • For installations without gRPC TLS connections, you should include clouddriver.insecure: true in the Agent options.
  • For HA, make sure to set clouddriver.grpc: clouddriver-ha-grpc-service.yaml:9091

With the directory structure in place, deploy the Agent service:

kustomize build </path/to/directory> | kubectl apply -f -

Managing kustomization locally

If you prefer to manage manifests directly, download all the manifests:

AGENT_VERSION=0.2.0 && curl -s https://armory.jfrog.io/artifactory/manifests/kubesvc/armory-agent-$AGENT_VERSION-kustomize.tar.gz | tar -xJvf -
  • Change the version of the Agent in kustomization.yaml
  • Modify Agent options in kubesvc.yaml

Troubleshooting

Check out the troubleshooting page if you run into issues.

Monitoring

The Agent should only consume about 4 MB of memory and a small amount of CPU. See the Monitoring page for how to monitor agents running on an Armory platform.


Last modified November 3, 2020: fix broken links L56 (#294) (d334822)