Skip to content

Commit 90ec472

Browse files
feat: support onboarding-id for kubernetes (#8692) (#8763)
(cherry picked from commit ce53f33) Co-authored-by: Panos Koutsovasilis <[email protected]>
1 parent 055ed24 commit 90ec472

19 files changed

+1287
-1
lines changed

deploy/helm/elastic-agent/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 |
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)