linkerd / linkerd/linkerd2

TcpSocket probes are meaningless with meshed pods

Open
#7,777 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/docs
Dominant language
Go
Stars
11.5k
Forks
1.4k
Avg merge
3d 22h
Merged PRs (30d)
53

Description

What is the issue?

Meshed pods have all ports redirected to linkerd-proxy sidecar and as such all ports are open at the TCP level. This means probes with TCPSocketAction are meaningless, as they will succeed as long as linkerd-proxy is alive, independent if the main container is dead.

How can it be reproduced?

While this deployment will fail liveness probes:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: busybox-fails
  labels:
    app: busybox-fails
spec:
  replicas: 3
  selector:
    matchLabels:
      app: busybox-fails
  template:
    metadata:
      labels:
        app: busybox-fails
    spec:
      containers:
      - name: busybox
        image: busybox:latest
        command:
        - sleep
        args:
        - "3600"
        livenessProbe:
          tcpSocket:
            port: 8080

Injecting linkerd is enough to make the probes pass:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: busybox
  labels:
    app: busybox
spec:
  replicas: 3
  selector:
    matchLabels:
      app: busybox
  template:
    metadata:
      annotations:
        linkerd.io/inject: enabled
      labels:
        app: busybox
    spec:
      containers:
      - name: busybox
        image: busybox:latest
        command:
        - sleep
        args:
        - "3600"
        livenessProbe:
          tcpSocket:
            port: 8080
Logs, error output, etc

Seems non-applicable.

output of linkerd check -o short
Linkerd core checks
===================


Status check results are √

Linkerd extensions checks
=========================


Status check results are √


Status check results are √
Environment
  • Kubernetes v1.21.6-gke.1500 on GKE
Possible solution

As discussed in Slack, the ideal solution here is to passthrough kubelet traffic to the pod without redirecting to linkerd-proxy container, but at a minimum we should have this very clearly documented so developers are not surprised.

Additional context

No response

Would you like to work on fixing this bug?

no

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Linkerd documentation covering Kubernetes liveness probes and sidecar traffic redirection. Reproduce the behavior with the two deployment manifests in the issue, then document the limitation and recommended probe alternatives so meshed-pod users can understand when TCP probes are unreliable.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.