kube-score
kube-score copied to clipboard
idea: automatically inject improvements
Many tests could easily modify the input object to add the improvements automatically.
For example the "X-has-host-podantiaffinity" tests:
With an input like:
apiVersion: apps/v1
kind: Deployment
metadata:
name: foobar
spec:
replicas: 10
template:
metadata:
labels:
app: foo
spec:
containers:
- name: foobar
image: foo:bar
The following affinity rule could be added fairly easily:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app: foo
topologyKey: kubernetes.io/hostname
The hardest part with this, is to preserve as much of the original YAML (comments etc) as possible. I don't know at the moment if there are any tools that will make this easier.
@zegl lets work on this feature together ?
@s-m-sufyian Sure, do you have any ideas for how to solve this in a reasonable way?
@zegl I think , best practices are more subjective , There should be some common practices which any company should be able to override , lets call this policies/rules . Rules and policies which will not be overridden , will be taken from the base policy or standard .