linkerd2 icon indicating copy to clipboard operation
linkerd2 copied to clipboard

Don't set `linkerd.io/proxy-version: ""` on injected workloads

Open olix0r opened this issue 3 years ago • 5 comments

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.

olix0r avatar Sep 01 '22 14:09 olix0r

I was unable to reproduce using edge-22.8.3 or a locally built dev- version of linkerd.

jeremychase avatar Sep 09 '22 20:09 jeremychase

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

olix0r avatar Sep 09 '22 23:09 olix0r

> 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...

adleong avatar Sep 10 '22 01:09 adleong

That's the default in helm:

https://github.com/linkerd/linkerd2/blob/b7387820c315bd769380267235cfaa69aeef269d/charts/linkerd-control-plane/values.yaml#L101-L118

olix0r avatar Sep 10 '22 02:09 olix0r

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.

adleong avatar Sep 11 '22 02:09 adleong

Fixed by #9382

adleong avatar Oct 11 '22 19:10 adleong