Commit Graph

271 Commits (91df975aee3485145f63570d002161ae0ff9d80e)

Author SHA1 Message Date
Adam Wolfe Gordon 91df975aee Return the correct node names in the node labels and taints check
Previously a loop variable was being used for the node name in the diagnostic
returned from the node labels and taints check. If the offending node wasn't the
last one in the list, the wrong node name would be returned.

Add a test to reproduce the issue, and copy the loop variable to fix it.
2022-02-24 16:16:06 -07:00
Sharmita Das 7769a03544
Merge pull request #136 from digitalocean/sdas/check-added-to-overview
Cluster linter checks in node's Overview tab
2022-02-08 11:43:59 -05:00
Sharmita Das 65671f2138 Update contet for PDOCS-1370 2022-02-07 17:38:16 -05:00
Collin Shoop 76507549b7
Merge pull request #135 from digitalocean/cshoop/remove-v1beta1-admission-controller-webhooks
Remove v1beta1 admission/controller webhook checks
2022-01-26 12:09:22 -05:00
Collin Shoop 7f663e5c23 Remove v1beta1 admission/controller webhook checks 2022-01-26 11:20:30 -05:00
Varsha Varadarajan 394f0bc265
Merge pull request #134 from digitalocean/varsha/clusterlint-dockerfile
add dockerfile to build the clusterlint image to use in-cluster
2022-01-26 10:01:24 -05:00
Varsha Varadarajan 376bbebba1
Merge pull request #132 from digitalocean/varshavaradarajan-add-darwin-arm64
Cross compile clusterlint for darwin arm64
2022-01-18 15:59:47 -05:00
Varsha Varadarajan 8927abd07d add dockerfile to build the clusterlint image to use in-cluster 2022-01-18 15:58:27 -05:00
Varsha Varadarajan a7a723028a
Merge pull request #129 from sundowndev/feat/in-cluster
Add the ability to run in-cluster
2022-01-18 15:52:21 -05:00
Varsha Varadarajan c1e8541783
Cross compile clusterlint for darwin arm64 2022-01-12 21:19:52 -05:00
Collin Shoop dbed5ed5de
Merge pull request #131 from digitalocean/cshoop/update-k8s-0.22.5
Upgrade kubernetes dependencies to 0.22.5
2022-01-12 15:03:01 -05:00
Collin Shoop b1be746dfa Upgrade kubernetes dependencies to 0.22.5 2022-01-11 12:12:34 -05:00
sundowndev 1517859b74
docs: running in-cluster with RBAC 2021-12-20 16:13:45 +04:00
sundowndev 15087dbab6
refactor(kube): add in-cluster option validation 2021-12-20 15:43:51 +04:00
Varsha Varadarajan 2564cd4ef7
Merge pull request #130 from digitalocean/varsha/fix-dobs-pod-owner
dobs-pod-owner: initialize loop iterator variable as we are passing by object details by reference
2021-12-10 10:25:27 -05:00
Varsha Varadarajan 1a5de2fdc2 dobs-pod-owner: initialize loop iterator variable as we are passing by object details by reference 2021-12-10 10:22:45 -05:00
sundowndev 3399b475c6 docs: in-cluster usage 2021-11-30 23:08:52 +01:00
sundowndev f55ebf5cba feat: add ability to run in-cluster
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.
2021-11-30 22:56:44 +01:00
Timo Reimann 8e59edeb32
Update dependencies to fix crash on Go 1.17 (#126)
When running clusterlint on Go 1.17, it panics right on startup. The
issue is our usage of github.com/mattn/go-isatty (consumed by
github.com/fatih/color) which had a bug until [1]. Updating to the
latest v0.0.14 release fixes the issue.

Also bump the minimum (library) dependency to 1.16 in go.mod since that
is the oldest, officially supported Go version. Bumping to 1.17 actually
enables us to fix the issue by simply updating to the latest
github.com/fatih/color, as opposed to adding an indirect import of
github.com/mattn/go-isatty which this change does right now (which I
suppose works due to Go 1.17 module management improvements); however,
that'd come at the price of breaking compatibility with 1.16 users which
is non-ideal.
Regardless, update github.com/fatih/color as well while we're here.

Also bump the version of the Go image used for testing.

[1] https://github.com/mattn/go-isatty/pull/66
2021-09-19 16:52:07 +02:00
Timo Reimann c0110ddbbb
Merge pull request #127 from digitalocean/fix-webhook-test-expectations
Fix webhook test expectations
2021-09-19 16:46:00 +02:00
Timo Reimann d0800c1fc4 Fix webhook test expectations
The beta tests need to use the beta expectations as well.
2021-09-19 16:03:08 +02:00
Adam Wolfe Gordon 5eeabb8136
Support both v1beta1 and v1 admission control webhooks (#124)
We have a number of checks that operate on admission control webhook 
configuration. Older clusters support only v1beta1 of admission control, while 
newer clusters support v1. Currently clusterlint fails to run on these older 
clusters because we can't fetch v1 admission control objects from them. 

This change covers the following modifications:

- When listing objects, ignore "not found" errors, which mean the cluster 
  doesn't support the resource we're trying to list.
- Duplicate our existing admission control webhook checks for v1beta1, so that 
  older clusters get the same checks as newer clusters. 
- Enhance the errors we return when listing objects fails so that we can tell 
  which resource we failed to list.
- Remove extraneous empty import: client auth plugins are already loaded in 
  objects.go, so no need for the import in object_filter.go. 
- Ensure all object lists are non-nil after fetching objects. (Since we now 
  ignore not found errors, it's possible for some object lists to be nil.) 
- Skip v1beta1 admission control tests when v1 objects exist.

Co-authored-by: Timo Reimann <treimann@digitalocean.com>
2021-09-19 15:47:35 +02:00
Ingo Gottwald 9cd6ee5887
Merge pull request #123 from digitalocean/ig-webhook-timeout-err-msg
Fix webhook timeout diagnostics message
2021-07-05 18:24:51 +02:00
Ingo Gottwald 98f22c21a7 Fix webhook timeout diagnostics message
The message now includes all tested criteria.
2021-07-05 13:58:50 +02:00
Adam Wolfe Gordon 7d20651046
Merge pull request #121 from digitalocean/awg/k8s-1.21
Update Kubernetes dependencies to 1.21.2
2021-06-22 13:31:19 -06:00
Adam Wolfe Gordon 4712329589 Update Kubernetes dependencies to 1.21.2 2021-06-21 16:34:20 -06:00
Varsha Varadarajan e655114336
Merge pull request #120 from fish-dango/resourceRequirement
Added resource requirement to doks group
2021-06-21 08:14:16 -07:00
fish-dango d0bcc7f160 Added resource requirement to doks group 2021-06-19 19:15:45 -07:00
Adam Wolfe Gordon 6600f6f16f
Merge pull request #118 from digitalocean/sdas/some-edits-checks
Clusterlint checks minor edits
2021-05-25 16:56:42 -06:00
Sharmita Das 3513d3f237 Minor edits 2021-05-25 16:10:39 -04:00
Sharmita Das 4ee6d88ce8
Merge pull request #117 from digitalocean/sdas/checks-edits-1
Clusterlint errors edits
2021-05-20 10:00:52 -04:00
Sharmita Das cde6366b70 Edits 2021-05-19 17:21:37 -04:00
Sharmita Das 6598d0c41c
Merge pull request #116 from digitalocean/sdas/webhooks-timeout-seconds
Update Admission Controller Webhook Timeout
2021-04-26 17:05:09 -04:00
sharmita3 3c1e80cb73 Updated timeout seconds 2021-04-26 17:00:04 -04:00
Varsha Varadarajan 9ffee1bec7
Merge pull request #115 from varshavaradarajan/varsha/update-timeout-check-doc
update  the max timeout seconds for the webhook timeout check doc
2021-02-23 08:35:56 -08:00
Varsha Varadarajan 84f4b228ee update the max timeout seconds for the webhook timeout check doc 2021-02-23 08:22:41 -08:00
Adam Wolfe Gordon 715e046e9f
Merge pull request #114 from WyriHaximus-labs/error-on-images-from-docker.pkg.github.com
Error on images from docker.pkg.github.com
2021-02-16 13:56:24 -07:00
Cees-Jan Kiewiet e009c96c73
Error on images from docker.pkg.github.com
Since Kubernetes 1.20 containerd is used instead of Docker as the container runtime.
Containerd is due to protocol version differences/support/mismatch unabled to
pull images hosted at docker.pkg.github.com. The new check in this commit will
error when it finds an image from that registry, and suggests to use ghcr.io,
which is also hosted and operated by GitHub, and the successor of
docker.pkg.github.com.

Refs:
* https://github.com/containerd/containerd/issues/3291#issuecomment-683700425
* https://docs.github.com/en/packages/guides/migrating-to-github-container-registry-for-docker-images#domain-changes
2021-02-12 09:14:46 +01:00
Adam Wolfe Gordon d0520427cd
Merge pull request #112 from digitalocean/awg/k8s-1.20
vendor: Bump Kubernetes dependencies to v0.20.2
2021-02-08 14:40:15 -07:00
Adam Wolfe Gordon 876d506b00 vendor: Bump Kubernetes dependencies to v0.20.2 2021-02-05 11:58:32 -07:00
Varsha Varadarajan 92efb16416
Merge pull request #110 from varshavaradarajan/update-checks-doc
add dobs-pod-owner check to checks.md
2021-01-06 10:07:36 -08:00
Varsha Varadarajan ae6b279dea add dobs-pod-owner check to checks.md 2021-01-05 13:05:21 -08:00
Varsha Varadarajan ed20e47e10
Merge pull request #108 from varshavaradarajan/unused-secret-sa
unused secrets check - check if secret is referenced in service accounts
2021-01-05 12:48:20 -08:00
Varsha Varadarajan ad20fc18c8
Merge pull request #109 from varshavaradarajan/dobs-check
doks - check if pod referencing dobs volumes are owned by a statefulset
2021-01-05 12:42:57 -08:00
Varsha Varadarajan ef03e37686 doks - check if pod referencing dobs volumes are owned by a statefulset 2021-01-05 12:41:28 -08:00
Varsha Varadarajan 37af3b316a
Merge pull request #105 from varshavaradarajan/use-stable-webhook-client
Use admissionregistration/v1 client to fetch webhooks
2021-01-05 12:13:33 -08:00
Varsha Varadarajan 3c3921eadf unused secrets check - check if secret is referenced in service accounts 2020-12-22 10:19:52 -08:00
Varsha Varadarajan 9fb4ad9bc4
Merge pull request #103 from stephenpaulger/envvar-secret-key-ref
Check env vars for secret key references
2020-12-21 14:26:40 -08:00
Stephen Paulger 964b011a20 Add tests for env var secrets in init containers 2020-12-21 21:17:01 +00:00
Varsha Varadarajan 95e7d57b51 Use admissionregistration/v1 client to fetch webhooks
* Do not fetch unused ComponentStatuses
2020-12-21 12:38:18 -08:00