-
Notifications
You must be signed in to change notification settings - Fork 326
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
Datadog Integration (#3407) #3619
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
```release-note:feature | ||
helm: introduces `global.metrics.datadog` overrides to streamline consul-k8s datadog integration. | ||
helm: introduces `server.enableAgentDebug` to expose agent [`enable_debug`](https://developer.hashicorp.com/consul/docs/agent/config/config-files#enable_debug) configuration. | ||
helm: introduces `global.metrics.disableAgentHostName` to expose agent [`telemetry.disable_hostname`](https://developer.hashicorp.com/consul/docs/agent/config/config-files#telemetry-disable_hostname) configuration. | ||
helm: introduces `global.metrics.enableHostMetrics` to expose agent [`telemetry.enable_host_metrics`](https://developer.hashicorp.com/consul/docs/agent/config/config-files#telemetry-enable_host_metrics) configuration. | ||
helm: introduces `global.metrics.prefixFilter` to expose agent [`telemetry.prefix_filter`](https://developer.hashicorp.com/consul/docs/agent/config/config-files#telemetry-prefix_filter) configuration. | ||
helm: introduces `global.metrics.datadog.dogstatsd.dogstatsdAddr` to expose agent [`telemetry.dogstatsd_addr`](https://developer.hashicorp.com/consul/docs/agent/config/config-files#telemetry-dogstatsd_addr) configuration. | ||
helm: introduces `global.metrics.datadog.dogstatsd.dogstatsdTags` to expose agent [`telemetry.dogstatsd_tags`](https://developer.hashicorp.com/consul/docs/agent/config/config-files#telemetry-dogstatsd_tags) configuration. | ||
helm: introduces required `ad.datadoghq.com/` annotations and `tags.datadoghq.com/` labels for integration with [Datadog Autodiscovery](https://docs.datadoghq.com/integrations/consul/?tab=containerized) and [Datadog Unified Service Tagging](https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging/?tab=kubernetes#serverless-environment) for Consul. | ||
helm: introduces automated unix domain socket hostPath mounting for containerized integration with datadog within consul-server statefulset. | ||
helm: introduces `global.metrics.datadog.otlp` override options to allow OTLP metrics forwarding to Datadog Agent. | ||
control-plane: adds `server-acl-init` datadog agent token creation for datadog integration. | ||
``` |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{{- if .Values.global.metrics.datadog.enabled }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ template "consul.fullname" . }}-datadog-metrics | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: datadog | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
component: agent | ||
{{- if (or (and .Values.global.openshift.enabled .Values.server.exposeGossipAndRPCPorts) .Values.global.enablePodSecurityPolicies) }} | ||
{{- if .Values.global.enablePodSecurityPolicies }} | ||
rules: | ||
- apiGroups: ["policy"] | ||
resources: ["podsecuritypolicies"] | ||
resourceNames: | ||
- {{ template "consul.fullname" . }}-datadog-metrics | ||
verbs: | ||
- use | ||
{{- end }} | ||
{{- if (and .Values.global.openshift.enabled .Values.server.exposeGossipAndRPCPorts ) }} | ||
- apiGroups: ["security.openshift.io"] | ||
resources: ["securitycontextconstraints"] | ||
resourceNames: | ||
- {{ template "consul.fullname" . }}-datadog-metrics | ||
verbs: | ||
- use | ||
{{- end }} | ||
{{- else}} | ||
rules: | ||
- apiGroups: [ "" ] | ||
resources: [ "secrets" ] | ||
resourceNames: | ||
- {{ .Release.Namespace }}-datadog-agent-metrics-acl-token | ||
verbs: [ "get", "watch", "list" ] | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{{- if .Values.global.metrics.datadog.enabled }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ template "consul.fullname" . }}-datadog-metrics | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: {{ template "consul.name" . }} | ||
chart: {{ template "consul.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
component: agent | ||
subjects: | ||
- kind: ServiceAccount | ||
apiGroup: "" | ||
name: datadog-agent | ||
namespace: datadog | ||
- kind: ServiceAccount | ||
apiGroup: "" | ||
name: datadog-cluster-agent | ||
namespace: datadog | ||
roleRef: | ||
kind: Role | ||
name: {{ template "consul.fullname" . }}-datadog-metrics | ||
apiGroup: "" | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ metadata: | |
release: {{ .Release.Name }} | ||
component: server | ||
spec: | ||
maxUnavailable: {{ template "consul.pdb.maxUnavailable" . }} | ||
maxUnavailable: {{ template "consul.server.pdb.maxUnavailable" . }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: This is also from #3000 and should be dropped. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Corrected as recommended by reverting back to $ git checkout 'release/1.3.x' -- charts/consul/templates/server-disruptionbudget.yaml charts/consul/test/unit/server-disruptionbudget.bats charts/consul/template/_helpers.tpl Applied datadog-integration changes back into Re-ran entirety of bats tests using |
||
selector: | ||
matchLabels: | ||
app: {{ template "consul.name" . }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -348,7 +348,7 @@ load _helpers | |
[[ "$output" =~ "When the value global.experiments.resourceAPIs is set, global.peering.enabled is currently unsupported." ]] | ||
} | ||
|
||
@test "connectInject/Deployment: fails if resource-apis is set and admin partitions are enabled" { | ||
@test "connectInject/Deployment: fails if resource-apis is set, v2tenancy is unset, and admin partitions are enabled" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Looks like extra stuff picked up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Corrected as recommended by reverting back to $ git checkout 'release/1.3.x' -- charts/consul/templates/server-disruptionbudget.yaml charts/consul/test/unit/server-disruptionbudget.bats charts/consul/template/_helpers.tpl Applied datadog-integration changes back into Re-ran entirety of bats tests using |
||
cd `chart_dir` | ||
run helm template \ | ||
-s templates/tests/test-runner.yaml \ | ||
|
@@ -359,7 +359,7 @@ load _helpers | |
--set 'global.adminPartitions.enabled=true' \ | ||
. | ||
[ "$status" -eq 1 ] | ||
[[ "$output" =~ "When the value global.experiments.resourceAPIs is set, global.adminPartitions.enabled is currently unsupported." ]] | ||
[[ "$output" =~ "When the value global.experiments.resourceAPIs is set, global.experiments.v2tenancy must also be set to support global.adminPartitions.enabled." ]] | ||
} | ||
|
||
@test "connectInject/Deployment: fails if resource-apis is set and federation is enabled" { | ||
|
@@ -431,18 +431,6 @@ load _helpers | |
[[ "$output" =~ "When the value global.experiments.resourceAPIs is set, syncCatalog.enabled is currently unsupported." ]] | ||
} | ||
|
||
@test "connectInject/Deployment: fails if resource-apis is set and meshGateway is enabled" { | ||
cd `chart_dir` | ||
run helm template \ | ||
-s templates/tests/test-runner.yaml \ | ||
--set 'connectInject.enabled=true' \ | ||
--set 'global.experiments[0]=resource-apis' \ | ||
--set 'ui.enabled=false' \ | ||
--set 'meshGateway.enabled=true' . | ||
[ "$status" -eq 1 ] | ||
[[ "$output" =~ "When the value global.experiments.resourceAPIs is set, meshGateway.enabled is currently unsupported." ]] | ||
} | ||
|
||
@test "connectInject/Deployment: fails if resource-apis is set and ingressGateways is enabled" { | ||
cd `chart_dir` | ||
run helm template \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: These extra 'leave_on_terminate' and 'autopilot' settings should be removed as they were deemed destructive.
We need to check the other backports as anything from #3000 should not be in release/1.3.x, release/1.2.x and release/1.1.x (1.4.x is fine)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected as recommended by reverting back to
release/1.3.x
branch version of affected files.$ git checkout 'release/1.3.x' -- charts/consul/templates/server-config-configmap.yaml
Re-applied
datadog-integration
changes into the following files:charts/consul/templates/server-config-configmap.yaml
enable_debug
intoserver.json
(updatesserver-statefulset.yaml
config-checksum)telemetry-config.json
charts/consul/test/unit/server-statefulset.bats
config-configmap
tests to reflectenable_debug
update toserver.json
config"server/StatefulSet: adds config-checksum annotation when extraConfig is blank"
"server/StatefulSet: adds config-checksum annotation when extraConfig is provided"
"server/StatefulSet: adds config-checksum annotation when extraConfig is updated"