Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in kubeapps application display for concourse helmchart #1554

Closed
bottkars opened this issue Mar 3, 2020 · 6 comments · Fixed by #1651
Closed

error in kubeapps application display for concourse helmchart #1554

bottkars opened this issue Mar 3, 2020 · 6 comments · Fixed by #1651
Labels
component/ui Issue related to kubeapps UI good first issue

Comments

@bottkars
Copy link

bottkars commented Mar 3, 2020

Description:

after deploying concourse-ci helmchart from https://concourse-charts.storage.googleapis.com/, i am not able to view #/apps/ns/concourse/concourse

Steps to reproduce the issue:

  1. add https://concourse-charts.storage.googleapis.com repo
  2. add concourse.web.externalURL: your.external.url
  3. deploy helmchart

Describe the results you received:

i receive the error page

Describe the results you expected:

see application settings

Additional information you deem important (e.g. issue happens only occasionally):

Version of Helm, Kubeapps and Kubernetes:

  • Output of helm version:
version.BuildInfo{Version:"v3.1+unreleased", GitCommit:"1940f500fd2b67426cb2668b317b60a928456445", GitTreeState:"clean", GoVersion:"go1.13.8"}
  • Output of helm list <kubeapps-release-name>:
NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
concourse       concourse       1               2020-03-03 16:11:59.544623618 +0000 UTC deployed        concourse-9.1.0 5.8.0
  • Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:30:10Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"2219bec010e9840645dce675fcf864df7ec7adc5", GitTreeState:"clean", BuildDate:"2019-10-22T00:32:05Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
@bottkars
Copy link
Author

bottkars commented Mar 3, 2020

@absoludity
Copy link
Contributor

absoludity commented Mar 4, 2020

Thanks @bottkars . Just note, the above output of helm list <kubeapps-release-name> is meant to give us details about the kubeapps release that you've installed (just so we know exactly what version you're using), not concourse - though that is also helpful to know :)

That said, I was able to add the repo which you mentioned for concourse and reproduce the issue (at least, I think it's the issue?). I don't see any network errors, but what I do see in the JS console is the following:

concourse-install

Checking our code at that point (around ServiceItem.tsx:44), the error is because we (Kubeapps) are assuming that every service item specifies an array (even an empty array) of ports for the service specification, as per the k8s docs, but that concourse chart is creating a service without spec.ports at all:

~$ k -n default get services | grep concourse
concourse-test-postgresql            ClusterIP   10.63.240.114   <none>        5432/TCP                  24m
concourse-test-postgresql-headless   ClusterIP   None            <none>        5432/TCP                  24m
concourse-test-web                   ClusterIP   10.63.242.168   <none>        8080/TCP,2222/TCP         24m
concourse-test-worker                ClusterIP   None            <none>        <none>                    24m
~$ k -n default get service concourse-test-worker -o yaml
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2020-03-03T23:34:23Z"
  labels:
    app: concourse-test-worker
    chart: concourse-9.1.0
    heritage: Tiller
    release: concourse-test
  name: concourse-test-worker
  namespace: default
  resourceVersion: "36532011"
  selfLink: /api/v1/namespaces/default/services/concourse-test-worker
  uid: 83c4faa7-5da7-11ea-a13b-42010a9c003a
spec:
  clusterIP: None
  selector:
    app: concourse-test-worker
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}

Kubeapps should obviously not fall over if a service does not define the ports at all (ie. we shouldn't try to .map() over the non-existent array), but rather just not try to display ports for that service. Thanks for the bug report. I'll triage this and mark it as an easy fix in case anyone wants to have a go, otherwise we'll pick it up asap in our next iteration.

@bottkars
Copy link
Author

bottkars commented Mar 4, 2020

thanks for catching up !

for comleteness:

AME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
kubeapps        kubeapps        1               2020-03-03 11:00:33.274678805 +0000 UTC deployed        kubeapps-3.4.3  v1.8.2

@bottkars
Copy link
Author

bottkars commented Mar 4, 2020

even if you would define an empty array, what we do in the helm chart,
https://github.com/concourse/concourse-chart/blob/43be63a9bafcba1b47f038786d69e0c8f20b1f13/templates/worker-svc.yaml#L17-L20
the k8s api will just remove that empty array from spec. you can try that with kubectl edit service.
i just added a dummy port to the service and now works as a workaround...
image
i assume the maintainers of the Helmchart would most likely NOT add a dummy port for that.

@absoludity
Copy link
Contributor

i assume the maintainers of the Helmchart would most likely NOT add a dummy port for that.

Totally, and either way, Kubeapps should not fall over. It'll be a trivial fix, so a good opportunity for someone to contribute if they want, otherwise we'll fix it soon.

Thanks for verifying the workaround :)

@bottkars
Copy link
Author

bottkars commented Mar 4, 2020

yeah, will reach out to someone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ui Issue related to kubeapps UI good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants