Skip to content

Commit 839876c

Browse files
committed
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]>
1 parent 7d466ad commit 839876c

26 files changed

+274
-182
lines changed

BUILD.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -200,23 +200,18 @@ bin/linkerd viz -n emojivoto tap deploy voting
200200
Control Plane components have the `trace-collector` flag used to enable
201201
[Distributed Tracing](https://opentracing.io/docs/overview/what-is-tracing/) for
202202
development purposes. It can be enabled globally i.e Control plane components
203-
and their proxies by using the `--set controlPlaneTracing=true` installation
203+
and their proxies by using the `--set controller.tracing.enable=true` installation
204204
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 have configured for your cluster.
208207

209208
```bash
210209

211210
# 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
211+
linkerd install \
212+
--set controller.tracing.enable=true \
213+
--set controller.tracing.collector.endpoint=<your trace collector endpoint> \
214+
| kubectl apply -f -
220215
```
221216

222217
### 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+
enable: 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.enable -}}
3+
{{- if empty .Values.controller.tracing.collector.endpoint }}
4+
{{- fail "controller.tracing.collector.endpoint must be set if proxy 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
Enable: 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
ServiceAccountNamespace: "",
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+
Enable: 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)