Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Better document cluster agent & Update chart #8786

Merged
merged 10 commits into from
Nov 2, 2018

Conversation

CharlyF
Copy link
Collaborator

@CharlyF CharlyF commented Oct 26, 2018

What this PR does / why we need it:

  • Better document the Install for the Datadog Cluster Agent
  • Add a codeowner
  • Move default log level to info

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • DCO signed
  • Chart Version bumped
  • Variables are documented in the README.md

@helm-bot helm-bot added Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 26, 2018
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 26, 2018
@@ -3,7 +3,7 @@ image:
# This chart is compatible with different images, please choose one
repository: datadog/agent # Agent6
# repository: datadog/dogstatsd # Standalone DogStatsD6
tag: 6.5.2 # Use 6.5.2-jmx to enable jmx fetch collection
tag: 6.6.0 # Use 6.5.2-jmx to enable jmx fetch collection
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you update the comment as well?

@@ -2,7 +2,9 @@ approvers:
- hkaj
- irabinovitch
- xvello
- charlyf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please! You'll need to open an issue to become a trusted collaborator first though.

@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 26, 2018
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2018
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2018
charlyF added 4 commits October 30, 2018 16:49
Signed-off-by: charlyF <charly@datadoghq.com>
Signed-off-by: charlyF <charly@datadoghq.com>
Signed-off-by: charlyF <charly@datadoghq.com>
Signed-off-by: charlyF <charly@datadoghq.com>
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2018
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 2, 2018
Read about the Datadog Cluster Agent in the [official documentation](https://docs.datadoghq.com/agent/kubernetes/cluster/).

Run the following if you want to deploy the chart with the Datadog Cluster Agent.
You can also specify `clusterAgent.metricsProvider.enabled=true` if you want to enable the External Metrics Server.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already set in the command below. Either remove this line or remove the option in the bash snippet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep both, just to stress that this is the specific option that enables the external metrics provider.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, then we should change the wording.
Right now it reads as Run the following [...], you can also specify <option> if you want to enable [...] but the option is already in the snippet.

What about Note that specifying <option> will enable [...] instead?

If you want to learn to use this feature, you can check out this [walkthrough](https://github.com/DataDog/datadog-agent/blob/master/docs/cluster-agent/CUSTOM_METRICS_SERVER.md).
```bash
helm install --name datadog-monitoring \
--set clusterAgent.token=YOUR-32-CHARACTERS-TOKEN \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually i think we should just get rid of this setting and generate a random token ourselves with {{ randAlphaNum 32 | quote }}. WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smart

--set clusterAgent.token=YOUR-32-CHARACTERS-TOKEN \
--set datadog.apiKey=YOUR-API-KEY-HERE \
--set datadog.appKey=YOUR-APP-KEY-HERE \
--set datadog.leaderElection=true \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just turn leader election on for the cluster agent by default and get rid of this option? What could go wrong if we do? (of course we'd keep the option for when the cluster agent is not enabled).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed

charlyF added 3 commits November 2, 2018 10:11
Signed-off-by: charlyF <charly@datadoghq.com>
Signed-off-by: charlyF <charly@datadoghq.com>
Signed-off-by: charlyF <charly@datadoghq.com>
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 2, 2018
Copy link
Collaborator

@hkaj hkaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

values.yaml has leaderElection: false uncommented. That means the default value for the cluster agent won't apply and leaderElection won't be enabled by default. I think we should comment it out, and make it false by default for the agent but true for the cluster agent. Does that make sense?

Run the following if you want to deploy the chart with the Datadog Cluster Agent.
Note that specifying `clusterAgent.metricsProvider.enabled=true` will enable the External Metrics Server.
If you want to learn to use this feature, you can check out this [walkthrough](https://github.com/DataDog/datadog-agent/blob/master/docs/cluster-agent/CUSTOM_METRICS_SERVER.md).
The Leader Election is enabled by default in the chart for the Cluster Agent. Only the Cluster Agent(s) participate in the election, in case you have several replicas configred (using `clusterAgent.replicas`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configred --> configured

@@ -47,11 +47,12 @@ Create an application key at https://app.datadoghq.com/account/settings#api
{{- if not .Values.clusterAgent.token }}

##############################################################################
#### ERROR: You did not set a clusterAgent.token ####
#### WARNING: You did not set a clusterAgent.token ####
Copy link
Collaborator

@hkaj hkaj Nov 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm fine with notifying it, but INFO is enough IMHO? There's nothing wrong here.

- name: DD_LEADER_ELECTION
value: {{ .Values.datadog.leaderElection | quote}}
{{- end }}
value: {{ .Values.datadog.leaderElection | default "true" | quote}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an aside: could we rename this file to cluster-agent-deployment.yaml? This confuses me every time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I'll do it here

Signed-off-by: charlyF <charly@datadoghq.com>
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 2, 2018
@CharlyF
Copy link
Collaborator Author

CharlyF commented Nov 2, 2018

I'm ok with commenting it out in the docs to be more clear but from my testings and given that:
https://github.com/helm/charts/pull/8786/files#diff-19938b6253581d6defa2db7d73496176R61
The leader election will be ON if the Cluster Agent is enabled. Unless set to false.
If the Cluster Agent is not enabled however, the default value will be the one from datadog-agent/pkg/config/config.go which is false. So the value in values.yaml does not do anything.

Signed-off-by: charlyF <charly@datadoghq.com>
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 2, 2018
@hkaj
Copy link
Collaborator

hkaj commented Nov 2, 2018

/approve
/ok-to-test

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 2, 2018
@hkaj
Copy link
Collaborator

hkaj commented Nov 2, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 2, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CharlyF, hkaj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 3bdff56 into helm:master Nov 2, 2018
@CharlyF CharlyF deleted the document-cluster-agent branch November 2, 2018 20:33
wgiddens pushed a commit to wgiddens/charts that referenced this pull request Jan 18, 2019
* updating README

Signed-off-by: charlyF <charly@datadoghq.com>

* changing log level to warning

Signed-off-by: charlyF <charly@datadoghq.com>

* bumping chart, lint, updating agent version

Signed-off-by: charlyF <charly@datadoghq.com>

* updating versions in readme and comment

Signed-off-by: charlyF <charly@datadoghq.com>

* leader election is set to true by default

Signed-off-by: charlyF <charly@datadoghq.com>

* adding option and doc to generate and use random token if not provided

Signed-off-by: charlyF <charly@datadoghq.com>

* rephrase README

Signed-off-by: charlyF <charly@datadoghq.com>

* feedback

Signed-off-by: charlyF <charly@datadoghq.com>

* commenting leaderelection option in values.yaml

Signed-off-by: charlyF <charly@datadoghq.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants