-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add kubelint * Update .travis.yml * Update .travis.yml * Update .travis.yml * update kubelint * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update kubelint-config.yaml * move kubelint download to build * chmod * Update download-kubelint.sh * remove duplicate
- Loading branch information
Showing
3 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
kubelint() { | ||
DEPLOYMENT_DIR="${1}" | ||
KUBELINT_CONFIG="${2}" | ||
KUBELINT_VERSION="${3}" | ||
if [[ -z "${DEPLOYMENT_DIR}" ]]; then | ||
echo "usage: 'kubelint DEPLOYMENT_DIR KUBELINT_CONFIG KUBELINT_VERSION'" | ||
exit 1 | ||
fi | ||
[[ -z "${KUBELINT_VERSION}" ]] && KUBELINT_VERSION=latest | ||
[[ -z "${KUBELINT_CONFIG}" ]] && KUBELINT_CONFIG=kubelint-config.yaml | ||
mkdir -p "${HOME}/bin" | ||
curl -sL -o "${HOME}/bin/kube-linter" "https://github.com/stackrox/kube-linter/releases/${KUBELINT_VERSION}/download/kube-linter-linux" | ||
chmod +x "${HOME}/bin/kube-linter" | ||
if [[ "$FAIL_ON_INVALID_RESOURCE" = "false" ]]; then | ||
kube-linter lint -v --fail-if-no-objects-found "${DEPLOYMENT_DIR}" --config "${KUBELINT_CONFIG}" | ||
else | ||
kube-linter lint -v --fail-on-invalid-resource --fail-if-no-objects-found "${DEPLOYMENT_DIR}" --config "${KUBELINT_CONFIG}" | ||
fi | ||
} | ||
mkdir -p "${HOME}/bin" | ||
echo -e "#!/bin/bash\n$(declare -f kubelint)\nkubelint \"\$@\"" > "${HOME}/bin/kubelint" | ||
chmod +x "${HOME}/bin/kubelint" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
checks: | ||
exclude: | ||
- "no-read-only-root-fs" # impacts AT event writing | ||
- "unset-cpu-requirements" # cpu limits are bad https://home.robusta.dev/blog/stop-using-cpu-limits | ||
- "mismatching-selector" # selectors are immutable | ||
- "non-existent-service-account" # razeedeploy-sa created in razeedeploy-delta | ||
customChecks: | ||
- name: ensure-environment-variables-populated | ||
template: env-var | ||
params: | ||
name: "." | ||
value: \$.* #ensures no environment variable values in the deployment start with a $ | ||
remediation: Ensure all of your environment variables are correctly substituted with envstub | ||
scope: | ||
objectKinds: | ||
- DeploymentLike |