The linkerd2 helm chart defines variables global.proxyInit.resources.cpu/memory to use when injecting the linkerd-init container to a pod. However, after deploying the linkerd2 chart alongside my own service (with auto-injection configured), the linkerd-init container is using default values.
I noticed that the linkerd pods themselves (e.g. controller, proxy-injector, etc.) do have the CPU / memory values that I configured for the proxyInit container, but the init container that linkerd's injector deploys is just using the defaults.
This has implications for pod QoS -- according to the docs, a pod can only be the Guaranteed class if the sum of all memory and CPU requests and limits in the pod are equal. As of this kubelet PR, init containers are included in this calculation.
In other words, without being able to configure the init container's resources, we are unable to deploy "Guaranteed" QoS pods; we can only get Burstable.
proxyInit.resources vars in values.yaml.linkerd-init container; they will not match the values specified in values.yaml, they will instead be the defaults [10 Mi, 50 Mi], [10m, 100m].linkerd check outputevan @ ?130 linkerd % linkerd check
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-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-addons
--------------
โ 'linkerd-config-addons' config map exists
linkerd-grafana
---------------
โ grafana add-on service account exists
โ grafana add-on config map exists
โ grafana pod is running
Status check results are โ
If we add a proxyInitResourceRequirements() method to the ResourceConfig receiver, mirrored after the existing method, we should be able to dynamically inject these values into the l5dcharts.ProxyInit struct instead of using constants.
@evanfuller Thanks for the detailed error report. You are right, Currently, We are not actually storing the proxyInit resources in the linkerd-config which can be retrieved and applied later on. This configuration is only honored for the proxyInit of the Linkerd control-plane as of now.
As this affects the QoS stuff, It makes sense to honor and store this configuration across injections.
Also, We have been working on a new config format (See #4911) where we store all overridden values, and I was wondering if this would be fixed directly :thinking:
Looks like only the storing will be fixed, but retrieval and usage has to be still updated as we set to the defaults currently? WDYT @adleong
@Pothulapati Is there any status update on this ticket? I see the label 2.9 on the issue; can you give a rough time window for when the team hopes to release 2.9?
Hey @evanfuller
Once #5005 lands, I will update the injection to also use the proxyInit.resources configuration. If things go well, This should land in this week's edge release and The plan is to release 2.9 by the end of this month. :) Hope that clarifies your question.
@evanfuller I just verified this on main by modifying proxyInit.resources and installing Linkerd and then It also applied the same config on injection. This is fixed part of https://github.com/linkerd/linkerd2/commit/41c1fc65b0ef680e96fe5f5930b81adf5ce92f0f
kind-kind in linkerd2 on ๎ main [$!?] via ๐น v1.14.9
โฏ k -n linkerd describe cm linkerd-config | grep proxyInit -A 15
proxyInit:
closeWaitTimeoutSecs: 0
ignoreInboundPorts: ""
ignoreOutboundPorts: ""
image:
name: ghcr.io/linkerd/proxy-init
pullPolicy: IfNotPresent
version: v1.3.6
resources:
cpu:
limit: 103m
request: 11m
memory:
limit: 53Mi
request: 13Mi
xtMountPath:
kind-kind in linkerd2 on ๎ main [$!?] via ๐น v1.14.9
โฏ k -n emojivoto describe pod emoji-7dc976587b-f2vzb | grep -A 30 linkerd-init
linkerd-init:
Container ID: containerd://cbd4e055a9ee4f063fce041923fa0820be12d96ac61049e2e6145b9bbec328b9
Image: ghcr.io/linkerd/proxy-init:v1.3.6
Image ID: ghcr.io/linkerd/proxy-init@sha256:591d4f578a8c4431fc6343c8f2703338888865440f02f4cb44862a87c5557859
Port: <none>
Host Port: <none>
Args:
--incoming-proxy-port
4143
--outgoing-proxy-port
4140
--proxy-uid
2102
--inbound-ports-to-ignore
4190,4191
State: Terminated
Reason: Completed
Exit Code: 0
Started: Tue, 13 Oct 2020 23:46:30 +0530
Finished: Tue, 13 Oct 2020 23:46:30 +0530
Ready: True
Restart Count: 0
Limits:
cpu: 103m
memory: 53Mi
Requests:
cpu: 11m
memory: 13Mi
Environment: <none>
Mounts:
I'm closing this now as its fixed. This should land in this week's edge (which goes day after tomorrow). Feel free try it out and re-open the issue if you have any problem! :+1:
Most helpful comment
@evanfuller I just verified this on main by modifying
proxyInit.resourcesand installing Linkerd and then It also applied the same config on injection. This is fixed part of https://github.com/linkerd/linkerd2/commit/41c1fc65b0ef680e96fe5f5930b81adf5ce92f0fI'm closing this now as its fixed. This should land in this week's edge (which goes day after tomorrow). Feel free try it out and re-open the issue if you have any problem! :+1: