Issue with replicating certain K8S resources into OPA through Kube-mgmt #365
Unanswered
aleksandar-ruskov
asked this question in
OPA and Rego
Replies: 1 comment 3 replies
-
Hi @aleksandar-ruskov, my guess would be that this is related to a permissions issue. Would you be able to share the kube-mgmt logs? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, I have encountered an issue regarding replicating k8s resources into OPA's data through Kube-mgmt.
Previously I needed to iterate through the existing pods as well as deployments in my k8s cluster. So I added those resources for replication in the kube-mgmt configuration of the admission controller.
Even though adding the required args in kube-mgmt for pods and deployments worked, I faced another problem with other resources such as Roles, Secrets, etc. I followed the kube-mgmt readme when I was adding the K8S resources to be replicated in the admission controller (https://github.com/open-policy-agent/kube-mgmt/tree/0753a3f46f95a22062caf31e2c69b89d298e736e#readme).
Since Roles and Secrets did not seem to be replicated successfully and I couldn't access them through data.kubernetes.secrets or data.kubernetes.roles, I made an experiment where I try to replicate all K8S api resources and added all to the admission controller:
Then I tried to access each of them in a policy, where for each resource I follow the pattern:
As a result the following resources triggered the policy (these seem to fail to import):
Cluster-level resources (overall only namespaces seem to be imported correctly):
Namespace-level resources:
So it is visible that most namespaces resources get imported although there are some which fail, but also almost all cluster-level resources are not imported into OPA (by kube-mgmt). I can't seem to find any pattern between the resources which fail to import. So I was wondering what could be causing the issue?
Beta Was this translation helpful? Give feedback.
All reactions