digitalocean / clusterlint

A best practices checker for Kubernetes clusters. 🤠
Apache License 2.0
542 stars 45 forks source link

Add the ability to run in-cluster #129

Closed sundowndev closed 2 years ago

sundowndev commented 2 years ago

Following https://github.com/digitalocean/clusterlint/issues/128

Until now, clusterlint was designed to be run locally using a kubeconfig file to access the Kubernetes API. But some users may want to run it in-cluster so it can be run as a CronJob for example.

Note to reviewers:

varshavaradarajan commented 2 years ago

Thanks for the PR, @sundowndev! Can you please address the comments above? I'll test and release this once all the review is addressed.

sundowndev commented 2 years ago

@varshavaradarajan Thanks for the review. I've addressed your comments and pushed 2 more commits. Can you answer to the question I've raised in the description ? We need a Docker image in order to run in-cluster.

I've created a dedicated documentation file for the example with RBAC enabled, because it was way too long for the readme. Let me know what you think about it. Please review the manifests carefully, I didn't test them.

varshavaradarajan commented 2 years ago

@sundowndev - thanks, we need to add a multi-stage dockerfile to build the clusterlint cli and add to to the entrypoint. Then , we can add github actions to push the docker image to digitalocean/clusterlint. I'll raise a PR for it by eow and have both merged.

varshavaradarajan commented 2 years ago

@sundowndev - tested the in-cluster version. I will merge this and add the dockerfile to build the clusterlint image. The only change in the cronjob spec that I suggest would be to add command, because users should decide which checks or check groups they want to run. I'll do that change in the following PR when I add the dockerfile.