linkerd2
linkerd2 copied to clipboard
Don't set `linkerd.io/proxy-version: ""` on injected workloads
Injected workloads appear to always have an annotation set linkerd.io/proxy-version: "". If the value is empty, the annotation should be omitted. OR we should always set it with a valid value.
I was unable to reproduce using edge-22.8.3 or a locally built dev- version of linkerd.
Hmmm, this is what I see:
$ k get po -o yaml -n emojivoto | grep proxy-version
linkerd.io/proxy-version: ""
linkerd.io/proxy-version: ""
linkerd.io/proxy-version: ""
linkerd.io/proxy-version: ""
$ k get deploy -o yaml -n emojivoto | grep -c proxy-version
0
$ k get ns -o yaml emojivoto | grep -c proxy-version
0
$ linkerd version
Client version: edge-22.8.3
Server version: stable-2.12.0
$ k get cm -n linkerd linkerd-config -o yaml | yq .data.values | yq .proxy
await: true
cores: 0
defaultInboundPolicy: all-unauthenticated
enableExternalProfiles: false
image:
name: cr.l5d.io/linkerd/proxy
pullPolicy: ""
version: ""
inboundConnectTimeout: 100ms
logFormat: plain
logLevel: info
opaquePorts: 25,587,3306,4444,5432,6379,9300,11211
outboundConnectTimeout: 1000ms
ports:
admin: 4191
control: 4190
inbound: 4143
outbound: 4140
requireIdentityOnInboundPorts: ""
resources:
cpu:
limit: ""
request: ""
ephemeral-storage:
limit: ""
request: ""
memory:
limit: ""
request: ""
shutdownGracePeriod: ""
uid: 2102
waitBeforeExitSeconds: 0
> linkerd inject https://run.linkerd.io/emojivoto.yml | k apply -f -
[...]
> k get po -o yaml -n emojivoto | grep proxy-version
linkerd.io/proxy-version: stable-2.12.0
linkerd.io/proxy-version: stable-2.12.0
linkerd.io/proxy-version: stable-2.12.0
linkerd.io/proxy-version: stable-2.12.0
> k get cm -n linkerd linkerd-config -o yaml | yq .data.values | yq .proxy.image
name: cr.l5d.io/linkerd/proxy
pullPolicy: ""
version: stable-2.12.0
looks like .proxy.image.version is unset in your linkerd config for some reason...
That's the default in helm:
https://github.com/linkerd/linkerd2/blob/b7387820c315bd769380267235cfaa69aeef269d/charts/linkerd-control-plane/values.yaml#L101-L118
Ah, I think I see what's happening. This value is populated programmatically here: https://github.com/linkerd/linkerd2/blob/main/pkg/charts/linkerd2/values.go#L247
This means that it will be set if Linkerd is installed with the CLI but not if Linkerd was installed with Helm.
Every place that this value is used in the templates should already be applying the correct defaulting behavior so it's fine that this isn't set. In fact, we should probably STOP setting this in the CLI install flow in order to have more consistency between the CLI and Helm flows.
However, it looks like we're missing the defaulting logic in the inject codepath which sets the proxy-version annotation. This codepath should fall back to using the Linkerd version if the proxy version isn't set.
Fixed by #9382