From 403ddfa28851e595529e82a87cc2e811c045e295 Mon Sep 17 00:00:00 2001 From: Will James Date: Tue, 28 May 2019 15:54:58 -0500 Subject: [PATCH] [stable/instana-agent] Add Kubernetes cluster name configuration parameter (#13727) * Add Kubernetes cluster name configuration parameter Signed-off-by: Will James * Add more documentation and update notes for cluster name configuration parameter Signed-off-by: Will James * Bump version Signed-off-by: Will James * Fix linting issues Signed-off-by: Will James * Improve documentation around why zone.name vs cluster.name Signed-off-by: Will James --- stable/instana-agent/Chart.yaml | 2 +- stable/instana-agent/README.md | 64 ++++++++++--------- stable/instana-agent/templates/NOTES.txt | 47 +++++++++----- stable/instana-agent/templates/daemonset.yaml | 4 +- stable/instana-agent/values.yaml | 6 +- 5 files changed, 75 insertions(+), 48 deletions(-) diff --git a/stable/instana-agent/Chart.yaml b/stable/instana-agent/Chart.yaml index 6ee1a7b4ce..16ebfe2b8e 100644 --- a/stable/instana-agent/Chart.yaml +++ b/stable/instana-agent/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: instana-agent -version: 1.0.8 +version: 1.0.9 appVersion: 1.0 description: Instana Agent for Kubernetes home: https://www.instana.com/ diff --git a/stable/instana-agent/README.md b/stable/instana-agent/README.md index 2c3d886014..a7c3fe8ca7 100644 --- a/stable/instana-agent/README.md +++ b/stable/instana-agent/README.md @@ -19,7 +19,9 @@ _Note:_ Tiller may need a service account and role binding if RBAC is enabled in To configure the installation you can either specify the options on the command line using the **--set** switch, or you can edit **values.yaml**. Either way you should ensure that you set values for: * agent.key -* zone.name +* zone.name or cluster.name + +For most users, setting the `zone.name` is sufficient. However, if you would like to be able group your hosts based on the availability zone rather than cluster name, then you can specify the cluster name using the `cluster.name` instead of the `zone.name` setting. If you omit the `zone.name` the host zone will be automatically determined by the availability zone information on the host. If you're in the EU, you'll probably also want to set the regional equivalent values for: @@ -56,7 +58,8 @@ $ helm install --name instana-agent --namespace instana-agent \ --set agent.key=INSTANA_AGENT_KEY \ --set agent.endpointHost=HOST \ --set agent.endpointPort=PORT \ ---set zone.name=CLUSTER_NAME \ +--set zone.name=ZONE_NAME \ +--set cluster.name=CLUSTER_NAME \ --set agent.downloadKey=INSTANA_DOWNLOAD_KEY \ --set agent.proxyHost=INSTANA_AGENT_PROXY_HOST \ --set agent.proxyPort=INSTANA_AGENT_PROXY_PORT \ @@ -88,34 +91,35 @@ $ helm del --purge instana-agent The following table lists the configurable parameters of the Instana chart and their default values. -| Parameter | Description | Default | -|------------------------------------|-------------------------------------------------------------------------|----------------------------------------------| -| `agent.key` | Your Instana Agent key | `nil` You must provide your own key | -| `zone.name` | Instana zone/cluster name | `nil` You must provide your own zone name | -| `agent.image.name` | The image name to pull | `instana/agent` | -| `agent.image.tag` | The image tag to pull | `1.0.17` | -| `agent.image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `agent.leaderElectorPort` | Instana leader elector sidecar port | `42655` | -| `agent.endpointHost` | Instana agent backend endpoint host | `saas-us-west-2.instana.io` | -| `agent.endpointPort` | Instana agent backend endpoint port | `443` | -| `agent.downloadKey` | Your Instana Download key | `nil` You must provide your own download key | -| `agent.mode` | Agent mode (Supported values are APM, INFRASTRUCTURE, AWS) | `APM` | -| `agent.pod.annotations` | Additional annotations to apply to the pod | `{}` | -| `agent.pod.tolerations` | Tolerations for pod assignment | `[]` | -| `agent.pod.proxyHost` | Hostname/address of a proxy | `nil` | -| `agent.pod.proxyPort` | Port of a proxy | `nil` | -| `agent.pod.proxyProtocol` | Proxy protocol (Supported proxy types are "http", "socks4", "socks5") | `nil` | -| `agent.pod.proxyUser` | Username of the proxy auth | `nil` | -| `agent.pod.proxyPassword` | Password of the proxy auth | `nil` | -| `agent.pod.proxyUseDNS` | Boolean if proxy also does DNS | `nil` | -| `agent.listenAddress` | List of addresses to listen on, or "*" for all interfaces | `nil` | -| `agent.pod.requests.memory` | Container memory requests in MiB | `512` | -| `agent.pod.requests.cpu` | Container cpu requests in cpu cores | `0.5` | -| `agent.pod.limits.memory` | Container memory limits in MiB | `512` | -| `agent.pod.limits.cpu` | Container cpu limits in cpu cores | `1.5` | -| `rbac.create` | Whether RBAC resources should be created | `true` | -| `serviceAccount.create` | Whether a ServiceAccount should be created | `true` | -| `serviceAccount.name` | Name of the ServiceAccount to use | `instana-agent` | +| Parameter | Description | Default | +|------------------------------------|-------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------| +| `agent.key` | Your Instana Agent key | `nil` You must provide your own key | +| `zone.name` | Zone that detected technologies will be assigned to | `nil` You must provide either `zone.name` or `cluster.name`, see [above](#installing-the-chart) for details | +| `cluster.name` | Display name of the monitored cluster | Value of `zone.name` | +| `agent.image.name` | The image name to pull | `instana/agent` | +| `agent.image.tag` | The image tag to pull | `1.0.17` | +| `agent.image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `agent.leaderElectorPort` | Instana leader elector sidecar port | `42655` | +| `agent.endpointHost` | Instana agent backend endpoint host | `saas-us-west-2.instana.io` | +| `agent.endpointPort` | Instana agent backend endpoint port | `443` | +| `agent.downloadKey` | Your Instana Download key | `nil` You must provide your own download key | +| `agent.mode` | Agent mode (Supported values are APM, INFRASTRUCTURE, AWS) | `APM` | +| `agent.pod.annotations` | Additional annotations to apply to the pod | `{}` | +| `agent.pod.tolerations` | Tolerations for pod assignment | `[]` | +| `agent.pod.proxyHost` | Hostname/address of a proxy | `nil` | +| `agent.pod.proxyPort` | Port of a proxy | `nil` | +| `agent.pod.proxyProtocol` | Proxy protocol (Supported proxy types are "http", "socks4", "socks5") | `nil` | +| `agent.pod.proxyUser` | Username of the proxy auth | `nil` | +| `agent.pod.proxyPassword` | Password of the proxy auth | `nil` | +| `agent.pod.proxyUseDNS` | Boolean if proxy also does DNS | `nil` | +| `agent.listenAddress` | List of addresses to listen on, or "*" for all interfaces | `nil` | +| `agent.pod.requests.memory` | Container memory requests in MiB | `512` | +| `agent.pod.requests.cpu` | Container cpu requests in cpu cores | `0.5` | +| `agent.pod.limits.memory` | Container memory limits in MiB | `512` | +| `agent.pod.limits.cpu` | Container cpu limits in cpu cores | `1.5` | +| `rbac.create` | Whether RBAC resources should be created | `true` | +| `serviceAccount.create` | Whether a ServiceAccount should be created | `true` | +| `serviceAccount.name` | Name of the ServiceAccount to use | `instana-agent` | ### Agent diff --git a/stable/instana-agent/templates/NOTES.txt b/stable/instana-agent/templates/NOTES.txt index 3f80a63c46..a68b15cc69 100644 --- a/stable/instana-agent/templates/NOTES.txt +++ b/stable/instana-agent/templates/NOTES.txt @@ -1,29 +1,46 @@ -{{- if (and (not .Values.agent.key) (not .Values.zone.name)) }} +{{- if (and (not .Values.agent.key) (and (not .Values.zone.name) (not .Values.cluster.name))) }} ############################################################################## #### ERROR: You did not specify your secret agent key. #### -#### ERROR: You also did not specify a zone name for this cluster. #### +#### ERROR: You also did not specify a zone or name for this cluster. #### ############################################################################## -This agent deployment will be incomplete until you set your agent key and zone name for this cluster: +This agent deployment will be incomplete until you set your agent key and zone or name for this cluster: helm upgrade {{ .Release.Name }} --reuse-values \ --set agent.key=$(YOUR_SECRET_AGENT_KEY) \ - --set zone.name=$(YOUR_CLUSTER_NAME) stable/instana-agent + --set zone.name=$(YOUR_ZONE_NAME) stable/instana-agent -- YOUR_SECRET_AGENT_KEY can be obtained from the Management Portal section of your Instana installation. -- YOUR_CLUSTER_NAME should be a name that uniquely identifies this cluster. - -{{- else if not .Values.zone.name }} -############################################################################## -#### ERROR: You did not specify a zone name for this cluster. #### -############################################################################## - -This agent deployment will be incomplete until you set a zone name for this cluster: +Alternatively, you may specify a cluster name and the zone will be detected from availability zone information on the host: helm upgrade {{ .Release.Name }} --reuse-values \ - --set zone.name=$(YOUR_CLUSTER_NAME) stable/instana-agent + --set agent.key=$(YOUR_SECRET_AGENT_KEY) \ + --set cluster.name=$(YOUR_CLUSTER_NAME) stable/instana-agent -- YOUR_CLUSTER_NAME should be a name that uniquely identifies this cluster. +- YOUR_SECRET_AGENT_KEY can be obtained from the Management Portal section of your Instana installation. +- YOUR_ZONE_NAME should be the zone that detected technologies will be assigned to. +- YOUR_CLUSTER_NAME should be the custom name of your cluster. + +At least one of zone.name or cluster.name is required. This cluster will be reported with the name of the zone unless you specify a cluster name. + +{{- else if (and (not .Values.zone.name) (not .Values.cluster.name)) }} +############################################################################## +#### ERROR: You did not specify a zone or name for this cluster. #### +############################################################################## + +This agent deployment will be incomplete until you set a zone for this cluster: + + helm upgrade {{ .Release.Name }} --reuse-values \ + --set zone.name=$(YOUR_ZONE_NAME) stable/instana-agent + +Alternatively, you may specify a cluster name and the zone will be detected from availability zone information on the host: + + helm upgrade {{ .Release.Name }} --reuse-values \ + --set cluster.name=$(YOUR_CLUSTER_NAME) stable/instana-agent + +- YOUR_ZONE_NAME should be the zone that detected technologies will be assigned to. +- YOUR_CLUSTER_NAME should be the custom name of your cluster. + +At least one of zone.name or cluster.name is required. This cluster will be reported with the name of the zone unless you specify a cluster name. {{- else if not .Values.agent.key }} ############################################################################## diff --git a/stable/instana-agent/templates/daemonset.yaml b/stable/instana-agent/templates/daemonset.yaml index 42067e07f6..f9b7d5bdcc 100644 --- a/stable/instana-agent/templates/daemonset.yaml +++ b/stable/instana-agent/templates/daemonset.yaml @@ -1,5 +1,5 @@ {{- if .Values.agent.key -}} -{{- if .Values.zone.name -}} +{{- if or .Values.zone.name .Values.cluster.name -}} apiVersion: apps/v1beta2 kind: DaemonSet metadata: @@ -32,6 +32,8 @@ spec: value: {{ .Values.agent.leaderElectorPort | quote }} - name: INSTANA_ZONE value: {{ .Values.zone.name | quote }} + - name: INSTANA_KUBERNETES_CLUSTER_NAME + value: {{ .Values.cluster.name | quote }} - name: INSTANA_AGENT_ENDPOINT value: {{ .Values.agent.endpointHost | quote }} - name: INSTANA_AGENT_ENDPOINT_PORT diff --git a/stable/instana-agent/values.yaml b/stable/instana-agent/values.yaml index 172df96e43..b7d62fb7a7 100644 --- a/stable/instana-agent/values.yaml +++ b/stable/instana-agent/values.yaml @@ -2,7 +2,7 @@ # name: instana-agent zone: - # zone.name is the uniquely-identifiable name by which your cluster will be known inside Instana. + # zone.name is the custom zone that detected technologies will be assigned to name: null agent: @@ -72,3 +72,7 @@ serviceAccount: # The name of the ServiceAccount to use. # If not set and create is true, a name is generated using the fullname template # name: instana-agent + +cluster: + # cluster.name represents the name that will be assigned to this cluster in Instana + name: null