Skip to content
Merged
14 changes: 11 additions & 3 deletions charts/linkerd-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,23 @@ proxy:
# Configures tracing in the proxy and how they are exported
tracing:
# -- Enables trace collection and export in the proxy
enable: false
enabled: false
traceServiceName: linkerd-proxy
collector:
# -- The collector endpoint to send traces to.
endpoint: ""
# -- The identity of the collector in the linkerd mesh. If the collector
# is unmeshed, this should remain unset.
# -- The identity of the collector in the linkerd mesh.
meshIdentity:
# -- Mesh identity name for the trace collector. This should be set to
# the name of the service account attached to the collector. If
# there's no explicitly set service account, this will probably be
# "default".
serviceAccountName: ""
# -- Mesh identity namespace for the trace collector. This should be
# set to the namespace of the service account attached to the
# collector. If there's no explicitly set service account, this is the
# namespace of the collector.
namespace: ""
inbound:
server:
http2:
Expand Down
12 changes: 8 additions & 4 deletions charts/partials/templates/_proxy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ env:
value: 30s
- name: LINKERD2_PROXY_OUTBOUND_METRICS_HOSTNAME_LABELS
value: {{ .Values.proxy.metrics.hostnameLabels | quote }}
{{ if .Values.proxy.tracing | default (dict) | dig "enable" false -}}
{{ if .Values.proxy.tracing | default (dict) | dig "enabled" false -}}
- name: LINKERD2_PROXY_TRACE_ATTRIBUTES_PATH
value: /var/run/linkerd/podinfo/labels
- name: LINKERD2_PROXY_TRACE_PROTOCOL
Expand All @@ -160,10 +160,14 @@ env:
{{- end }}
- name: LINKERD2_PROXY_TRACE_COLLECTOR_SVC_ADDR
value: {{ .Values.proxy.tracing.collector.endpoint }}
{{ if .Values.proxy.tracing.collector.meshIdentity.serviceAccountName -}}
{{- if empty .Values.proxy.tracing.collector.meshIdentity.serviceAccountName }}
{{- fail "proxy.tracing.collector.meshIdentity.serviceAccountName must be set if proxy tracing is enabled" }}
{{- end }}
{{- if empty .Values.proxy.tracing.collector.meshIdentity.namespace }}
{{- fail "proxy.tracing.collector.meshIdentity.namespace must be set if proxy tracing is enabled" }}
{{- end }}
- name: LINKERD2_PROXY_TRACE_COLLECTOR_SVC_NAME
value: {{ .Values.proxy.tracing.collector.meshIdentity.serviceAccountName }}.serviceaccount.identity.{{.Release.Namespace}}.{{ .Values.clusterDomain }}
{{ end -}}
value: {{ .Values.proxy.tracing.collector.meshIdentity.serviceAccountName }}.{{ .Values.proxy.tracing.collector.meshIdentity.namespace }}.serviceaccount.identity.{{.Release.Namespace}}.{{ .Values.clusterDomain }}
- name: LINKERD2_PROXY_TRACE_EXTRA_ATTRIBUTES
value: |
k8s.pod.ip=$(_pod_ip)
Expand Down
3 changes: 2 additions & 1 deletion cli/cmd/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@ func TestRender(t *testing.T) {
HostnameLabels: false,
},
Tracing: &charts.ProxyTracing{
Enable: false,
Enabled: false,
TraceServiceName: "linkerd-proxy",
Collector: &charts.ProxyTracingCollector{
Endpoint: "",
MeshIdentity: &charts.ProxyTracingCollectorIdentity{
ServiceAccountName: "",
Namespace: "",
},
},
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_custom_domain.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_custom_registry.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_default.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_default_token.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_gid_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_ha_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_ha_with_overrides_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_heartbeat_disabled_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_helm_control_plane_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_helm_output_ha_labels.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_no_init_container.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_proxy_ignores.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cli/cmd/testdata/install_values_file.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/charts/linkerd2/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ type (
}

ProxyTracing struct {
Enable bool `json:"enable"`
Enabled bool `json:"enabled"`
Protocol string `json:"protocol"`
TraceServiceName string `json:"traceServiceName"`
Collector *ProxyTracingCollector `json:"collector"`
Expand All @@ -198,6 +198,7 @@ type (

ProxyTracingCollectorIdentity struct {
ServiceAccountName string `json:"serviceAccountName"`
Namespace string `json:"namespace"`
}

ProxyRuntime struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/charts/linkerd2/values_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func TestNewValues(t *testing.T) {
HostnameLabels: false,
},
Tracing: &ProxyTracing{
Enable: false,
Enabled: false,
TraceServiceName: "linkerd-proxy",
Collector: &ProxyTracingCollector{
Endpoint: "",
Expand Down
5 changes: 3 additions & 2 deletions test/integration/tracing/testdata/tracing-values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
proxy:
tracing:
enable: true
enabled: true
collector:
endpoint: otel-collector-opentelemetry-collector.tracing:4317
meshIdentity:
serviceAccountName: otel-collector-opentelemetry-collector.tracing
serviceAccountName: otel-collector-opentelemetry-collector
namespace: tracing