jquad-group / backstage-jquad

Tekton Pipelines Plugin for Backstage
Apache License 2.0
18 stars 6 forks source link

pipeline runs are not displayed #9

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hey thanks for providing the tekton plugin code. i have gone through the steps you mentioned to add this plugin, but i am not getting any data. image

please help me to resolve this.

rannox commented 1 year ago

Hello Va-asu,

thanks for reporting this issue! Can you check if your authorizationBearerToken is valid? Currently if the token is invalid, the backend returns HTTP response code 200 instead of 5xx: https://github.com/jquad-group/backstage-jquad/issues/3

ghost commented 1 year ago

authorizationBearerToken is not set for tekton in current situation so i am using some random string.

i get error if leave that as blank or null error Invalid type in config for key 'tekton[0].authorizationBearerToken' in 'app-config.yaml', got empty-string, wanted string type=errorHandler stack=TypeError: Invalid type in config for key 'tekton[0].authorizationBearerToken' in 'app-config.yaml', got empty-string, wanted string

jizusun commented 1 year ago

error Invalid type in config for key 'tekton[0].authorizationBearerToken' in 'app-config.yaml', got empty-string, wanted string type=errorHandler stack=TypeError: Invalid type in config for key 'tekton[0].authorizationBearerToken' in 'app-config.yaml', got empty-string, wanted string

I think you need to set an valid authorizationBearerToken rather than random string or blank string, otherwise the backstage plugin cannot communicate with your k8s cluster and get results regarding tekton.

krishnaraman001 commented 1 year ago

Hi @jizusun Right now we dont have any authentication mechanism added to our tekton. Is it really required to authenticate, if yes can you please let us know how you have added authentication to your tekton. If no, can you please let us know how to bypass that authentication.

ghost commented 1 year ago

@jizusun @rannox can you please help us with what @krishnaraman001 has mentioned.

rannox commented 1 year ago

The authentication is needed for the kubernetes API server, not for Tekton.

You can try to extract a token from an existing ServiceAccount. E.g. try

# kubectl get serviceaccount [SERVICE_ACCOUNT_IN_YOUR_CLUSTER] -o yaml -n [NAMESPACE]
apiVersion: v1
kind: ServiceAccount
metadata:
  name: [SERVICE_ACCOUNT_IN_YOUR_CLUSTER]
  namespace: [NAMESPACE]
secrets:
- name: [SERVICE_ACCOUNT_IN_YOUR_CLUSTER]-token-xxx

And then to retrieve the token:

# kubectl get secret [SERVICE_ACCOUNT_IN_YOUR_CLUSTER]-token-xxx -o yaml -n [NAMESPACE]
apiVersion: v1
data:
  ca.crt: LS0to=
  token: [TOKEN_VALUE]
kind: Secret

Decode the token from base64 to normal string: echo [TOKEN_VALUE] | base64 --decode

Now you can paste the value into the plugin configuration.

ghost commented 1 year ago

i followed the steps you have suggested and retrived the token from tekton service account, but still no piplelines are displayed

ghost commented 1 year ago

after version 0.2.6, pipelines run can be seen, thank you @rannox