All Projects â†’ digitalocean â†’ Clusterlint

digitalocean / Clusterlint

Licence: apache-2.0
A best practices checker for Kubernetes clusters. 🤠

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Clusterlint

Spotbugs
SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.
Stars: ✭ 2,569 (+528.12%)
Mutual labels:  linter, hacktoberfest
Swift-Coding-Guidelines
A repository to collect best practices when programming with Swift
Stars: ✭ 17 (-95.84%)
Mutual labels:  best-practices, linter
Revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
Stars: ✭ 3,139 (+667.48%)
Mutual labels:  linter, hacktoberfest
Wemake Python Styleguide
The strictest and most opinionated python linter ever!
Stars: ✭ 1,714 (+319.07%)
Mutual labels:  linter, hacktoberfest
Go Consistent
Source code analyzer that helps you to make your Go programs more consistent.
Stars: ✭ 293 (-28.36%)
Mutual labels:  linter, best-practices
Abaplint
Standalone linter for ABAP
Stars: ✭ 111 (-72.86%)
Mutual labels:  linter, hacktoberfest
rubocop-graphql
Rubocop extension for enforcing graphql-ruby best practices
Stars: ✭ 143 (-65.04%)
Mutual labels:  best-practices, linter
Vscode Gremlins
Gremlins tracker for Visual Studio Code: reveals invisible whitespace and other annoying characters
Stars: ✭ 78 (-80.93%)
Mutual labels:  linter, hacktoberfest
Coala Bears
Bears for coala
Stars: ✭ 276 (-32.52%)
Mutual labels:  linter, hacktoberfest
Tlint
Tighten linter for Laravel conventions
Stars: ✭ 274 (-33.01%)
Mutual labels:  linter, hacktoberfest
Doc8
Style checker for sphinx (or other) rst documentation.
Stars: ✭ 105 (-74.33%)
Mutual labels:  linter, hacktoberfest
Isort
A Python utility / library to sort imports.
Stars: ✭ 4,377 (+970.17%)
Mutual labels:  linter, hacktoberfest
Pre Commit Hooks
A set of useful (and documented!) git pre-commit hooks.
Stars: ✭ 95 (-76.77%)
Mutual labels:  linter, best-practices
Editorconfig Checker
A tool to verify that your files are in harmony with your .editorconfig
Stars: ✭ 119 (-70.9%)
Mutual labels:  linter, hacktoberfest
Rubberduck
Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
Stars: ✭ 1,287 (+214.67%)
Mutual labels:  linter, hacktoberfest
mllint
`mllint` is a command-line utility to evaluate the technical quality of Python Machine Learning (ML) projects by means of static analysis of the project's repository.
Stars: ✭ 67 (-83.62%)
Mutual labels:  best-practices, linter
Validator
Nu Html Checker – Helps you catch problems in your HTML/CSS/SVG
Stars: ✭ 1,024 (+150.37%)
Mutual labels:  linter, best-practices
Psscriptanalyzer
Download ScriptAnalyzer from PowerShellGallery
Stars: ✭ 1,137 (+178%)
Mutual labels:  linter, hacktoberfest
Wotan
Pluggable TypeScript and JavaScript linter
Stars: ✭ 271 (-33.74%)
Mutual labels:  linter, best-practices
Hint
💡 A hinting engine for the web
Stars: ✭ 3,280 (+701.96%)
Mutual labels:  hacktoberfest, best-practices

Clusterlint

CircleCI

As clusters scale and become increasingly difficult to maintain, clusterlint helps operators conform to Kubernetes best practices around resources, security and reliability to avoid common problems while operating or upgrading the clusters.

Clusterlint queries live Kubernetes clusters for resources, executes common and platform specific checks against these resources and provides actionable feedback to cluster operators. It is a non invasive tool that is run externally. Clusterlint does not alter the resource configurations.

Background

Kubernetes resources can be configured and applied in many ways. This flexibility often makes it difficult to identify problems across the cluster at the time of configuration. Clusterlint looks at live clusters to analyze all its resources and report problems, if any.

There are some common best practices to follow while applying configurations to a cluster like:

  • Namespace is used to limit the scope of the Kubernetes resources created by multiple sets of users within a team. Even though there is a default namespace, dumping all the created resources into one namespace is not recommended. It can lead to privilege escalation, resource name collisions, latency in operations as resources scale up and mismanagement of kubernetes objects. Having namespaces ensures that resource quotas can be enabled to keep track node, cpu and memory usage for individual teams.

  • Always specify resource requests and limits on pods: When containers have resource requests specified, the scheduler can make better decisions about which nodes to place pods on. And when containers have their limits specified, contention for resources on a node can be handled in a specified manner.

While there are problems that are common to clusters irrespective of the environment they are running in, the fact that different Kubernetes configurations (VMs, managed solutions, etc.) have different subtleties affect how workloads run. Clusterlint provides platform specific checks to identify issues with resources that cluster operators can fix to run in a specific environment.

Some examples of such checks are:

  • On upgrade of a cluster on DOKS, the worker nodes' hostname changes. So, if a user's pod spec relies on the hostname to schedule pods on specific nodes, pod scheduling will fail after upgrade.

Please refer to checks.md to get some background on every check that clusterlint performs.

Install

go get github.com/digitalocean/clusterlint/cmd/clusterlint

The above command creates the clusterlint binary in $GOPATH/bin

Usage

clusterlint list [options]  // list all checks available
clusterlint run [options]  // run all or specific checks

Specific checks and groups

All checks that clusterlint performs are categorized into groups. A check can belong to multiple groups. This framework allows one to only run specific checks on a cluster. For instance, if a cluster is running on DOKS, then, running checks specific to AWS does not make sense. Clusterlint can blacklist aws related checks, if any while running against a DOKS cluster.

clusterlint run -g basic                // runs only checks that are part of the basic group
clusterlint run -G security            // runs all checks that are not part of the security group
clusterlint run -c default-namespace  // runs only the default-namespace check
clusterlint run -C default-namespace // exclude default-namespace check

Disabling checks via Annotations

Clusterlint provides a way to ignore some special objects in the cluster from being checked. For example, resources in the kube-system namespace often use privileged containers. This can create a lot of noise in the output when a cluster operator is looking for feedback to improve the cluster configurations. In order to avoid such a situation where objects that are exempt from being checked, the annotation clusterlint.digitalocean.com/disabled-checks can be added in the resource configuration. The annotation takes in a comma separated list of check names that should be excluded while running clusterlint.

"metadata": {
  "annotations": {
    "clusterlint.digitalocean.com/disabled-checks" : "noop,bare-pods"
  }
}

Building local checks

Some individuals and organizations have Kubernetes best practices that are not applicable to the general community, but which they would like to check with clusterlint. If your check may be useful for anyone else, we encourage you to submit it to clusterlint rather than keeping it local. However, if you have a truly specific check that is not appropriate for sharing with the broader community, you can implement it using Go plugins.

See the example plugin for documentation on how to build a plugin. Please be sure to read the caveats and consider whether you really want to maintain a plugin.

To use your plugin with clusterlint, pass its path on the commandline:

$ clusterlint --plugins=/path/to/plugin.so list
$ clusterlint --plugins=/path/to/plugin.so run -c my-plugin-check

Contributing

Contributions are welcome, in the form of either issues or pull requests. Please see the contribution guidelines for details.

License

Copyright 2019 DigitalOcean

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].