Skip to content

Commit 068ab46

Browse files
authored
chore(charts): Add separate namespace field for trace collector service account (#14539)
* 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]> * 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]> --------- Signed-off-by: Scott Fleener <[email protected]>
1 parent faac95a commit 068ab46

25 files changed

+65
-31
lines changed

charts/linkerd-control-plane/values.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,23 @@ proxy:
281281
# Configures tracing in the proxy and how they are exported
282282
tracing:
283283
# -- Enables trace collection and export in the proxy
284-
enable: false
284+
enabled: false
285285
traceServiceName: linkerd-proxy
286286
collector:
287287
# -- The collector endpoint to send traces to.
288288
endpoint: ""
289-
# -- The identity of the collector in the linkerd mesh. If the collector
290-
# is unmeshed, this should remain unset.
289+
# -- The identity of the collector in the linkerd mesh.
291290
meshIdentity:
291+
# -- Mesh identity name for the trace collector. This should be set to
292+
# the name of the service account attached to the collector. If
293+
# there's no explicitly set service account, this will probably be
294+
# "default".
292295
serviceAccountName: ""
296+
# -- Mesh identity namespace for the trace collector. This should be
297+
# set to the namespace of the service account attached to the
298+
# collector. If there's no explicitly set service account, this is the
299+
# namespace of the collector.
300+
namespace: ""
293301
inbound:
294302
server:
295303
http2:

charts/partials/templates/_proxy.tpl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ env:
148148
value: 30s
149149
- name: LINKERD2_PROXY_OUTBOUND_METRICS_HOSTNAME_LABELS
150150
value: {{ .Values.proxy.metrics.hostnameLabels | quote }}
151-
{{ if .Values.proxy.tracing | default (dict) | dig "enable" false -}}
151+
{{ if .Values.proxy.tracing | default (dict) | dig "enabled" false -}}
152152
- name: LINKERD2_PROXY_TRACE_ATTRIBUTES_PATH
153153
value: /var/run/linkerd/podinfo/labels
154154
- name: LINKERD2_PROXY_TRACE_PROTOCOL
@@ -160,10 +160,14 @@ env:
160160
{{- end }}
161161
- name: LINKERD2_PROXY_TRACE_COLLECTOR_SVC_ADDR
162162
value: {{ .Values.proxy.tracing.collector.endpoint }}
163-
{{ if .Values.proxy.tracing.collector.meshIdentity.serviceAccountName -}}
163+
{{- if empty .Values.proxy.tracing.collector.meshIdentity.serviceAccountName }}
164+
{{- fail "proxy.tracing.collector.meshIdentity.serviceAccountName must be set if proxy tracing is enabled" }}
165+
{{- end }}
166+
{{- if empty .Values.proxy.tracing.collector.meshIdentity.namespace }}
167+
{{- fail "proxy.tracing.collector.meshIdentity.namespace must be set if proxy tracing is enabled" }}
168+
{{- end }}
164169
- name: LINKERD2_PROXY_TRACE_COLLECTOR_SVC_NAME
165-
value: {{ .Values.proxy.tracing.collector.meshIdentity.serviceAccountName }}.serviceaccount.identity.{{.Release.Namespace}}.{{ .Values.clusterDomain }}
166-
{{ end -}}
170+
value: {{ .Values.proxy.tracing.collector.meshIdentity.serviceAccountName }}.{{ .Values.proxy.tracing.collector.meshIdentity.namespace }}.serviceaccount.identity.{{.Release.Namespace}}.{{ .Values.clusterDomain }}
167171
- name: LINKERD2_PROXY_TRACE_EXTRA_ATTRIBUTES
168172
value: |
169173
k8s.pod.ip=$(_pod_ip)

cli/cmd/install_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,13 @@ func TestRender(t *testing.T) {
125125
HostnameLabels: false,
126126
},
127127
Tracing: &charts.ProxyTracing{
128-
Enable: false,
128+
Enabled: false,
129129
TraceServiceName: "linkerd-proxy",
130130
Collector: &charts.ProxyTracingCollector{
131131
Endpoint: "",
132132
MeshIdentity: &charts.ProxyTracingCollectorIdentity{
133133
ServiceAccountName: "",
134+
Namespace: "",
134135
},
135136
},
136137
},

cli/cmd/testdata/install_controlplane_tracing_output.golden

Lines changed: 2 additions & 1 deletion
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: 2 additions & 1 deletion
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: 2 additions & 1 deletion
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: 2 additions & 1 deletion
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: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/install_default_token.golden

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/cmd/testdata/install_gid_output.golden

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)