instana-agent

by Instana

Helm chartv2.0.55App 2.2.23Verified publisher

Instana Agent for Kubernetes

About this chart

Instana

Instana is an APM solution built for microservices that enables IT Ops to build applications faster and deliver higher quality services by automating monitoring, tracing and root cause analysis. This solution is optimized for Kubernetes.

This chart adds the Instana Agent to all schedulable nodes in your cluster via a privileged DaemonSet and accompanying resources like ConfigurationMaps, Secrets and RBAC settings.

Prerequisites

  • Kubernetes 1.21+ OR OpenShift 4.8+
  • Helm 3

Installation

To configure the installation you can either specify the options on the command line using the --set switch, or you can edit values.yaml.

First, create a namespace for the instana-agent

$ kubectl create namespace instana-agent

OpenShift: When targetting an OpenShift 4.x cluster, ensure proper permission before installing the helm chart, otherwise the agent pods will not be scheduled correctly.

$ oc adm policy add-scc-to-user privileged -z instana-agent
$ oc adm policy add-scc-to-user anyuid -z instana-agent-remote -n instana-agent

To install the chart with the release name instana-agent and set the values on the command line run:

$ helm install instana-agent \
--namespace instana-agent \
--repo https://agents.instana.io/helm \
--set agent.key=INSTANA_AGENT_KEY \
--set agent.endpointHost=HOST \
--set zone.name=ZONE_NAME \
--set cluster.name="CLUSTER_NAME" \
instana-agent

Upgrade

The helm chart deploys a Kubernetes Operator internally that reconciles the agent resources based on an agent CustomResource (CR) that is created based on the helm values. As the Operator pattern requires a CustomResourceDefinition (CRD) to be present in the cluster before defining any CRs, the CRD definition is included in the helm chart. On initial installations the chart deploys the CRD before submitting the rest of the artifacts.

Helm has known limitations around handling the CRD lifecycle as outlined in their documentation.

This leads to the problem, that CRD updates are only submitted to the Cluster on initial installation, but NOT applied automatically during upgrades.

It is also worth noting, that CRDs must be removed manually if the chart should be removed completly, see more details in the uninstall section.

To ensure a proper update, apply the CRD updates before running the upgrade:

helm pull --repo https://agents.instana.io/helm --untar instana-agent; kubectl apply -f instana-agent/crds; helm upgrade instana-agent instana-agent \
  --namespace instana-agent \
  --repo https://agents.instana.io/helm \
  --reuse-values

This is especially important when migrating from helm charts v1 to v2, as the upgrade will fail otherwise as the CR artifact cannot be created.

In case the instana-agent configmap was manually changed (not via helm values), the script convert-agent-configmap-to-custom-values.sh can be used to convert the configmap to a custom-values.yaml file.

# helm v1 chart was installed in the Kubernetes cluster and the configmap was manually changed
# convert the configmap to a custom-values.yaml file
./convert-agent-configmap-to-custom-values.sh

# apply the custom-values.yaml file during the upgrade by specifying `-f custom-values.yaml`

Required Settings

Configuring the Instana Backend

In order to report the data it collects to the Instana backend for analysis, the Instana agent must know which backend to report to, and which credentials to use to authenticate, known as "agent key".

As described by the Install Using the Helm Chart documentation, you will find the right values for the following fields inside Instana itself:

  • agent.endpointHost
  • agent.endpointPort
  • agent.key

Note: You can find the options mentioned in the configuration section below

If your agents report into a self-managed Instana unit (also known as "on-prem"), you will also need to configure a "download key", which allows the agent to fetch its components from the Instana repository. The download key is set via the following value:

  • agent.downloadKey

Zone and Cluster

Instana needs to know how to name your Kubernetes cluster and, optionally, how to group your Instana agents in Custom zones using the following fields:

  • zone.name
  • cluster.name

Either zone.name or cluster.name are required. If you omit cluster.name, the value of zone.name will be used as cluster name as well. If you omit zone.name, the host zone will be automatically determined by the availability zone information provided by the supported Cloud providers.

Uninstallation

To uninstall/delete the instana-agent release:

helm uninstall instana-agent -n instana-agent && kubectl patch agent instana-agent -n instana-agent -p '{"metadata":{"finalizers":null}}' --type=merge &&
kubectl delete crd/agents.instana.io

Configuration Reference

The following table lists the configurable parameters of the Instana chart and their default values.

ParameterDescriptionDefault
agent.configuration_yamlCustom content for the agent configuration.yaml filenil See below for more details
agent.endpointHostInstana Agent backend endpoint hostingress-red-saas.instana.io (US and ROW). If in Europe, please override with ingress-blue-saas.instana.io
agent.endpointPortInstana Agent backend endpoint port443
agent.keyYour Instana Agent keynil You must provide your own key unless agent.keysSecret is specified
agent.downloadKeyYour Instana Download keynil Usually not required
agent.keysSecretAs an alternative to specifying agent.key and, optionally, agent.downloadKey, you can instead specify the name of the secret in the namespace in which you install the Instana agent that carries the agent key and download keynil Usually not required, see Bring your own Keys secret for more details
agent.additionalBackendsList of additional backends to report to; it must specify the endpointHost and key fields, and optionally endpointPort[] Usually not required; see Configuring Additional Backends for more info and examples
agent.tls.secretNameThe name of the secret of type kubernetes.io/tls which contains the TLS relevant data. If the name is provided, agent.tls.certificate and agent.tls.key will be ignored.nil
agent.tls.certificateThe certificate data encoded as base64. Which will be used to create a new secret of type kubernetes.io/tls.nil
agent.tls.keyThe private key data encoded as base64. Which will be used to create a new secret of type kubernetes.io/tls.nil
agent.image.nameThe image name to pullinstana/agent
agent.image.digestThe image digest to pull; if specified, it causes agent.image.tag to be ignorednil
agent.image.tagThe image tag to pull; this property is ignored if agent.image.digest is specifiedlatest
agent.image.pullPolicyImage pull policyAlways
agent.image.pullSecretsImage pull secrets; if not specified (default) and agent.image.name starts with containers.instana.io, it will be automatically set to [{ "name": "containers-instana-io" }] to match the default secret created in this case.

Deploy instana-agent with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has instana-agent 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 chartinstana-agent is pinned at v2.0.55 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