eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.95k stars 1.19k forks source link

Routes created by Endpoints added after workspace creation are `Rejected` #22534

Closed cgruver closed 5 months ago

cgruver commented 11 months ago

Describe the bug

New Route is Rejected if it is created after a workspace is already created.

Restarting from a modified local devfile results in Rejected Route if a public endpoint is added.

Che version

7.74@latest

Steps to reproduce

  1. Create a workspace
  2. Modify the devfile by adding a new public endpoint
  3. Restart the workspace from the local devfile
  4. Observe Rejected Route in OpenShift

Expected behavior

New Route is created corresponding to the new public endpoint

Runtime

OpenShift

Screenshots

Screenshot 2023-09-20 at 9 25 47 AM

Installation method

OperatorHub

Environment

macOS

Eclipse Che Logs

No response

Additional context

No response

cgruver commented 11 months ago

Delete and then Recreate the workspace and Routes are configured properly:

Screenshot 2023-09-20 at 9 47 28 AM
l0rd commented 11 months ago

@cgruver can you please share the endpoint definition that you have added to your devfile?

cgruver commented 11 months ago

@l0rd apologies, I should have shared the devfile.

The project is still under development. But the devfile below will show you the defined endpoints.

schemaVersion: 2.2.0
attributes:
  controller.devfile.io/storage-type: per-workspace
metadata:
  name: "Quarkus Super Heroes Developer Experience Edition"
projects:
- name: quarkus-super-heroes-dev-ex-edition
  git:
    checkoutFrom:
      remote: origin
      revision: main
    remotes:
      origin: https://github.com/lab-monkeys/quarkus-super-heroes-dev-ex-edition.git
- name: quarkus-super-heroes-ui
  git:
    checkoutFrom:
      remote: origin
      revision: main
    remotes:
      origin: https://github.com/lab-monkeys/quarkus-super-heroes-ui.git
- name: quarkus-super-heroes-rest-heroes
  git:
    checkoutFrom:
      remote: origin
      revision: main
    remotes:
      origin: https://github.com/lab-monkeys/quarkus-super-heroes-rest-heroes.git
- name: quarkus-super-heroes-rest-villains
  git:
    checkoutFrom:
      remote: origin
      revision: main
    remotes:
      origin: https://github.com/lab-monkeys/quarkus-super-heroes-rest-villains.git
- name: quarkus-super-heroes-rest-fights
  git:
    checkoutFrom:
      remote: origin
      revision: main
    remotes:
      origin: https://github.com/lab-monkeys/quarkus-super-heroes-rest-fights.git
- name: quarkus-super-heroes-event-statistics
  git:
    checkoutFrom:
      remote: origin
      revision: main
    remotes:
      origin: https://github.com/lab-monkeys/quarkus-super-heroes-event-statistics.git
components:
- name: dev-tools
  container: 
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/dev-workspace-image:nested
    memoryRequest: 1Gi
    memoryLimit: 6Gi
    cpuRequest: 500m
    cpuLimit: 2000m
    mountSources: true
    sourceMapping: /projects
    env:
    - name: SHELL
      value: "/bin/zsh"
    - name: TESTCONTAINERS_RYUK_DISABLED
      value: "true"
    - name: TESTCONTAINERS_CHECKS_DISABLE
      value: "true"
    - name: VSCODE_DEFAULT_WORKSPACE
      value: "/projects/quarkus-super-heroes-dev-ex-edition/quarkus-super-heroes.code-workspace"
    volumeMounts:
    - name: m2
      path: /home/user/.m2
    - name: npm
      path: /home/user/.npm
- name: ui-runner
  container: 
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/dev-workspace-image:nested
    memoryRequest: 128M
    memoryLimit: 1Gi
    mountSources: true
    sourceMapping: /projects
    volumeMounts:
      - name: m2
        path: /home/user/.m2
    endpoints:
      - name: https-ui
        targetPort: 8080
        exposure: public
        protocol: https
    env:
      - name: DEBUG_PORT
        value: '5858'
      - name: JAVA_HOME 
        value: /etc/alternatives/jre_17
      - name: UI_HTTP_PORT
        value: '8080'
      - name: CORS_ORIGINS
        value: "/.*/"
      - name: CORS_METHODS
        value: "GET,POST,DELETE"
    args:
      - '-f'
      - /dev/null
    command:
      - tail
