VC-36351: Include namespaces as part of the resources to be collected#582
Merged
Conversation
wallrj
reviewed
Nov 8, 2024
| config: | ||
| resource-type: | ||
| resource: namespaces | ||
| version: v1 |
Contributor
There was a problem hiding this comment.
For the other resource types there is a corresponding RBAC ClusterRole and ClusterRoleBinding which explicitly grants permission to the the agent service account to read those resources.
Do service accounts implicitly have permission to list namespaces?
The RBAC ClusterRole was also omitted in #507
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref: VC-36351
This PR adds namespaces to the "dynamic" configuration of the Agent in the Helm chart.
Manual Testing
There is no automated test for this change. Thus, I went ahead and manually tested the feature.
I've used the tenant https://ven-tlspk.venafi.cloud/. To access the API key, use the user
system.admin@tlspk.qa.venafi.ioand the password is visible in the page Production Accounts (private to Venafi). Then go to the settings and find the API key.export APIKEY=...I've then deployed the agent to a Kind cluster (create it first):
Make sure to have
127.0.0.1 mein your/etc/hosts.Then, run mitmproxy with:
Finally, run the agent with:
The data being sent contains the namespaces:
{ "cluster_id": "mvalais temp", "data-gatherer": "k8s/namespaces", "timestamp": "2024-10-03T10:12:23+02:00", "data": { "items": [ { "resource": { "apiVersion": "v1", "kind": "Namespace", "metadata": { "creationTimestamp": "2024-09-20T18:03:34Z", "labels": { "kubernetes.io/metadata.name": "kube-node-lease" }, "name": "kube-node-lease", "resourceVersion": "33", "uid": "824544b7-d72c-4369-99fa-919268bbf02a" }, "spec": { "finalizers": ["kubernetes"] }, "status": { "phase": "Active" } } }, { "resource": { "apiVersion": "v1", "kind": "Namespace", "metadata": { "creationTimestamp": "2024-09-20T18:03:34Z", "labels": { "kubernetes.io/metadata.name": "kube-public" }, "name": "kube-public", "resourceVersion": "18", "uid": "3ce5adb2-d175-4019-a1f7-7caa64aa6d9f" }, "spec": { "finalizers": ["kubernetes"] }, "status": { "phase": "Active" } } }, { "resource": { "apiVersion": "v1", "kind": "Namespace", "metadata": { "creationTimestamp": "2024-09-20T18:03:34Z", "labels": { "kubernetes.io/metadata.name": "kube-system" }, "name": "kube-system", "resourceVersion": "9", "uid": "f1746db2-2a93-4791-a49c-f9a147bf0eab" }, "spec": { "finalizers": ["kubernetes"] }, "status": { "phase": "Active" } } }, { "resource": { "apiVersion": "v1", "kind": "Namespace", "metadata": { "annotations": {}, "creationTimestamp": "2024-09-20T18:03:38Z", "labels": { "kubernetes.io/metadata.name": "local-path-storage" }, "name": "local-path-storage", "resourceVersion": "271", "uid": "b33f35ec-c3a1-472d-a774-75c00fee90b0" }, "spec": { "finalizers": ["kubernetes"] }, "status": { "phase": "Active" } } }, { "resource": { "apiVersion": "v1", "kind": "Namespace", "metadata": { "creationTimestamp": "2024-09-30T14:43:57Z", "labels": { "kubernetes.io/metadata.name": "venafi", "name": "venafi" }, "name": "venafi", "resourceVersion": "157839", "uid": "17daf841-4962-4388-baa4-278342ed50f8" }, "spec": { "finalizers": ["kubernetes"] }, "status": { "phase": "Active" } } }, { "resource": { "apiVersion": "v1", "kind": "Namespace", "metadata": { "creationTimestamp": "2024-10-01T14:09:33Z", "labels": { "kubernetes.io/metadata.name": "ambassador", "name": "ambassador" }, "name": "ambassador", "resourceVersion": "201695", "uid": "5f821e3a-58cb-4d73-85eb-e7bbe02ad38f" }, "spec": { "finalizers": ["kubernetes"] }, "status": { "phase": "Active" } } }, { "resource": { "apiVersion": "v1", "kind": "Namespace", "metadata": { "creationTimestamp": "2024-09-20T18:03:34Z", "labels": { "kubernetes.io/metadata.name": "default" }, "name": "default", "resourceVersion": "39", "uid": "320a0e25-9b58-4f7a-b6d3-349044239cec" }, "spec": { "finalizers": ["kubernetes"] }, "status": { "phase": "Active" } } } ] }, "schema_version": "v2.0.0" }