Signed-off-by: gazandi <gazandi@ruangguru.com>
This commit is contained in:
gazandi
2021-03-01 23:44:14 +07:00
parent b7c4eb7eff
commit e0de29544e
+21 -19
View File
@@ -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: <selector>` and `backstage.io/kubernetes-id: <entity-service-name>`.
```yaml
# k8s related yaml (service.yaml, deployment.yaml, ingress.yaml)
metadata: {
creationTimestamp: "2022-03-13T13:52:46.000Z",
labels: {
"app": <service-entity-name>,
"backstage": <selector>,
"backstage.io/kubernetes-id": <service-entity-name>
},
"name": <service-entity-name>,
"namespace": <namespace>
}
metadata:
{
creationTimestamp: '2022-03-13T13:52:46.000Z',
labels:
{
'app': <service-entity-name>,
'backstage': <selector>,
'backstage.io/kubernetes-id': <service-entity-name>,
},
'name': <service-entity-name>,
'namespace': <namespace>,
}
```
and the catalog info annotations would use label selector:
```yaml
# catalog-info.yaml (backstage)
annotations:
annotations:
backstage.io/kubernetes-label-selector: 'backstage=<selectors'
```