- name: heroes-runner
  container:
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/dev-workspace-image:nested
    memoryRequest: 128M
    memoryLimit: 1Gi
    mountSources: true
    sourceMapping: /projects
    volumeMounts:
      - name: m2
        path: /home/user/.m2
    endpoints:
      - name: https-heroes
        targetPort: 8081
        exposure: public
        protocol: https
    env:
      - name: DEBUG_PORT
        value: '5858'
      - name: JAVA_HOME 
        value: /etc/alternatives/jre_17
      - name: APP_PORT
        value: '8081'
      - name: DB_USER
        value: superman
      - name: DB_PWD
        value: superman
      - name: DB_HOST
        value: localhost
      - name: DB_SCHEMA
        value: heroes_database
      - name: CORS_ORIGINS
        value: "/.*/"
      - name: CORS_METHODS
        value: "GET,POST,DELETE"
- name: villains-runner
  container:
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/dev-workspace-image:nested
    memoryRequest: 128M
    memoryLimit: 1Gi
    mountSources: true
    sourceMapping: /projects
    volumeMounts:
      - name: m2
        path: /home/user/.m2
    endpoints:
      - name: https-villains
        targetPort: 8082
        exposure: public
        protocol: https
    env:
      - name: DEBUG_PORT
        value: '5858'
      - name: JAVA_HOME 
        value: /etc/alternatives/jre_17
      - name: APP_PORT
        value: '8082'
      - name: DB_USER
        value: superbad
      - name: DB_PWD
        value: superbad
      - name: DB_HOST
        value: localhost
      - name: DB_SCHEMA
        value: villains_database
      - name: CORS_ORIGINS
        value: "/.*/"
      - name: CORS_METHODS
        value: "GET,POST,DELETE"
- name: fights-runner
  container: 
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/dev-workspace-image:nested
    memoryRequest: 128M
    memoryLimit: 1Gi
    mountSources: true
    sourceMapping: /projects
    volumeMounts:
      - name: m2
        path: /home/user/.m2
    endpoints:
      - name: https-fights
        targetPort: 8083
        exposure: public
        protocol: https
    env:
      - name: DEBUG_PORT
        value: '5858'
      - name: JAVA_HOME 
        value: /etc/alternatives/jre_17
      - name: APP_PORT
        value: '8083'
      - name: DB_USER
        value: superfight
      - name: DB_PWD
        value: superfight
      - name: DB_HOST
        value: localhost
      - name: DB_SCHEMA
        value: fights
      - name: CORS_ORIGINS
        value: "/.*/"
      - name: CORS_METHODS
        value: "GET,POST,DELETE"
    args:
      - '-f'
      - /dev/null
    command:
      - tail
- name: stats-runner
  container: 
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/dev-workspace-image:nested
    memoryRequest: 128M
    memoryLimit: 1Gi
    mountSources: true
    sourceMapping: /projects
    volumeMounts:
      - name: m2
        path: /home/user/.m2
    endpoints:
      - name: https-stats
        targetPort: 8084
        exposure: public
        protocol: https
    env:
      - name: DEBUG_PORT
        value: '5858'
      - name: JAVA_HOME 
        value: /etc/alternatives/jre_17
      - name: APP_PORT
        value: '8084'
      - name: CORS_ORIGINS
        value: "/.*/"
      - name: CORS_METHODS
        value: "GET,POST,DELETE"
    args:
      - '-f'
      - /dev/null
    command:
      - tail
- name: postgres
  container:
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/postgresql-15-c9s:c9s
    memoryRequest: 128M
    memoryLimit: 512M
    sourceMapping: /projects
    mountSources: true
    env:
    - name: POSTGRESQL_USER
      value: postgres
    - name: POSTGRESQL_PASSWORD
      value: postgres
    - name: POSTGRESQL_DATABASE
      value: postgres
    volumeMounts:
    - name: pgdata
      path: /var/lib/pgsql/data
    endpoints:
      - name: postgres
        targetPort: 5432
        exposure: internal
- name: fights-db
  container:
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/mongodb:5.0
    endpoints:
      - name: fights-db
        targetPort: 27017
        exposure: internal
    memoryRequest: 64M
    memoryLimit: 256M
- name: fights-kafka
  container:
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/kafka:0.34.0-kafka-3.4.0
    env:
    - name: LOG_DIR
      value: /tmp/logs
    - name: KAFKA_ADVERTISED_LISTENERS
      value: PLAINTEXT://fights-kafka:9092
    endpoints:
      - name: kafka
        targetPort: 9092
        exposure: internal
    command:
      - '/usr/bin/sh'
    args:
      - '-c'
      - >-
        /opt/kafka/bin/kafka-storage.sh format -t $(/opt/kafka/bin/kafka-storage.sh random-uuid) -c /opt/kafka/config/kraft/server.properties && bin/kafka-server-start.sh /opt/kafka/config/kraft/server.properties --override advertised.listeners=${KAFKA_ADVERTISED_LISTENERS}
    memoryRequest: 128M
    memoryLimit: 768M
- name: jaeger
  container:
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/jaegertracing-all-in-one:1
    sourceMapping: /projects
    endpoints:
      - exposure: public
        name: jaeger-ui
        targetPort: 16686
      - exposure: internal
        name: jaeger-thrift
        targetPort: 14268
      - exposure: internal
        name: jaeger-proto
        targetPort: 14250
      - exposure: internal
        name: otlp-receiver
        targetPort: 4317
    memoryRequest: 32M
    memoryLimit: 128M
- name: prometheus
  container:
    image: image-registry.openshift-image-registry.svc:5000/quarkus-super-heroes-dev-images/prometheus:v2.43.0
    sourceMapping: /projects
    args:
      - '--config.file=/projects/quarkus-super-heroes-dev-ex-edition/dev-init/prometheus.yaml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/usr/share/prometheus/console_libraries'
      - '--web.console.templates=/usr/share/prometheus/consoles'
    command:
      - '/bin/prometheus'
    endpoints:
      - exposure: public
        name: prometheus
        targetPort: 9090
    memoryRequest: 32M
    memoryLimit: 128M
    volumeMounts:
      - name: prometheus-data
        path: /prometheus
- name: oc-cli
  container:
    args:
      - '-c'
      - >-
        mkdir -p /projects/bin && cp /usr/bin/oc /projects/bin/oc && cp /usr/bin/kubectl /projects/bin/kubectl
    command:
      - /bin/bash
    image: image-registry.openshift-image-registry.svc:5000/openshift/cli:latest
    sourceMapping: /projects
    mountSources: true
    memoryRequest: 128M
    memoryLimit: 256M
- volume:
    size: 4Gi
  name: projects
- volume:
    size: 2Gi
  name: m2
- volume:
    size: 2Gi
  name: npm
- volume:
    size: 2Gi
  name: pgdata
- volume:
    size: 2Gi
  name: prometheus-data
commands:
- apply:
    component: oc-cli
    label: Copy OpenShift CLI
  id: cp-oc-cli
- exec:
    commandLine: psql -f initialize-tables.sql
    component: postgres
    workingDir: '/projects/quarkus-super-heroes-dev-ex-edition/dev-init/heroes/'
    label: 'Initialize Heroes Database'
  id: create-heroes-db
- exec:
    commandLine: psql -f initialize-tables.sql
    component: postgres
    workingDir: '/projects/quarkus-super-heroes-dev-ex-edition/dev-init/villains/'
    label: 'Initialize Villains Database'
  id: create-villains-db
- exec:
    commandLine: quarkus dev -Dquarkus.analytics.disabled=false -Dmaven.repo.local=/home/user/.m2/repository -Dquarkus.http.host=0.0.0.0 -Dmaven.test.skip 
    component: heroes-runner
    workingDir: '/projects/quarkus-super-heroes-rest-heroes'
    label: 'Heroes Service - Live Dev Mode'
  id: heroes-service-dev-mode
- exec:
    commandLine: quarkus dev -Dquarkus.analytics.disabled=false -Dmaven.repo.local=/home/user/.m2/repository -Dquarkus.http.host=0.0.0.0 -Dmaven.test.skip 
    component: heroes-runner
    workingDir: '/projects/quarkus-super-heroes-rest-villains'
    label: 'Villains Service - Live Dev Mode'
  id: villains-service-dev-mode
- exec:
    commandLine: quarkus dev -Dquarkus.analytics.disabled=false -Dmaven.repo.local=/home/user/.m2/repository -Dquarkus.http.host=0.0.0.0 -Dmaven.test.skip 
    component: villains-runner
    workingDir: '/projects/quarkus-super-heroes-rest-fights'
    label: 'Fights Service - Live Dev Mode'
  id: fights-service-dev-mode
- exec:
    commandLine: quarkus dev -Dquarkus.analytics.disabled=false -Dmaven.repo.local=/home/user/.m2/repository -Dquarkus.http.host=0.0.0.0 -Dmaven.test.skip 
    component: ui-runner
    workingDir: '/projects/quarkus-super-heroes-rest-fights'
    label: 'Heroes UI - Live Dev Mode'
  id: ui-dev-mode
events:
  preStart:
    - cp-oc-cli
l0rd commented 11 months ago

I am not able to reproduce the problem. I have tried to add one endpoint to a simple workspace and the route was created successfully. I tried with your devfile but I am not able to use it (the referenced images are in local registry).

cgruver commented 11 months ago

@l0rd let me see if I can reproduce it again. I'm OOO for a couple of days, but will update here.

If you want to run that demo app, you can create the local image-streams here: https://github.com/quarkus-super-heroes-dev-ex/.github/blob/main/profile/README.md

che-bot commented 5 months ago

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.