Closed LarsBingBong closed 2 years ago
@LarsBingBong Could you describe here warnings you got for not having resource limit in deployment file?
Sure ... I'm using [datree]() a Kubernetes YAML linter and quality tool. The warning I get is:
[K>> File: infrastructure-services/storage/velero/server/csi-snapshot-support/setup-snapshot-controller.yaml
[V] YAML validation
[V] Kubernetes schema validation
[X] Policy check
❌ Ensure each container has a configured memory request [1 occurrence]
— metadata.name: snapshot-controller (kind: Deployment)
💡 Missing property object `requests.memory` - value should be within the accepted boundaries recommended by the organization
❌ Ensure each container has a configured CPU request [1 occurrence]
— metadata.name: snapshot-controller (kind: Deployment)
💡 Missing property object `requests.cpu` - value should be within the accepted boundaries recommended by the organization
❌ Ensure each container has a configured memory limit [1 occurrence]
— metadata.name: snapshot-controller (kind: Deployment)
💡 Missing property object `limits.memory` - value should be within the accepted boundaries recommended by the organization
❌ Ensure each container has a configured CPU limit [1 occurrence]
— metadata.name: snapshot-controller (kind: Deployment)
💡 Missing property object `limits.cpu` - value should be within the accepted boundaries recommended by the organization
❌ Ensure each container has a configured liveness probe [1 occurrence]
— metadata.name: snapshot-controller (kind: Deployment)
💡 Missing property object `livenessProbe` - add a properly configured livenessProbe to catch possible deadlocks
❌ Ensure each container has a configured readiness probe [1 occurrence]
— metadata.name: snapshot-controller (kind: Deployment)
💡 Missing property object `readinessProbe` - add a properly configured readinessProbe to notify kubelet your Pods are ready for traffic
(Summary)
- Passing YAML validation: 1/1
- Passing Kubernetes (1.18.0) schema validation: 1/1
- Passing policy check: 0/1
This output can be seen in the console of my IDE as Datree executes as part of a git pre-commit hook.
Also, I got this very telling and good answer over on Slack. Mr. Patrick Ohly answering ( part of the answer ):
The problem is that any kind of limit will be rather arbitrary. The actual limits depend on the kind of load that the sidecar will have to handle. This is something that cannot be generalized easily.We have an issue open for the csi hostpath driver example deployments, with no good solution....
I hope that clarifies it.
Add this issue here for reference: https://github.com/kubernetes-csi/csi-driver-host-path/issues/47
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closing this issue.
I can see that there are no resource limit section in the workload spun up by this deployment.
Is that on purpose?
I have a Kubernetes linting tool warning me of this and in general, I thought this to be a best practice. Or is that a special case?
Looking forward to hearing from you.
Thank you very much