From e8a794b5d0f89912fbe3c1ef45349614a275fe26 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Mon, 1 Mar 2021 22:47:39 +0700 Subject: [PATCH 01/25] docs: rearrange core features Make kubernetes subsection after software catalog, because entity definitions is located on software catalog Signed-off-by: gazandi --- microsite/sidebars.json | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/microsite/sidebars.json b/microsite/sidebars.json index 8b5c0e5f0c..7b0c57d9a1 100644 --- a/microsite/sidebars.json +++ b/microsite/sidebars.json @@ -36,15 +36,6 @@ ], "CLI": ["cli/index", "cli/commands"], "Core Features": [ - { - "type": "subcategory", - "label": "Kubernetes", - "ids": [ - "features/kubernetes/overview", - "features/kubernetes/installation", - "features/kubernetes/configuration" - ] - }, { "type": "subcategory", "label": "Software Catalog", @@ -62,6 +53,16 @@ "features/software-catalog/software-catalog-api" ] }, + { + "type": "subcategory", + "label": "Kubernetes", + "ids": [ + "features/kubernetes/overview", + "features/kubernetes/installation", + "features/kubernetes/configuration", + "features/kubernetes/troubleshooting" + ] + }, { "type": "subcategory", "label": "Software Templates", From c8b37f93bd4238c01effc20c580b3a73c4456eac Mon Sep 17 00:00:00 2001 From: Gazandi Date: Mon, 1 Mar 2021 23:17:20 +0700 Subject: [PATCH 02/25] doc: add troubleshoot md for kubernetes Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 92 +++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 docs/features/kubernetes/troubleshooting.md diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md new file mode 100644 index 0000000000..eb262301b0 --- /dev/null +++ b/docs/features/kubernetes/troubleshooting.md @@ -0,0 +1,92 @@ +--- +id: troubleshooting-k8s +title: Troubleshooting Kubernetes +sidebar_label: Troubleshooting +description: Troubleshooting for Kubernetes +--- + +## Kubernetes is not showing up on Service Entities +How to test your k8s cluster are already connected to backstage + +```curl +# curl request +curl --location --request POST '{{backstage-backend-url}}:{{backstage-backend-port}}/api/kubernetes/services/:service-entity-name' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "entity": { + "metadata": { + "name": + } + } +} +' +``` + +The curl response should have resources from kubernetes +```json +# curl response +{ + "items": [ + { + "cluster": { + "name": + }, + "resources": [ + { + "type": "services", + "resources": [ + { + "metadata": { + "creationTimestamp": "2022-03-13T13:52:46.000Z", + "labels": { + "app": , + "backstage": , + "backstage.io/kubernetes-id": + }, + "name": , + "namespace": + }, + .... + } + ] + }, + .... + { + "type": "pods", + "resources": [ + ,,,, + ] + } + ], + "errors": [] + } + ] +} + +``` + +Kubernetes will not be showing anything if annotations not match with annotations +on k8s service.yaml / deployment.yaml / k8s related yaml. We recommend you for +using label selector with adding two labels: +`backstage: ` and `backstage.io/kubernetes-id: `. +```yaml +# k8s related yaml (service.yaml, deployment.yaml, ingress.yaml) +metadata: { + creationTimestamp: "2022-03-13T13:52:46.000Z", + labels: { + "app": , + "backstage": , + "backstage.io/kubernetes-id": + }, + "name": , + "namespace": +} +``` + +and the catalog info annotations would use label selector: + +```yaml +# catalog-info.yaml (backstage) +annotations: + backstage.io/kubernetes-label-selector: 'backstage= Date: Mon, 1 Mar 2021 23:18:58 +0700 Subject: [PATCH 03/25] Update troubleshooting.md Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index eb262301b0..72947282a3 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -6,7 +6,10 @@ description: Troubleshooting for Kubernetes --- ## Kubernetes is not showing up on Service Entities -How to test your k8s cluster are already connected to backstage + +Sometimes, kubernetes is not showing up on service entities, we +should test your k8s cluster are already connected to backstage +or not. ```curl # curl request From 7e5019f68002886552c7ac673b52c7235159a2c8 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Mon, 1 Mar 2021 23:21:09 +0700 Subject: [PATCH 04/25] add troubleshoot md Signed-off-by: gazandi --- docs/features/kubernetes/installation.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/features/kubernetes/installation.md b/docs/features/kubernetes/installation.md index 35a027df62..e431c057ac 100644 --- a/docs/features/kubernetes/installation.md +++ b/docs/features/kubernetes/installation.md @@ -117,3 +117,8 @@ Start the frontend and the backend app by After installing the plugins in the code, you'll need to then [configure them](configuration.md). + +## Troubleshooting + +After installing the plugins in the code, and the kubernetes informations is not +showing up, you'll need to [troubleshoot it](troubleshooting.md). From f3111de02c4880f84d5049c18f54637b090f4ee1 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Mon, 1 Mar 2021 23:24:09 +0700 Subject: [PATCH 05/25] docs: how to get serviceAccountToken Signed-off-by: gazandi --- docs/features/kubernetes/configuration.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/features/kubernetes/configuration.md b/docs/features/kubernetes/configuration.md index 3e138a7a0b..d76167d3cb 100644 --- a/docs/features/kubernetes/configuration.md +++ b/docs/features/kubernetes/configuration.md @@ -73,10 +73,18 @@ cluster. Valid values are: | `serviceAccount` | This will use a Kubernetes [service account](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) to access the Kubernetes API. When this is used the `serviceAccountToken` field should also be set. | | `google` | This will use a user's Google auth token from the [Google auth plugin](https://backstage.io/docs/auth/) to access the Kubernetes API. | -### `clusters.\*.serviceAccount` (optional) +### `clusters.\*.serviceAccountToken` (optional) The service account token to be used when using the `serviceAccount` auth -provider. +provider. You could get the service account token with: + +```sh +kubectl -n get secret $(kubectl -n get sa -o=json \ +| jq -r '.secrets[0].name') -o=json \ +| jq -r '.data["token"]' \ +| base64 --decode \ +| pbcopy +``` ### Role Based Access Control From b7c4eb7eff44a8817dd9f8f9fad554e45165bf40 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Mon, 1 Mar 2021 23:32:59 +0700 Subject: [PATCH 06/25] Update troubleshooting.md Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 72947282a3..519b81002a 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -71,15 +71,17 @@ The curl response should have resources from kubernetes Kubernetes will not be showing anything if annotations not match with annotations on k8s service.yaml / deployment.yaml / k8s related yaml. We recommend you for using label selector with adding two labels: + `backstage: ` and `backstage.io/kubernetes-id: `. + ```yaml # k8s related yaml (service.yaml, deployment.yaml, ingress.yaml) metadata: { creationTimestamp: "2022-03-13T13:52:46.000Z", labels: { - "app": , + "app": , "backstage": , - "backstage.io/kubernetes-id": + "backstage.io/kubernetes-id": }, "name": , "namespace": From e0de29544ef4765734eb8741316a49dadd540628 Mon Sep 17 00:00:00 2001 From: gazandi Date: Mon, 1 Mar 2021 23:44:14 +0700 Subject: [PATCH 07/25] fix: bug Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 40 +++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 519b81002a..9dcca33f5b 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -1,15 +1,14 @@ --- -id: troubleshooting-k8s +id: troubleshooting title: Troubleshooting Kubernetes sidebar_label: Troubleshooting description: Troubleshooting for Kubernetes --- -## Kubernetes is not showing up on Service Entities +## Kubernetes is not showing up on Service Entities -Sometimes, kubernetes is not showing up on service entities, we -should test your k8s cluster are already connected to backstage -or not. +Sometimes, kubernetes is not showing up on service entities, we should test your +k8s cluster are already connected to backstage or not. ```curl # curl request @@ -26,6 +25,7 @@ curl --location --request POST '{{backstage-backend-url}}:{{backstage-backend-po ``` The curl response should have resources from kubernetes + ```json # curl response { @@ -68,30 +68,32 @@ The curl response should have resources from kubernetes ``` -Kubernetes will not be showing anything if annotations not match with annotations -on k8s service.yaml / deployment.yaml / k8s related yaml. We recommend you for -using label selector with adding two labels: +Kubernetes will not be showing anything if annotations not match with +annotations on k8s service.yaml / deployment.yaml / k8s related yaml. We +recommend you for using label selector with adding two labels: `backstage: ` and `backstage.io/kubernetes-id: `. ```yaml # k8s related yaml (service.yaml, deployment.yaml, ingress.yaml) -metadata: { - creationTimestamp: "2022-03-13T13:52:46.000Z", - labels: { - "app": , - "backstage": , - "backstage.io/kubernetes-id": - }, - "name": , - "namespace": -} +metadata: + { + creationTimestamp: '2022-03-13T13:52:46.000Z', + labels: + { + 'app': , + 'backstage': , + 'backstage.io/kubernetes-id': , + }, + 'name': , + 'namespace': , + } ``` and the catalog info annotations would use label selector: ```yaml # catalog-info.yaml (backstage) -annotations: +annotations: backstage.io/kubernetes-label-selector: 'backstage= Date: Mon, 1 Mar 2021 23:46:13 +0700 Subject: [PATCH 08/25] doc: changeset Signed-off-by: gazandi --- .changeset/wise-wolves-knock.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wise-wolves-knock.md diff --git a/.changeset/wise-wolves-knock.md b/.changeset/wise-wolves-knock.md new file mode 100644 index 0000000000..8e386b3b9a --- /dev/null +++ b/.changeset/wise-wolves-knock.md @@ -0,0 +1,5 @@ +--- +'docgen': patch +--- + +docs: refine kubernetes core feature docs From ba7f45b57c8ac0edf18df9a2866254ab8d88fdd8 Mon Sep 17 00:00:00 2001 From: gazandi Date: Mon, 1 Mar 2021 23:48:35 +0700 Subject: [PATCH 09/25] doc: fix informations Signed-off-by: gazandi --- docs/features/kubernetes/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/kubernetes/installation.md b/docs/features/kubernetes/installation.md index e431c057ac..e9a02f705d 100644 --- a/docs/features/kubernetes/installation.md +++ b/docs/features/kubernetes/installation.md @@ -120,5 +120,5 @@ After installing the plugins in the code, you'll need to then ## Troubleshooting -After installing the plugins in the code, and the kubernetes informations is not +After installing the plugins in the code, and the kubernetes information is not showing up, you'll need to [troubleshoot it](troubleshooting.md). From 237ea10010415be5e4ec5fbd0b1b9559a2474223 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Tue, 2 Mar 2021 09:12:59 +0700 Subject: [PATCH 10/25] Delete wise-wolves-knock.md Signed-off-by: gazandi --- .changeset/wise-wolves-knock.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/wise-wolves-knock.md diff --git a/.changeset/wise-wolves-knock.md b/.changeset/wise-wolves-knock.md deleted file mode 100644 index 8e386b3b9a..0000000000 --- a/.changeset/wise-wolves-knock.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'docgen': patch ---- - -docs: refine kubernetes core feature docs From 0e5fc79b467820229afe45793d9ea9346586560c Mon Sep 17 00:00:00 2001 From: Gazandi Date: Tue, 2 Mar 2021 09:13:57 +0700 Subject: [PATCH 11/25] Apply suggestions from code review Co-authored-by: Adam Harvey Signed-off-by: gazandi --- docs/features/kubernetes/installation.md | 2 +- docs/features/kubernetes/troubleshooting.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/features/kubernetes/installation.md b/docs/features/kubernetes/installation.md index e9a02f705d..fed24c58d6 100644 --- a/docs/features/kubernetes/installation.md +++ b/docs/features/kubernetes/installation.md @@ -120,5 +120,5 @@ After installing the plugins in the code, you'll need to then ## Troubleshooting -After installing the plugins in the code, and the kubernetes information is not +After installing the plugins in the code, if the Kubernetes information is not showing up, you'll need to [troubleshoot it](troubleshooting.md). diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 9dcca33f5b..4dc42dcb69 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -7,8 +7,8 @@ description: Troubleshooting for Kubernetes ## Kubernetes is not showing up on Service Entities -Sometimes, kubernetes is not showing up on service entities, we should test your -k8s cluster are already connected to backstage or not. +Sometimes, Kubernetes is not showing up on service entities, we should test your +k8s cluster are already connected to Backstage or not. ```curl # curl request @@ -24,7 +24,7 @@ curl --location --request POST '{{backstage-backend-url}}:{{backstage-backend-po ' ``` -The curl response should have resources from kubernetes +The curl response should have resources from Kubernetes: ```json # curl response From 304521bec11957543bfd54c08cd1df8570e50b14 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Tue, 2 Mar 2021 09:14:28 +0700 Subject: [PATCH 12/25] delete comment Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 4dc42dcb69..0426123968 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -11,7 +11,6 @@ Sometimes, Kubernetes is not showing up on service entities, we should test your k8s cluster are already connected to Backstage or not. ```curl -# curl request curl --location --request POST '{{backstage-backend-url}}:{{backstage-backend-port}}/api/kubernetes/services/:service-entity-name' \ --header 'Content-Type: application/json' \ --data-raw '{ From 5eaf80d405211bebfde4efb6c6792379dee572c1 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Tue, 2 Mar 2021 09:17:36 +0700 Subject: [PATCH 13/25] edit wording Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 0426123968..7464f1baa0 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -67,9 +67,9 @@ The curl response should have resources from Kubernetes: ``` -Kubernetes will not be showing anything if annotations not match with -annotations on k8s service.yaml / deployment.yaml / k8s related yaml. We -recommend you for using label selector with adding two labels: +Kubernetes will not be showing anything when catalog info annotations unmatch with +k8s related yaml label (service.yaml, deployment.yaml, etc). We recommend you for +using label selector with adding two labels: `backstage: ` and `backstage.io/kubernetes-id: `. From 9efbfd309b8876ce8fb391cfdb90e206e62fa1a8 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Tue, 2 Mar 2021 09:20:44 +0700 Subject: [PATCH 14/25] Update troubleshooting.md Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 7464f1baa0..9a571a74cd 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -67,9 +67,9 @@ The curl response should have resources from Kubernetes: ``` -Kubernetes will not be showing anything when catalog info annotations unmatch with -k8s related yaml label (service.yaml, deployment.yaml, etc). We recommend you for -using label selector with adding two labels: +Kubernetes will not be showing anything when catalog info annotations is not match +with k8s related yaml label (service.yaml, deployment.yaml, etc). We recommend you for +adding two labels and using label selector annotations: `backstage: ` and `backstage.io/kubernetes-id: `. From 46a09ae1dfffb5e4fd4fecbcc2e0d516ed6126d8 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Tue, 2 Mar 2021 09:23:46 +0700 Subject: [PATCH 15/25] Update troubleshooting.md Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 9a571a74cd..48b0f6c5bf 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -67,9 +67,9 @@ The curl response should have resources from Kubernetes: ``` -Kubernetes will not be showing anything when catalog info annotations is not match -with k8s related yaml label (service.yaml, deployment.yaml, etc). We recommend you for -adding two labels and using label selector annotations: +Kubernetes will not be showing anything when catalog info annotations is not +match with k8s related yaml label (service.yaml, deployment.yaml, etc). We +recommend you for adding two labels and using label selector annotations: `backstage: ` and `backstage.io/kubernetes-id: `. From 335b33cd1241de91947dc151cbe3ff6a7ce29c9f Mon Sep 17 00:00:00 2001 From: Gazandi Date: Wed, 3 Mar 2021 10:17:11 +0700 Subject: [PATCH 16/25] Update troubleshooting.md Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 48b0f6c5bf..7b80f3e5a4 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -94,5 +94,5 @@ and the catalog info annotations would use label selector: ```yaml # catalog-info.yaml (backstage) annotations: - backstage.io/kubernetes-label-selector: 'backstage=' ``` From 3ba3cedb4ddb2b672d9b54ea44339c47d9295fd9 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Wed, 3 Mar 2021 10:40:24 +0700 Subject: [PATCH 17/25] Update configuration.md Signed-off-by: gazandi --- docs/features/kubernetes/configuration.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/features/kubernetes/configuration.md b/docs/features/kubernetes/configuration.md index d76167d3cb..f146eebe55 100644 --- a/docs/features/kubernetes/configuration.md +++ b/docs/features/kubernetes/configuration.md @@ -82,8 +82,7 @@ provider. You could get the service account token with: kubectl -n get secret $(kubectl -n get sa -o=json \ | jq -r '.secrets[0].name') -o=json \ | jq -r '.data["token"]' \ -| base64 --decode \ -| pbcopy +| base64 --decode ``` ### Role Based Access Control From 0224256322f7d8c288dc2a76070a10ac524e27dd Mon Sep 17 00:00:00 2001 From: Gazandi Date: Thu, 4 Mar 2021 09:15:21 +0700 Subject: [PATCH 18/25] Update troubleshooting.md Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 27 ++++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 7b80f3e5a4..a097f3791f 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -41,11 +41,11 @@ The curl response should have resources from Kubernetes: "metadata": { "creationTimestamp": "2022-03-13T13:52:46.000Z", "labels": { - "app": , + "app": , "backstage": , "backstage.io/kubernetes-id": }, - "name": , + "name": , "namespace": }, .... @@ -73,21 +73,24 @@ recommend you for adding two labels and using label selector annotations: `backstage: ` and `backstage.io/kubernetes-id: `. +`backstage: ` for matching with catalog-info.yaml + +`backstage.io/kubernetes-id: `for get k8s service-related +objects. [link](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) + ```yaml # k8s related yaml (service.yaml, deployment.yaml, ingress.yaml) metadata: - { - creationTimestamp: '2022-03-13T13:52:46.000Z', + creationTimestamp: '2022-03-13T13:52:46.000Z' labels: - { - 'app': , - 'backstage': , - 'backstage.io/kubernetes-id': , - }, - 'name': , - 'namespace': , - } + app: + backstage: + backstage.io/kubernetes-id: + name: + namespace: ``` +k8s-app-name and service-entity-name could be different, but if you would like +to have consistent names between k8s and backstage, we recommend use same name. and the catalog info annotations would use label selector: From af775fafb5700f6d1d41ea5111a28fd43acac1bb Mon Sep 17 00:00:00 2001 From: gazandi Date: Thu, 4 Mar 2021 09:31:55 +0700 Subject: [PATCH 19/25] fix: prettier Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index a097f3791f..819192fa8b 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -75,20 +75,22 @@ recommend you for adding two labels and using label selector annotations: `backstage: ` for matching with catalog-info.yaml -`backstage.io/kubernetes-id: `for get k8s service-related -objects. [link](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) +`backstage.io/kubernetes-id: `for get k8s service-related +objects. +[link](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) ```yaml # k8s related yaml (service.yaml, deployment.yaml, ingress.yaml) metadata: - creationTimestamp: '2022-03-13T13:52:46.000Z' - labels: - app: - backstage: - backstage.io/kubernetes-id: - name: - namespace: + creationTimestamp: '2022-03-13T13:52:46.000Z' + labels: + app: + backstage: + backstage.io/kubernetes-id: + name: + namespace: ``` + k8s-app-name and service-entity-name could be different, but if you would like to have consistent names between k8s and backstage, we recommend use same name. From 64af168ebc4df3fce2578cbd092cc7f90753b059 Mon Sep 17 00:00:00 2001 From: gazandi Date: Thu, 4 Mar 2021 09:41:33 +0700 Subject: [PATCH 20/25] fix: wording link Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 819192fa8b..f76968492c 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -77,7 +77,7 @@ recommend you for adding two labels and using label selector annotations: `backstage.io/kubernetes-id: `for get k8s service-related objects. -[link](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) +[See on github](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) ```yaml # k8s related yaml (service.yaml, deployment.yaml, ingress.yaml) From f7c4b70ffa6519e0c66fe25c16e3930ca77550fb Mon Sep 17 00:00:00 2001 From: gazandi Date: Thu, 4 Mar 2021 09:46:16 +0700 Subject: [PATCH 21/25] fix: wording link Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index f76968492c..3bbede4809 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -77,7 +77,7 @@ recommend you for adding two labels and using label selector annotations: `backstage.io/kubernetes-id: `for get k8s service-related objects. -[See on github](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) +[See on Github](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) ```yaml # k8s related yaml (service.yaml, deployment.yaml, ingress.yaml) From 3b2312b8a8461d600f2f26b2caeb85ef18facd75 Mon Sep 17 00:00:00 2001 From: gazandi Date: Thu, 4 Mar 2021 09:59:09 +0700 Subject: [PATCH 22/25] fix: wording link Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 3bbede4809..1fac1f1ece 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -77,7 +77,7 @@ recommend you for adding two labels and using label selector annotations: `backstage.io/kubernetes-id: `for get k8s service-related objects. -[See on Github](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) +[See the plugin code](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) ```yaml # k8s related yaml (service.yaml, deployment.yaml, ingress.yaml) From 43c757ae6080931b63ea7001aac45aedf2a35403 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Thu, 4 Mar 2021 20:30:39 +0700 Subject: [PATCH 23/25] Update troubleshooting.md Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 1fac1f1ece..882c6f03f6 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -7,8 +7,8 @@ description: Troubleshooting for Kubernetes ## Kubernetes is not showing up on Service Entities -Sometimes, Kubernetes is not showing up on service entities, we should test your -k8s cluster are already connected to Backstage or not. +This can be debugged by checking whether your Kubernetes cluster are +connected to Backstage as follows: ```curl curl --location --request POST '{{backstage-backend-url}}:{{backstage-backend-port}}/api/kubernetes/services/:service-entity-name' \ @@ -67,9 +67,9 @@ The curl response should have resources from Kubernetes: ``` -Kubernetes will not be showing anything when catalog info annotations is not -match with k8s related yaml label (service.yaml, deployment.yaml, etc). We -recommend you for adding two labels and using label selector annotations: +The Kubernetes tab will not show anything when the catalog info annotation does not +match the related Kubernetes resource. We recommend you add the following labels to +your resources and use the label selector annotation as follows: `backstage: ` and `backstage.io/kubernetes-id: `. From 12b73bbb9a37a7a0a863378817af275122a2f6ab Mon Sep 17 00:00:00 2001 From: gazandi Date: Thu, 4 Mar 2021 20:38:44 +0700 Subject: [PATCH 24/25] prettier Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 882c6f03f6..1dda6c0cbb 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -7,8 +7,8 @@ description: Troubleshooting for Kubernetes ## Kubernetes is not showing up on Service Entities -This can be debugged by checking whether your Kubernetes cluster are -connected to Backstage as follows: +This can be debugged by checking whether your Kubernetes cluster are connected +to Backstage as follows: ```curl curl --location --request POST '{{backstage-backend-url}}:{{backstage-backend-port}}/api/kubernetes/services/:service-entity-name' \ @@ -67,9 +67,9 @@ The curl response should have resources from Kubernetes: ``` -The Kubernetes tab will not show anything when the catalog info annotation does not -match the related Kubernetes resource. We recommend you add the following labels to -your resources and use the label selector annotation as follows: +The Kubernetes tab will not show anything when the catalog info annotation does +not match the related Kubernetes resource. We recommend you add the following +labels to your resources and use the label selector annotation as follows: `backstage: ` and `backstage.io/kubernetes-id: `. From 228538165d3d5fc7a91c3ebd0008e37d78372eb7 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Thu, 4 Mar 2021 20:40:51 +0700 Subject: [PATCH 25/25] Update troubleshooting.md Signed-off-by: gazandi --- docs/features/kubernetes/troubleshooting.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/features/kubernetes/troubleshooting.md b/docs/features/kubernetes/troubleshooting.md index 1dda6c0cbb..6213b56bc6 100644 --- a/docs/features/kubernetes/troubleshooting.md +++ b/docs/features/kubernetes/troubleshooting.md @@ -71,10 +71,6 @@ The Kubernetes tab will not show anything when the catalog info annotation does not match the related Kubernetes resource. We recommend you add the following labels to your resources and use the label selector annotation as follows: -`backstage: ` and `backstage.io/kubernetes-id: `. - -`backstage: ` for matching with catalog-info.yaml - `backstage.io/kubernetes-id: `for get k8s service-related objects. [See the plugin code](https://github.com/backstage/backstage/blob/a1f587c/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts#L119) @@ -85,7 +81,7 @@ metadata: creationTimestamp: '2022-03-13T13:52:46.000Z' labels: app: - backstage: + env: backstage.io/kubernetes-id: name: namespace: @@ -99,5 +95,5 @@ and the catalog info annotations would use label selector: ```yaml # catalog-info.yaml (backstage) annotations: - backstage.io/kubernetes-label-selector: 'backstage=' + backstage.io/kubernetes-label-selector: '' ```