Static analysis for Kubernetes
KubeLinter analyzes Kubernetes YAML files and Helm charts, and checks them against a variety of best practices, with a focus on production readiness and security.
KubeLinter runs sensible default checks, designed to give you useful information about your Kubernetes YAML files and Helm charts. This is to help teams check early and often for security misconfigurations and DevOps best practices. Some common examples of these include running containers as a non-root user, enforcing least privilege, and storing sensitive information only in secrets.
KubeLinter is configurable, so you can enable and disable checks, as well as create your own custom checks, depending on the policies you want to follow within your organization.
When a lint check fails, KubeLinter reports recommendations for how to resolve any potential issues and returns a non-zero exit code.
Visit https://docs.kubelinter.io for detailed documentation on installing, using and configuring KubeLinter.
To install using Go, run the following command:
GO111MODULE=on go get golang.stackrox.io/kube-linter/cmd/kube-linter
Otherwise, download the latest binary from Releases and add it to yourPATH.
To install using Homebrew or LinuxBrew, run the following command:
brew install kube-linter
Installing KubeLinter from source is as simple as following these steps:
First, clone the KubeLinter repository.
git clone git@github.com:stackrox/kube-linter.git
Then, compile the source code. This will create the kube-linter binary files for each platform and places them in the .gobin
folder.
make build
Finally, you are ready to start using KubeLinter. Verify your version to ensure you've successfully installed KubeLinter.
.gobin/kube-linter version
Running KubeLinter to Lint your YAML files only requires two steps in its most basic form.
Locate the YAML file you'd like to test for security and production readiness best practices:
Run the following command:
kube-linter lint /path/to/your/yaml.yaml
Consider the following sample pod specification file pod.yaml
. This file has two production readiness issues and one security issue:
Security Issue:
Production readiness:
The container's CPU limits are not set, which could allow it to consume excessive CPU.
The container's memory limits are not set, which could allow it to consume excessive memory
apiVersion: v1
kind: Pod
metadata:
name: security-context-demo
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
volumes:
- name: sec-ctx-vol
emptyDir: {}
containers:
- name: sec-ctx-demo
image: busybox
resources:
requests:
memory: "64Mi"
cpu: "250m"
command: [ "sh", "-c", "sleep 1h" ]
volumeMounts:
- name: sec-ctx-vol
mountPath: /data/demo
securityContext:
allowPrivilegeEscalation: false
Copy the YAML above to pod.yaml and lint this file by running the following command:
kube-linter lint pod.yaml
KubeLinter runs its default checks and reports recommendations. Below is the output from our previous command.
pod.yaml: (object: <no namespace>/security-context-demo /v1, Kind=Pod) container "sec-ctx-demo" does not have a read-only root file system (check: no-read-only-root-fs, remediation: Set readOnlyRootFilesystem to true in your container's securityContext.)
pod.yaml: (object: <no namespace>/security-context-demo /v1, Kind=Pod) container "sec-ctx-demo" has cpu limit 0 (check: unset-cpu-requirements, remediation: Set your container's CPU requests and limits depending on its requirements. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ #requests-and-limits for more details.)
pod.yaml: (object: <no namespace>/security-context-demo /v1, Kind=Pod) container "sec-ctx-demo" has memory limit 0 (check: unset-memory-requirements, remediation: Set your container's memory requests and limits depending on its requirements. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ #requests-and-limits for more details.)
Error: found 3 lint errors
To learn more about using and configuring KubeLinter, visit the documentation page.
The following are tutorials on KubeLinter written by users. If you have one that you would like to add to this list, please send a PR!
If you would like to engage with the KubeLinter community, including maintainers and other users, you can join the Slack workspace here.
To contribute, check out our contributing guide.
As a reminder, all participation in the KubeLinter community is governed by our code of conduct.
KubeLinter is at an early stage of development. There may be breaking changes inthe future to the command usage, flags, and configuration file formats. However,we encourage you to use KubeLinter to test your environment YAML files, see whatbreaks, and contribute.
KubeLinter is licensed under the Apache License 2.0.
KubeLinter is made with
If you're interested in KubeLinter, or in any of the other cool things we do, please know that we're hiring!Check out our open positions. We'd love to hear from you!
Kube 足够的简单,足够小,具有很强的自适应能力,是个响应式的 CSS 框架。它拥有最新最炫的网格和漂亮的字体排版,没有任何样式绑定,给用户以绝对的自由。 支持的浏览器包括: Latest Chrome Latest Firefox Latest Safari Latest Opera IE 8+ 手机浏览器
Kube-OVN 将基于 OVN/OVS 的网络虚拟化方案带入 Kubernetes,提供了针对企业应用场景的高级容器网络编排功能。 主要功能: 基于Namespace的子网划分,以及网络控制 容器固定 IP IPv6支持 细粒度网络策略 动态 QoS 分布式和集中式网关 内嵌负载均衡器 支持集群内外网络直通 控制平面的灾备及高可用 丰富的监控和链路追踪工具 未来计划: 基于 XDP/DPDK/O
kube-eventer 是一个事件发射器,它将 Kubernetes 事件发送到接收器(例如,DingTalk、SLS、Kafka 等)。 监控是保障系统稳定性的重要组成部分,在 Kubernetes 开源生态中,资源类的监控工具与组件百花齐放,但是,只有资源类的监控是远远不够的,因为资源监控存在如下两个主要的缺欠: 监控的实时性与准确性不足 监控的场景覆盖范围不足 Kubernetes 的核心
kube-backup Quick 'n dirty kubernetes state backup script, designed to be ran as kubernetes Job. Think of it like RANCID for kubernetes. Props to @gianrubio for coming up with the idea. Setup Use the
kube-ps1: Kubernetes prompt for bash and zsh A script that lets you add the current Kubernetes context and namespaceconfigured on kubectl to your Bash/Zsh prompt strings (i.e. the $PS1). Inspired by s
�� Provision a Kubernetes / CoreOS Cluster on Linode Automatically provision a scalable CoreOS/Kubernetes cluster on Linode with zero configuration. The cluster will comprise of a single Kubernetes ma