Skip to content

Commit 1b3d1f1

Browse files
[9.0](backport #8692) [Helm] support onboarding-id for kubernetes (#8762)
* feat: support onboarding-id for kubernetes (#8692) (cherry picked from commit ce53f33) * chore: update elastic-agent helm chart readme and examples * chore: fix README.md * chore: fix README.md --------- Co-authored-by: Panos Koutsovasilis <[email protected]>
1 parent c2d6096 commit 1b3d1f1

19 files changed

+1290
-4
lines changed

deploy/helm/elastic-agent/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# elastic-agent
77

8-
![Version: 9.0.0-beta](https://img.shields.io/badge/Version-9.0.0--beta-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 9.0.0](https://img.shields.io/badge/AppVersion-9.0.0-informational?style=flat-square)
8+
![Version: 9.0.4-beta](https://img.shields.io/badge/Version-9.0.4--beta-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 9.0.4](https://img.shields.io/badge/AppVersion-9.0.4-informational?style=flat-square)
99

1010
Elastic-Agent Helm Chart
1111

@@ -63,6 +63,7 @@ The chart built-in [kubernetes integration](https://docs.elastic.co/integrations
6363
| Key | Type | Default | Description |
6464
|-----|------|---------|-------------|
6565
| kubernetes.enabled | bool | `true` | enable Kubernetes integration. |
66+
| kubernetes.onboardingID | string | `""` | Specify the onboarding ID for a quick start flow. |
6667
| kubernetes.output | string | `"default"` | name of the output used in kubernetes integration. Note that this output needs to be defined in [outputs](#1-outputs) |
6768
| kubernetes.namespace | string | `"default"` | kubernetes namespace |
6869
| kubernetes.hints.enabled | bool | `false` | enable [elastic-agent autodiscovery](https://www.elastic.co/guide/en/fleet/current/elastic-agent-kubernetes-autodiscovery.html) feature |
@@ -145,8 +146,8 @@ The chart built-in [kubernetes integration](https://docs.elastic.co/integrations
145146
### 6 - Elastic-Agent Configuration
146147
| Key | Type | Default | Description |
147148
|-----|------|---------|-------------|
148-
| agent.version | string | `"9.0.0"` | elastic-agent version |
149-
| agent.image | object | `{"pullPolicy":"IfNotPresent","repository":"docker.elastic.co/elastic-agent/elastic-agent","tag":"9.0.0-SNAPSHOT"}` | image configuration |
149+
| agent.version | string | `"9.0.4"` | elastic-agent version |
150+
| agent.image | object | `{"pullPolicy":"IfNotPresent","repository":"docker.elastic.co/elastic-agent/elastic-agent","tag":"9.0.4-SNAPSHOT"}` | image configuration |
150151
| agent.imagePullSecrets | list | `[]` | image pull secrets |
151152
| agent.engine | string | `"k8s"` | generate kubernetes manifests or [ECK](https://github.com/elastic/cloud-on-k8s) CRDs |
152153
| agent.unprivileged | bool | `false` | enable unprivileged mode |
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Example: Kubernetes Integration with default chart values and onboarding-id
2+
3+
In this example we install the built-in `kubernetes` integration with the default built-in values and an onboarding-id for quick-start flows .
4+
5+
## Prerequisites:
6+
1. Build the dependencies of the Helm chart
7+
```console
8+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
9+
helm dependency build ../../
10+
```
11+
2. A k8s secret that contains the connection details to an Elasticsearch cluster such as the URL and the API key ([Kibana - Creating API Keys](https://www.elastic.co/guide/en/kibana/current/api-keys.html)):
12+
```console
13+
kubectl create secret generic es-api-secret \
14+
--from-literal=api_key=... \
15+
--from-literal=url=...
16+
```
17+
18+
3. `kubernetes` integration assets installed through Kibana ([Kibana - Install and uninstall Elastic Agent integration assets](https://www.elastic.co/guide/en/fleet/current/install-uninstall-integration-assets.html))
19+
20+
## Run:
21+
22+
#### Public image registry:
23+
```console
24+
helm install elastic-agent ../../ \
25+
--set kubernetes.onboardingID: "my-onboarding-id"
26+
--set kubernetes.enabled: true \
27+
--set agent.unprivileged: true \
28+
--set outputs.default.type=ESSecretAuthAPI \
29+
--set outputs.default.secretName=es-api-secret
30+
```
31+
32+
33+
#### Private image registry:
34+
Create secret with the contents of docker auth config
35+
```
36+
kubectl create secret generic regcred --from-file=.dockerconfigjson=<your home folder here>/.docker/config.json --type=kubernetes.io/dockerconfigjson
37+
```
38+
39+
Install elastic-agent
40+
```console
41+
helm install elastic-agent ../../ \
42+
--set kubernetes.onboardingID: "my-onboarding-id"
43+
--set kubernetes.enabled: true \
44+
--set agent.unprivileged: true \
45+
--set 'agent.imagePullSecrets[0].name=regcred' \
46+
--set outputs.default.type=ESSecretAuthAPI \
47+
--set outputs.default.secretName=es-api-secret
48+
```
49+
50+
## Validate:
51+
52+
1. `kube-state metrics` is installed with this command `kubectl get deployments -n kube-system kube-state-metrics`.
53+
2. The Kibana `kubernetes`-related dashboards should start showing up the respective info.
54+
55+
## Note:
56+
57+
1. If you want to disable kube-state-metrics installation with the elastic-agent Helm chart, you can set `kube-state-metrics.enabled=false` in the Helm chart. The helm chart will use the value of `kubernetes.state.host` to configure the elastic-agent input.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kubernetes:
2+
onboardingID: "my-onboarding-id"
3+
enabled: true
4+
5+
agent:
6+
unprivileged: true

0 commit comments

Comments
 (0)