Skip to content

Constraints object in log contains empty field after k8s gke upgrade #1801

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

Closed
andrewdmcleod opened this issue Jan 20, 2022 · 7 comments
Closed
Labels
bug Something isn't working stale

Comments

@andrewdmcleod
Copy link

andrewdmcleod commented Jan 20, 2022

  1. Upgraded GKE K8S cluster from v1.19.15 to v1.20.12
  2. Noticed logs were not being ingested into logstash due to an Invalid FieldReference on [log][constraints][].
  3. Tracked it down to this difference in gatekeeper logs:

1.19.15:

"constraints":{"/apis/constraints.gatekeeper.sh/v1beta1/REDACTED/ALSO-REDACTED":{"Object":{"apiVersion":"constraints.gatekeeper.sh/v1beta1"...

1.20.12:

"constraints":{"":{"Object":{"apiVersion":"constraints.gatekeeper.sh/v1beta1"...

Empty field in constraints object in the log (right there before Object) - missing what looks like used to be selfLink - causing problems with upstream log handling.

Expect that field should have selfLink or KindVersionResource, or similar, not empty?

  • Gatekeeper version:

3.2.2 and 3.7.0 - problem exists with both versions

working env:
Server Version: version.Info{Major:"1", Minor:"19+", GitVersion:"v1.19.16-gke.1500",

not-working env:
Server Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.12-gke.1500",

@andrewdmcleod andrewdmcleod added the bug Something isn't working label Jan 20, 2022
@maxsmythe
Copy link
Contributor

So this is a function of the K8s version, not Gatekeeper version? I wonder if the output of an API call changed.

Can you give more of the relevant log line to help determine which line of code it's associated with?

@andrewdmcleod
Copy link
Author

Right it appears to be the k8s version, and re the log, sorry, of course:

gatekeeper-audit-fc66fd9c8-ng2xg manager {"level":"info","ts":1642607791.6829793,"logger":"controller","msg":"starting update constraints loop","process":"audit","audit_id":"2022-01-19T15:55:47Z","constraints":{"":{"Object":{"apiVersion":"constraints.gatekeeper.sh/v1beta1"........................

https://github.com/open-policy-agent/gatekeeper/blob/master/pkg/audit/manager.go#L816

@ritazh
Copy link
Member

ritazh commented Jan 21, 2022

selfLink has been disabled in v1.20.0
kubernetes/enhancements#1164

I can take a look at this and report back with a fix.

@andrewdmcleod
Copy link
Author

Thanks! I assume this also applies to 1.21? Have not yet tested this myself

@ritazh
Copy link
Member

ritazh commented Jan 31, 2022

@andrewdmcleod That's right. From the KEP:

In v1.20 (12 months and 4 release from v1.16) we will switch off the feature gate which will automatically disable setting SelfLinks. However it will still be possible to revert the behavior by changing value of a feature gate.

In v1.21, we will get rid of the whole code propagating those fields and fields themselves. In the meantime, we will go over places referencing that field (see below) and get rid of those too.

@stale
Copy link

stale bot commented Jul 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 23, 2022
@ritazh ritazh added stale and removed wontfix This will not be worked on labels Aug 10, 2022
@stale stale bot removed the stale label Aug 10, 2022
@stale
Copy link

stale bot commented Oct 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 11, 2022
@stale stale bot closed this as completed Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy