-
Notifications
You must be signed in to change notification settings - Fork 172
Update docs for agent managed by fleet on kubernetes #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MichaelKatsoulis
merged 7 commits into
elastic:master
from
MichaelKatsoulis:add-docs-for-managed-agent-on-k8s
Jul 13, 2021
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bc4b0bc
Update docs for agent managed by fleet on kubernetes
MichaelKatsoulis eabf932
Update docs/en/ingest-management/elastic-agent/running-on-kubernetes-…
MichaelKatsoulis 1e2d65a
Update docs/en/ingest-management/elastic-agent/running-on-kubernetes-…
MichaelKatsoulis 9fc998c
Update docs/en/ingest-management/elastic-agent/running-on-kubernetes-…
MichaelKatsoulis 1e037e0
Update docs/en/ingest-management/elastic-agent/running-on-kubernetes-…
MichaelKatsoulis b454604
Update docs/en/ingest-management/elastic-agent/running-on-kubernetes-…
MichaelKatsoulis 4ca3a35
Update docs/en/ingest-management/elastic-agent/running-on-kubernetes-…
MichaelKatsoulis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
152 changes: 152 additions & 0 deletions
152
...ingest-management/elastic-agent/running-on-kubernetes-managed-by-fleet.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| [[running-on-kubernetes-managed-by-fleet]] | ||
| [role="xpack"] | ||
| = Run {agent} on Kubernetes managed by {fleet} | ||
|
|
||
| Use {agent} https://www.docker.elastic.co/r/beats/elastic-agent[Docker images] on Kubernetes to | ||
| retrieve cluster metrics. | ||
|
|
||
| ifeval::["{release-state}"=="unreleased"] | ||
|
|
||
| However, version {version} of {agent} has not yet been | ||
| released, so no Docker image is currently available for this version. | ||
|
|
||
| endif::[] | ||
|
|
||
|
|
||
| [discrete] | ||
| == Kubernetes deploy manifests | ||
|
|
||
| With {fleet}, each agent enrols at a policy defined in {kib} and stored in | ||
| {es}. The policy specifies how to collect observability data from the services | ||
| to be monitored. The {agent} connects to a trusted {fleet-server} instance | ||
| to retrieve the policy and report agent events. | ||
|
|
||
| We recommend using {fleet} management because it makes the management and | ||
| upgrade of agents considerably easier. | ||
|
|
||
| On Kubernetes, deploy {agent} as a https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/[DaemonSet] | ||
| to ensure that there is a running instance on each node of the cluster. | ||
| These instances are used to retrieve metrics from the host, such as system metrics, container stats, | ||
| and metrics from all the services running on top of Kubernetes. | ||
|
|
||
| In addition, one of the Pods in the DaemonSet will constantly hold a _leader lock_ which makes it responsible for | ||
| handling cluster-wide monitoring. | ||
| Find more information about leader election configuration options at <<kubernetes_leaderelection-provider, leader election provider>>. | ||
| This instance is used to retrieve metrics that are unique for the whole | ||
| cluster, such as Kubernetes events or | ||
| https://github.com/kubernetes/kube-state-metrics[kube-state-metrics]. | ||
|
|
||
|
|
||
| Everything is deployed under the `kube-system` namespace by default. To change | ||
| the namespace, modify the manifest file. | ||
|
|
||
| To download the manifest file, run: | ||
|
|
||
| ["source", "sh", subs="attributes"] | ||
| ------------------------------------------------ | ||
| curl -L -O https://raw.githubusercontent.com/elastic/beats/{branch}/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml | ||
| ------------------------------------------------ | ||
|
|
||
| [discrete] | ||
| == Settings | ||
|
|
||
| {agent} is enrolled to a running {fleet-server} using `FLEET_URL` parameter. | ||
| The `FLEET_ENROLLMENT_TOKEN` parameter is used to connect {agent} to a | ||
| specific {agent} policy. | ||
| Learn more on how to get an enrollment token from {fleet} in the {fleet-guide}/fleet-quick-start.html[Quick start | ||
| guide]. | ||
|
|
||
| If `FLEET_ENROLLMENT_TOKEN` is empty then agent will connect to {kib} and get the default policy. | ||
| In that case `KIBANA_HOST`, `KIBANA_FLEET_USERNAME`, `KIBANA_FLEET_PASSWORD` have to be specified. | ||
|
|
||
| To specify different destination/credentials, | ||
| change the following parameters in the manifest file: | ||
|
|
||
| [source,yaml] | ||
| ------------------------------------------------ | ||
| - name: FLEET_URL | ||
| value: "https://fleet-server_url:port" | ||
| - name: FLEET_ENROLLMENT_TOKEN | ||
| value: "token" | ||
| - name: KIBANA_HOST | ||
| value: "" | ||
| - name: KIBANA_FLEET_USERNAME | ||
| value: "" | ||
| - name: KIBANA_FLEET_PASSWORD | ||
| value: "" | ||
| ------------------------------------------------ | ||
|
|
||
| // Begin collapsed section | ||
| [%collapsible] | ||
| .Configuration details | ||
| ==== | ||
| **** | ||
|
|
||
| [cols="2*<a"] | ||
| |=== | ||
| | Settings | Description | ||
|
|
||
| include::configuration/env/shared-env.asciidoc[tag=fleet-url] | ||
|
|
||
| include::configuration/env/shared-env.asciidoc[tag=fleet-enrollment-token] | ||
|
|
||
| include::configuration/env/shared-env.asciidoc[tag=kibana-host] | ||
|
|
||
| include::configuration/env/shared-env.asciidoc[tag=kibana-fleet-username] | ||
|
|
||
| include::configuration/env/shared-env.asciidoc[tag=kibana-fleet-password] | ||
| |=== | ||
|
|
||
| See <<agent-environment-variables>> for all available options. | ||
|
|
||
| **** | ||
| ==== | ||
|
|
||
| [discrete] | ||
| === Run {agent} on master nodes | ||
|
|
||
| Kubernetes master nodes can use https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/[taints] | ||
| to limit the workloads that can run on them. The manifest for managed {agent} defines | ||
| tolerations to run on master nodes. Agents running on master nodes collect metrics from the control plane | ||
| components (scheduler, controller manager) of Kuberentes. | ||
|
MichaelKatsoulis marked this conversation as resolved.
Outdated
|
||
| To disable {agent} from running on master nodes, remove the following part of the Daemonset spec: | ||
|
|
||
| [source,yaml] | ||
| ------------------------------------------------ | ||
| spec: | ||
| tolerations: | ||
| - key: node-role.kubernetes.io/master | ||
| effect: NoSchedule | ||
| ------------------------------------------------ | ||
|
|
||
|
|
||
| [discrete] | ||
| == Deploy | ||
|
|
||
| If planing to deploy `state_*` datasets of Kubernetes package, | ||
|
MichaelKatsoulis marked this conversation as resolved.
Outdated
|
||
| https://github.com/kubernetes/kube-state-metrics#usage[kube-state-metrics] needs to be already deployed | ||
| in the cluster. If `kube-state-metrics` is not already running, deploy it now (see the | ||
| https://github.com/kubernetes/kube-state-metrics#kubernetes-deployment[Kubernetes | ||
| deployment] docs). | ||
|
|
||
| To deploy {agent} on Kubernetes, run: | ||
|
|
||
| ["source", "sh", subs="attributes"] | ||
| ------------------------------------------------ | ||
| kubectl create -f elastic-agent-managed-kubernetes.yaml | ||
| ------------------------------------------------ | ||
|
|
||
| To check the status, run: | ||
|
|
||
| ["source", "sh", subs="attributes"] | ||
| ------------------------------------------------ | ||
| $ kubectl get pod -n kube-system -l app=elastic-agent | ||
|
|
||
| NAME READY STATUS RESTARTS AGE | ||
| elastic-agent-hrjbg 1/1 Running 0 12m | ||
| elastic-agent-olpsd 1/1 Running 0 12m | ||
| ------------------------------------------------ | ||
|
|
||
|
|
||
| {agent}s should be enrolled to Fleet and user should be able to deploy Kubernetes package accordingly. | ||
|
MichaelKatsoulis marked this conversation as resolved.
Outdated
|
||
| This can be confirmed in {kib} under Fleet / Agents section. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 0 additions & 133 deletions
133
docs/en/ingest-management/elastic-agent/running-on-kubernetes.asciidoc
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.