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

How to define endpoint for kubernetes component in devfile? #13268

Closed
makandre opened this issue May 2, 2019 · 4 comments
Closed

How to define endpoint for kubernetes component in devfile? #13268

makandre opened this issue May 2, 2019 · 4 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@makandre
Copy link

makandre commented May 2, 2019

Description

In a stack definition, I can define a server for a machine:

"ui": {
  "servers": {
    "dashboard": {
      "protocol": "http",
      "port": "8081"
    }
  }
}

Similarly, in devfile I can define endpoint for a dockerimage component:

type: dockerimage
alias: ui
image: 'test-ui:latest'
memoryLimit: 0.5G
endpoints:
  - name: dashboard
    port: 8081
    attributes:
      protocol: http

In both cases, this creates an endpoint in Che workspace that I can click on to open a page on my server:

image

But I have not figure out how to do this with a kubernetes component, which I define below (I also tried adding an ingress as well but it does not get created):

kind: List
items:
  - kind: Pod
    apiVersion: v1
    metadata:
      name: ws
    spec:
      containers:
        - image: 'test-ui:latest'
          name: ui
          ports:
            - containerPort: 8081
              protocol: TCP
          resources:
            limits:
              memory: 512Mi
  - kind: Service
    apiVersion: v1
    metadata:
      name: dashboard
    spec:
      selector:
        name: ws
      ports:
        - port: 8081
          targetPort: 8081

Thanks.

Reproduction Steps

OS and version:

Che 7 post beta3, on kubernetes

Diagnostics:

@skabashnyuk
Copy link
Contributor

Hello @makandre . You can't at this moment. Here is #12268 corresponding issue.

CC @l0rd @sleshchenko

@skabashnyuk skabashnyuk added the kind/question Questions that haven't been identified as being feature requests or bugs. label May 2, 2019
@l0rd
Copy link
Contributor

l0rd commented May 2, 2019

@makandre doesn't che-theia port plugin work for you? It's a plugin included in the che-theia distribution and ask you if you want to expose an endpoint as soon as it founds a process listening to a TCP port. Another option should be to define an Ingress in your yaml (Ingresses are supported #12899) but in that case you will need to kubectl get ingress to get the URL: it won't appear in the containers view.

@makandre
Copy link
Author

makandre commented May 2, 2019

@l0rd I see the port plugin is installed, but it doesn't appear to do anything for my case (I see the popup only once; I have no idea what triggered it)

I did also try to define an ingress in my yaml, but the resource is not created. Possibly I defined it incorrectly, if you could provide a working example that would be great.

@che-bot
Copy link
Contributor

che-bot commented Mar 25, 2020

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 25, 2020
@che-bot che-bot closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

5 participants