From c59a5e114aaf40d60c247c6117ddc4e96c4f94f6 Mon Sep 17 00:00:00 2001 From: Mengnan Gong Date: Mon, 16 Jan 2023 16:32:28 +0800 Subject: [PATCH 1/2] Improve the Kubernetes plugin documentation - Add the `objectTypes` config - Add the access needed to fetch pod metrics in the RBAC chapter Signed-off-by: Mengnan Gong --- .github/vale/Vocab/Backstage/accept.txt | 2 ++ docs/features/kubernetes/configuration.md | 42 +++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/.github/vale/Vocab/Backstage/accept.txt b/.github/vale/Vocab/Backstage/accept.txt index 98160a496d..d8c962ecc2 100644 --- a/.github/vale/Vocab/Backstage/accept.txt +++ b/.github/vale/Vocab/Backstage/accept.txt @@ -70,6 +70,7 @@ cron cronjobs crontab css +daemonsets Datadog dataflow dayjs @@ -177,6 +178,7 @@ learnings Leasot lerna Lerna +limitranges LocalStack lockdown lockfile diff --git a/docs/features/kubernetes/configuration.md b/docs/features/kubernetes/configuration.md index 41d72b2be2..8b22ddea1a 100644 --- a/docs/features/kubernetes/configuration.md +++ b/docs/features/kubernetes/configuration.md @@ -402,6 +402,41 @@ view the Kubernetes API docs for your Kubernetes version (e.g. [API Groups for v1.22](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#-strong-api-groups-strong-) ) +### `objectTypes` (optional) + +Overrides for the Kubernetes object types fetched from the cluster. The default object types are: + +- pods +- services +- configmaps +- limitranges +- deployments +- replicasets +- horizontalpodautoscalers +- jobs +- cronjobs +- ingresses +- statefulsets +- daemonsets + +You may use this config to override the default object types if you only want a subset of +the default ones. However, it's currently not supported to fetch object types other +than the ones specified in the default types. + +Example: + +```yaml +--- +kubernetes: + objectTypes: + - 'configmaps' + - 'deployments' + - 'limitranges' + - 'pods' + - 'services' + - 'statefulsets' +``` + ### Role Based Access Control The current RBAC permissions required are read-only cluster wide, the below @@ -441,6 +476,13 @@ rules: - get - list - watch + - apiGroups: + - metrics.k8s.io + resources: + - pods + verbs: + - get + - list ``` ## Surfacing your Kubernetes components as part of an entity From 834ac839b45e117d33e0b559fbaf149cde007715 Mon Sep 17 00:00:00 2001 From: Ben Lambert Date: Tue, 24 Jan 2023 10:53:04 +0100 Subject: [PATCH 2/2] Update docs/features/kubernetes/configuration.md Signed-off-by: Ben Lambert --- docs/features/kubernetes/configuration.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/features/kubernetes/configuration.md b/docs/features/kubernetes/configuration.md index 8b22ddea1a..837574aa9e 100644 --- a/docs/features/kubernetes/configuration.md +++ b/docs/features/kubernetes/configuration.md @@ -429,12 +429,12 @@ Example: --- kubernetes: objectTypes: - - 'configmaps' - - 'deployments' - - 'limitranges' - - 'pods' - - 'services' - - 'statefulsets' + - configmaps + - deployments + - limitranges + - pods + - services + - statefulsets ``` ### Role Based Access Control