Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking Kubernetes 1.25 clusters fails due to PodSecurityPolicy #236

Closed
djablonski-moia opened this issue Nov 14, 2022 · 3 comments
Closed

Comments

@djablonski-moia
Copy link
Contributor




Describe the bug

When checking a cluster that is running Kubernetes 1.25, popeye fails with the following error message:

Boom! No resource meta found for policy/v1beta1/podsecuritypolicies

This is obviously due to the fact that PSPs have been removed from K8s 1.25.

To Reproduce

Just run popeye without any params against a 1.25 cluster

Expected behavior

Results being displayed

Screenshots

none

Versions (please complete the following information):

  • OS: OSX 12.6.1
  • Popeye 0.10.1
  • K8s 1.25.4

Additional context
Add any other context about the problem here.

@jorgeuos
Copy link

jorgeuos commented Dec 9, 2022

For now, I just commented out the policy/v1beta1/podsecuritypolicies. Which is probably not a longterm solution, but at least I can run popeye now.

Diff:

diff --git a/pkg/popeye.go b/pkg/popeye.go
index 03f32e4..dc5ad9f 100644
--- a/pkg/popeye.go
+++ b/pkg/popeye.go
@@ -126,7 +126,7 @@ func (p *Popeye) scannedGVRs(rev *client.Revision) []string {
                "apps/v1/replicasets",
                "apps/v1/daemonsets",
                "apps/v1/statefulsets",
-               "policy/v1beta1/podsecuritypolicies",
+               // "policy/v1beta1/podsecuritypolicies",
                "networking.k8s.io/v1/networkpolicies",
                "rbac.authorization.k8s.io/v1/clusterroles",
                "rbac.authorization.k8s.io/v1/clusterrolebindings",
@@ -221,7 +221,7 @@ func (p *Popeye) sanitizers(rev *client.Revision) map[string]scrubFn {
                "apps/v1/statefulsets":                      scrub.NewStatefulSet,
                "networking.k8s.io/v1/networkpolicies":      scrub.NewNetworkPolicy,
                "networking.k8s.io/v1/ingresses":            scrub.NewIngress,
-               "policy/v1beta1/podsecuritypolicies":        scrub.NewPodSecurityPolicy,
+               // "policy/v1beta1/podsecuritypolicies":        scrub.NewPodSecurityPolicy,
                "rbac.authorization.k8s.io/v1/clusterroles": scrub.NewClusterRole,
                "rbac.authorization.k8s.io/v1/clusterrolebindings": scrub.NewClusterRoleBinding,
                "rbac.authorization.k8s.io/v1/roles":               scrub.NewRole,

And then:

go build && go install

Br, Jorge

@shurkanTwo
Copy link

shurkanTwo commented Feb 15, 2023

We are facing a similar issue even though our cluster is running on K8s version v1.24.7+rke2r1.
Though it does not complain about the beta plugin ...

This is the error message we see:
Boom! No resource meta found for policy/v1/podsecuritypolicies

(Checking Kubernetes clusters fails because v1/PodSecurityPolicy is checked, though it does not exist in the K8s API · Issue #245 · derailed/popeye)

@matheusfm
Copy link
Contributor

matheusfm commented Feb 24, 2023

I think this issue is fixed in v0.11.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants