Create `kubectl lint` command #39699

Open
pwittrock opened this Issue Jan 11, 2017 · 8 comments

Projects

None yet

5 participants

@pwittrock
Member

There are a number of best practices for creating config files, but they are not enforced by the API. It would be helpful to have a kubectl lint command to check for basic best practices and give warnings

Things to check for

  • Deployments specify max old replicas
  • Deployments specify both selectors and PT.labels (not just the labels)
  • Service ports always have names
  • Configs comment out / remove values for objects managed by other actors (e.g. replicas if managed by HPA) - do we want to do this
@jessfraz jessfraz was assigned by pwittrock Jan 11, 2017
@krmayankk
Contributor

may be a vim plugin that catches errors in json or yaml will also help. I find it very hard when creating new configs and have nothing to copy from

@kargakis
Member

may be a vim plugin that catches errors in json or yaml will also help. I find it very hard when creating new configs and have nothing to copy from

A vim plugin will work only for people who use vim.

@viglesiasce

I have started to work on a prototype of this but will be keeping it out of tree for now. Will post back with the repo after I do a bit more cleanup.

@viglesiasce

@jessfraz happy to sync with you to show you where my thinking is leading me ATM.

@pwittrock
Member

@krmayankk I am thinking of another solution for initializing configs. Something like:

kubectl create deployment mydeployment --replicas 2 --image nginx --dry-run > mydeployment.yaml
@jessfraz
Contributor

neat @viglesiasce!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment