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

Kubernetes/OpenShift component and container component cannot use same endpoint target port #1179

Open
AObuchow opened this issue Oct 3, 2023 · 0 comments
Assignees

Comments

@AObuchow
Copy link
Collaborator

AObuchow commented Oct 3, 2023

Description

If a kubernetes or openshift component define endpoints with the same target port, the devworkspace will be deemed invalid and will fail to start. Since Kubernetes & OpenShift components are intended to run in a separate pod from container components, it should be valid to have them use the same target port in their endpoints.

How To Reproduce

Start a devworkspace that defines a container component and kubernetes (or openshift) component that both use the same target port in their endpoints, such as the following:

kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: plain-devworkspace
spec:
  started: true
  routingClass: 'basic'
  template:
    components:
      - name: kubernetes-deploy
        kubernetes:
          endpoints:
            - name: http-8080
              path: /
              targetPort: 8080
          uri: deploy.yaml
      - name: web-terminal
        container:
          image: quay.io/wto/web-terminal-tooling:next
          memoryRequest: 256Mi
          memoryLimit: 512Mi
          mountSources: true
          command:
           - "tail"
           - "-f"
           - "/dev/null"
          endpoints:
            - name: 'http'
              protocol: http
              targetPort: 8080
              exposure: public

The devworkspace will fail to start, with the following error message: * devfile contains multiple containers with same endpoint targetPort: 8080

Expected behavior

The devworkspace should start up correctly (or rather, it should not fail to start due to the same endpoint target port being used)

Additional context

Downstream issue: https://issues.redhat.com/browse/CRW-4856

Related Devfile API issue: devfile/api#1049

The issue seems to be coming from the devfile validation in the devfile API. Upgrading the devfile API dependency used in DWO (similar to what was done for the devfile library) should resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant