Skip to content

Commit 3b46333

Browse files
authored
feat(tracing)!: Improve control plane tracing configuration (#14557)
* chore(docs): Update tracing documentation This clarifies the tracing documentation that the trace collector must be meshed, along with the specifics of how the service account name for the collector should be set. Signed-off-by: Scott Fleener <[email protected]> * chore(docs): Include `serviceAccountNamespace` for tracing collector This separates out the service account namespace from the name to make it clearer how to set the correct service account for the trace collector. Signed-off-by: Scott Fleener <[email protected]> * chore(docs): Make docs clearer about what needs to be set for the collector mesh identity Signed-off-by: Scott Fleener <[email protected]> * feat!(tracing): Improve control plane tracing configuration The current control plane tracing relies on the linkerd-jaeger extension, and does not work when using the native tracing configuration. This removes the previous configs, and adds new control plane tracing config that mirrors the existing proxy tracing configs. The previous configuration was meant entirely for internal testing purposes, and shouldn't be subject to any breaking change guarantees. Signed-off-by: Scott Fleener <[email protected]> * fix(test): Update tracing test values Signed-off-by: Scott Fleener <[email protected]> * feat(charts): Switch ServiceAccountName to separate Name and Namespace fields Signed-off-by: Scott Fleener <[email protected]> * fix: Change deprecated casing for lint Signed-off-by: Scott Fleener <[email protected]> * chore: Rename fields and semantics of tracing identity Signed-off-by: Scott Fleener <[email protected]> * chore: Fix bad auto-rename Signed-off-by: Scott Fleener <[email protected]> * chore: Change to breaking API change Signed-off-by: Scott Fleener <[email protected]> * chore: Regenerate goldens Signed-off-by: Scott Fleener <[email protected]> * fix: Use correct trace enable value Signed-off-by: Scott Fleener <[email protected]> * fix(docs): Typos in docs Signed-off-by: Scott Fleener <[email protected]> --------- Signed-off-by: Scott Fleener <[email protected]>
1 parent 068ab46 commit 3b46333

26 files changed

+278
-185
lines changed

BUILD.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -198,25 +198,21 @@ bin/linkerd viz -n emojivoto tap deploy voting
198198
#### Deploying Control Plane components with Tracing
199199

200200
Control Plane components have the `trace-collector` flag used to enable
201-
[Distributed Tracing](https://opentracing.io/docs/overview/what-is-tracing/) for
202-
development purposes. It can be enabled globally i.e Control plane components
203-
and their proxies by using the `--set controlPlaneTracing=true` installation
204-
flag.
201+
[Distributed Tracing](https://opentracing.io/docs/overview/what-is-tracing/)
202+
for development purposes. It can be enabled globally i.e Control plane
203+
components and their proxies by using the
204+
`--set controller.tracing.enable=true` installation flag.
205205

206-
This will configure all the components to send the traces at
207-
`collector.{{.Values.controlPlaneTracingNamespace}}.svc.{{.Values.ClusterDomain}}:4317`
206+
This will configure all the components to send the traces to the collector you
207+
have configured for your cluster.
208208

209209
```bash
210210

211211
# install Linkerd with tracing
212-
linkerd install --set controlPlaneTracing=true | kubectl apply -f -
213-
214-
# install the Jaeger extension
215-
linkerd jaeger install | kubectl apply -f -
216-
217-
# restart the control plane components so that the jaeger-injector enables
218-
# tracing in their proxies
219-
kubectl -n linkerd rollout restart deploy
212+
linkerd install \
213+
--set controller.tracing.enable=true \
214+
--set controller.tracing.collector.endpoint=<your trace collector endpoint> \
215+
| kubectl apply -f -
220216
```
221217

222218
### Publishing images

charts/linkerd-control-plane/values.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ revisionHistoryLimit: 10
1919
controllerLogLevel: info
2020
# -- Log format for the control plane components
2121
controllerLogFormat: plain
22-
# -- enables control plane tracing
23-
controlPlaneTracing: false
24-
# -- namespace to send control plane traces to
25-
controlPlaneTracingNamespace: linkerd-jaeger
2622
# -- control plane version. See Proxy section for proxy version
2723
linkerdVersion: linkerdVersionValue
2824
# -- default kubernetes deployment strategy
@@ -51,6 +47,13 @@ controller:
5147
podDisruptionBudget:
5248
# -- Maximum number of pods that can be unavailable during disruption
5349
maxUnavailable: 1
50+
# Configures tracing in the controllers and how traces are exported
51+
tracing:
52+
# -- Enables trace collection and export in the proxy
53+
enabled: false
54+
collector:
55+
# -- The collector endpoint to send traces to. Required if tracing is enabled
56+
endpoint: ""
5457
# -- enabling this omits the NET_ADMIN capability in the PSP
5558
# and the proxy-init container when injecting the proxy;
5659
# requires the linkerd-cni plugin to already be installed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{{ define "partials.linkerd.trace" -}}
2-
{{ if .Values.controlPlaneTracing -}}
3-
- -trace-collector=collector.{{.Values.controlPlaneTracingNamespace}}.svc.{{.Values.clusterDomain}}:4317
2+
{{ if .Values.controller.tracing.enabled -}}
3+
{{- if empty .Values.controller.tracing.collector.endpoint }}
4+
{{- fail "controller.tracing.collector.endpoint must be set if control plane tracing is enabled" }}
5+
{{- end }}
6+
- -trace-collector={{.Values.controller.tracing.collector.endpoint}}
47
{{ end -}}
58
{{- end }}

cli/cmd/install_test.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func TestRender(t *testing.T) {
7373
CNIEnabled: false,
7474
IdentityTrustDomain: defaultValues.IdentityTrustDomain,
7575
IdentityTrustAnchorsPEM: defaultValues.IdentityTrustAnchorsPEM,
76+
Controller: defaultValues.Controller,
7677
DestinationController: defaultValues.DestinationController,
7778
PodAnnotations: map[string]string{},
7879
PodLabels: map[string]string{},
@@ -124,12 +125,12 @@ func TestRender(t *testing.T) {
124125
Metrics: &charts.ProxyMetrics{
125126
HostnameLabels: false,
126127
},
127-
Tracing: &charts.ProxyTracing{
128+
Tracing: &charts.Tracing{
128129
Enabled: false,
129130
TraceServiceName: "linkerd-proxy",
130-
Collector: &charts.ProxyTracingCollector{
131+
Collector: &charts.TracingCollector{
131132
Endpoint: "",
132-
MeshIdentity: &charts.ProxyTracingCollectorIdentity{
133+
MeshIdentity: &charts.TracingCollectorIdentity{
133134
ServiceAccountName: "",
134135
Namespace: "",
135136
},
@@ -231,7 +232,12 @@ func TestRender(t *testing.T) {
231232
if err != nil {
232233
t.Fatalf("Unexpected error: %v\n", err)
233234
}
234-
withControlPlaneTracingValues.ControlPlaneTracing = true
235+
withControlPlaneTracingValues.Controller.Tracing = &charts.Tracing{
236+
Enabled: true,
237+
Collector: &charts.TracingCollector{
238+
Endpoint: "tracing.foo:4317",
239+
},
240+
}
235241
addFakeTLSSecrets(withControlPlaneTracingValues)
236242

237243
customRegistryOverride := "my.custom.registry/linkerd-io"

cli/cmd/options.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,6 @@ func makeInstallUpgradeFlags(defaults *l5dcharts.Values) ([]flag.Flag, *pflag.Fl
114114
return nil
115115
}),
116116

117-
flag.NewBoolFlag(installUpgradeFlags, "control-plane-tracing", defaults.ControlPlaneTracing,
118-
"Enables Control Plane Tracing with the defaults", func(values *l5dcharts.Values, value bool) error {
119-
values.ControlPlaneTracing = value
120-
return nil
121-
}),
122-
123-
flag.NewStringFlag(installUpgradeFlags, "control-plane-tracing-namespace", defaults.ControlPlaneTracingNamespace,
124-
"Send control plane traces to Linkerd-Jaeger extension in this namespace", func(values *l5dcharts.Values, value string) error {
125-
values.ControlPlaneTracingNamespace = value
126-
return nil
127-
}),
128-
129117
flag.NewStringFlag(installUpgradeFlags, "identity-issuer-certificate-file", "",
130118
"A path to a PEM-encoded file containing the Linkerd Identity issuer certificate (generated by default)",
131119
func(values *l5dcharts.Values, value string) error {
@@ -181,8 +169,6 @@ func makeInstallUpgradeFlags(defaults *l5dcharts.Values) ([]flag.Flag, *pflag.Fl
181169
if release {
182170
installUpgradeFlags.MarkHidden("control-plane-version")
183171
}
184-
installUpgradeFlags.MarkHidden("control-plane-tracing")
185-
installUpgradeFlags.MarkHidden("control-plane-tracing-namespace")
186172

187173
return flags, installUpgradeFlags, nil
188174
}

cli/cmd/testdata/install_controlplane_tracing_output.golden

Lines changed: 13 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/install_custom_domain.golden

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/install_custom_registry.golden

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/install_default.golden

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/install_default_override_dst_get_nets.golden

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)