Confusion with the annotation - port was not skipped when annotation was at POD
Bug Report
What is the issue?
MCRouter (and probably) the demonset is not working properly through the proxy when Azure CNI is in use. We didn't have this kind of issues with kubenet network. At one of our environment the connection is totally blocked. Following these instruction the connection to MCRouter is cut during the connection.
At Linkerd 2.7.1 everything works as expected. At Linkerd 2.9.4 it doesn't.
How can it be reproduced?
- Create the AKS cluster with this Terrform file
- Install linkerd with
linkerd install | kubectl apply -f - - Install MCroute:
helm repo add tietoevryfs https://evryfs.github.io/helm-charts/andhelm install tietoevryfs/mcrouter --version 0.1.0 --generate-name - Apply this demo environment by applying This Kubernetes Yaml
It creates the runme pod to default namespace and testapp to test-namespace. The test-namespace has annotateion:linkerd.io/inject: enabled and testapp has config.linkerd.io/skip-oubound-ports: "5000"
If you exec into the pod and install netcat (apt update,apt install -y netcat) you can test:
echo stat | nc $NODE_NAME 5000 should connect to the mcrouter and local node and run the stats command. At runme pod it works as expected. At testapp it pauses for a few seconds and then exits.
Logs, error output, etc
--
linkerd check output
kubernetes-api
--------------
√ can initialize the client
√ can query the Kubernetes API
kubernetes-version
------------------
√ is running the minimum Kubernetes API version
√ is running the minimum kubectl version
linkerd-existence
-----------------
√ 'linkerd-config' config map exists
√ heartbeat ServiceAccount exist
√ control plane replica sets are ready
√ no unschedulable pods
√ controller pod is running
√ can initialize the client
√ can query the control plane API
linkerd-config
--------------
√ control plane Namespace exists
√ control plane ClusterRoles exist
√ control plane ClusterRoleBindings exist
√ control plane ServiceAccounts exist
√ control plane CustomResourceDefinitions exist
√ control plane MutatingWebhookConfigurations exist
√ control plane ValidatingWebhookConfigurations exist
√ control plane PodSecurityPolicies exist
linkerd-identity
----------------
√ certificate config is valid
√ trust anchors are using supported crypto algorithm
√ trust anchors are within their validity period
√ trust anchors are valid for at least 60 days
√ issuer cert is using supported crypto algorithm
√ issuer cert is within its validity period
√ issuer cert is valid for at least 60 days
√ issuer cert is issued by the trust anchor
linkerd-webhooks-and-apisvc-tls
-------------------------------
√ tap API server has valid cert
√ tap API server cert is valid for at least 60 days
√ proxy-injector webhook has valid cert
√ proxy-injector cert is valid for at least 60 days
√ sp-validator webhook has valid cert
√ sp-validator cert is valid for at least 60 days
linkerd-api
-----------
√ control plane pods are ready
√ control plane self-check
√ [kubernetes] control plane can talk to Kubernetes
√ [prometheus] control plane can talk to Prometheus
√ tap api service is running
linkerd-version
---------------
√ can determine the latest version
√ cli is up-to-date
control-plane-version
---------------------
√ control plane is up-to-date
√ control plane and cli versions match
linkerd-prometheus
------------------
√ prometheus add-on service account exists
√ prometheus add-on config map exists
√ prometheus pod is running
linkerd-grafana
---------------
√ grafana add-on service account exists
√ grafana add-on config map exists
√ grafana pod is running
Status check results are √
Environment
- Kubernetes Version:
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.1", GitCommit:"206bcadf021e76c27513500ca24182692aabd17e", GitTreeState:"clean", BuildDate:"2020-09-09T11:26:42Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.14", GitCommit:"5de7fd1f9555368a86eb0f8f664dc58055c17269", GitTreeState:"clean", BuildDate:"2021-01-18T09:31:01Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
- Cluster Environment: AKS, Azure CNI
- Host OS: Linux
- Linkerd version: 2.9.4
Possible solution
Additional context
Now this turns to more like question because I'm getting really puzzled how this works. I assumed that annotation config.linkerd.io/skip-outbound-ports could be at the POD level. It didn't seem to work properly. When I moved that annotation to the Namespace-level, this started to work.
So where the annotation should be so that it works?
I had TYPO! I had: oubound, not ouTbound... Sorry. Now I see the problem and why it didn't ignore the ouTbound port 5000.