CRDs cause errors (both for RBAC and SUPPORTED_API_VERSIONS)
See original GitHub issueThe connaisseur webhook seems to intercept any CREATE/UPDATE operations, even those to CRDs. However, the clusterolebinding doesn’t have access to “get” these resources, and this creates errors like this:
[2022-03-17 04:47:13,564] ERROR: Traceback (most recent call last):
File "/app/connaisseur/flask_application.py", line 71, in mutate
response = asyncio.run(__admit(admission_request))
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
return future.result()
File "/app/connaisseur/flask_application.py", line 139, in __admit
await patches
File "/app/connaisseur/flask_application.py", line 165, in __validate_image
image in admission_request.wl_object.parent_containers.values()
File "/app/connaisseur/workload_object.py", line 68, in parent_containers
parent = k_api.request_kube_api(
File "/app/connaisseur/kube_api.py", line 22, in request_kube_api
response.raise_for_status()
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://10.96.0.1:443/apis/vault.banzaicloud.com/v1alpha1/namespaces/preview-notifications-pr-7/vaults/vault
Expected behavior
Since we already have a preset list of objects we allow connaisseur to watch, connaisseur should only respond to these objects, not all objects.
Optional: To reproduce
- Deploy connaisseur
- Add any service which uses CRDs to specify images (the above example uses banzaicloud’s bank-vaults)
- Watch connaisseur logs
- Deploy a CR for the service, and observe the error
Optional: Versions (please complete the following information as relevant):
- Connaisseur: 2.5.1
Optional: Additional context
As a test, I manually edited the clusterrole to permit get
to all the CRDs we use. In the example below, minio-operator’s Tenant CR was used. Although connaisseur was able to get
the object, it still produced an error:
[2022-03-17 01:57:30,798] ERROR: Traceback (most recent call last):
File "/app/connaisseur/flask_application.py", line 71, in mutate
response = asyncio.run(__admit(admission_request))
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
return future.result()
File "/app/connaisseur/flask_application.py", line 139, in __admit
await patches
File "/app/connaisseur/flask_application.py", line 165, in __validate_image
image in admission_request.wl_object.parent_containers.values()
File "/app/connaisseur/workload_object.py", line 81, in parent_containers
parent_containers.update(WorkloadObject(parent, self.namespace).containers)
File "/app/connaisseur/workload_object.py", line 40, in __init__
if self.api_version not in SUPPORTED_API_VERSIONS[self.kind]:
KeyError: 'Tenant'
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
error GitRepository/flux-system.flux-system · Issue #87 - GitHub
I have been following the automation tutorial.
Read more >Chapter 22. Clusters at the network far edge
Installing and deploying the clusters is a two-stage process, involving an initial installation phase, and a subsequent configuration phase.
Read more >Kubernetes 1.22 deprecated APIs - Google Cloud
Migrate manifests and API clients to use the rbac.authorization.k8s.io/v1 API ... user agents that use the deprecated APIs to use supported API versions....
Read more >Release notes | Logging | OpenShift Container Platform 4.11
This release includes OpenShift Logging Bug Fix Release 5.3.11. Bug fixes. Before this update, the Operator did not ensure that the pod was...
Read more >Kubernetes Role-Based Access Control (RBAC) - StrongDM
Explanation of role-based access control (RBAC) in Kubernetes, why it is hard to manage manually & practical strategies for simplifying RBAC ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks heaps, @xopham,
-rc3
seems to work as expected 😃Hi @xopham,
Sure, here’s a really minimal reproduction, tested using KinD:
Output is something like this: