agent-k8s-test

by Armory

Helm chartv0.7.0-snapshot.feat.automate.helm.release.054c6e3App 0.7.0-snapshot.feat.automate.helm.release.054c6e3

An easy way to install armory's agent for kubernetes

About this chart

Helm Chart for kubernetes agent

Built with Helm v3.6.3

The main intention with this project is to provide an easy way of installing armory's Agent for Kubernetes

Features

  • Allows to easily deploy armory's agent for kubernetes with a single command
  • Allows to customize the agent settings passing a custom file

Requirements

  • possibly helm v3.6.3 (haven't tested with anything prior)
  • An existing kubernetes cluster and a namespace in case you don't want to use 'default'
  • A kubeconfig file in case the agent is set to run in 'infrastructure' mode

Usage

  • helm install release-name path-of-the-chart --namespace=your-namespace
  • helm unisntall release-name --namespace=your-namespace

The release name is used across some of the kubernetes resources that get created, you can also add --set imagePullSecrets=something to use docker registry credentials

Quick Installation

Note: you can also replace helm install by helm template in the below commands to get an output of the kubernetes manifests that are rendered e.g: helm template armory-agent ...

Create a namespace where the agent will be installed:

kubectl create namespace dev

With the selected AWS profile that has access to the target cluster Create a kubeconfig file

Note: skip this in case the agent is set to run in 'agent' mode

aws eks update-kubeconfig --name <target_cluster> 

Agent mode:

From the root of the chart project:

helm install armory-agent . --set mode=agent,clientId=<your-clientId>,secret=<your/secret> --namespace=dev

Infrastructure mode

helm install armory-agent . --set-file kubeconfig=$HOME/develop/config --set accountName=<your-accountName>,clientId=<your-clientId>,secret=<your/secret> --namespace=dev

Note: if cloudEnabled is set to false there is no need to provide clientId and secret but you need to set clouddriver's grpc host in grpcUrl such as --set grpcUrl= localhost:9090

Custom settings installation

You can also install using your own agent settings file if you would like greater flexibility:

helm template armory-agent . --set-file kubeconfig=$HOME/develop/config,agentyml=/Users/armory/.spinnaker/agent-local-hub.yml --namespace=dev

Note: make sure that your kubeconfigFile in your settings file matches the kubeconfig set in the 'kubeconfig' variable if not running with serviceAccount: true

This chart also supports passing of settings using helm variables present in the values.yml

OptionDefault
grpcUrlagents.cloud.armory.io:443
clientIdnull
secretnull
cloudEnabledtrue
kubernetesrefer to Kubernetes specific options in armory.io

GitHub Actions

Create Helm Package After Agent Release

This workflow is exposed by GitHub API, and it basically creates and publish the agent-k8s component into a helm package.

It was meant to be use by armory-io/agent-k8s workflow when there is a new release of it, but we always can trigger it by calling the GitHub API.

Calling GitHub API using curl command:

    curl -X POST \
        -H "Accept: application/vnd.github.v3+json" \
        -H "Authorization: token {GIT_HUB_TOKEN}" \
        https://api.github.com/repos/{REPOSITORY_OWNER}/{REPOSITORY_NAME}/dispatches \
        -d '{"event_type":"agentRelease", "client_payload":{"version":"{AGENT_VERSION}"}}'

License

© 2021 Armory Inc. All rights reserved.

Deploy agent-k8s-test with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has agent-k8s-test on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartagent-k8s-test is pinned at v0.7.0-snapshot.feat.automate.helm.release.054c6e3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply