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

https-endpoint with tls-termination passtrough on openshift #14622

Closed
wgbeckmann opened this issue Sep 21, 2019 · 10 comments
Closed

https-endpoint with tls-termination passtrough on openshift #14622

wgbeckmann opened this issue Sep 21, 2019 · 10 comments
Labels
area/devfile-spec Issues related to Devfile v2 engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@wgbeckmann
Copy link

Hi,
I have in my devfile an endpoint, that servs a https application.
So I defined the following in my devfile:

...
  - mountSources: true
    type: dockerimage
    image: 'airhacks/payara'
    alias: payara
    endpoints:
      - name: root
        port: 8080
      - name: payara-console
        port: 4848
        attributes:
           protocol: https
           secure: 'false'
           public: 'true'
           discoverable: 'true'
...

But Openshift creates a normal http-route.
When I configure the generatet openshift route manualy to secure and TLS-termination to passtrough it works. But I want to configure it via the devfile.

So, how do I do it?

If you want to test it:
Here is the complete devfile:

metadata:
  name: java-vue
components:
  - id: redhat/java/latest
    type: chePlugin
  - mountSources: true
    memoryLimit: 512Mi
    type: dockerimage
    volumes:
      - name: m2
        containerPath: /home/user/.m2
    image: 'quay.io/eclipse/che-java11-maven:nightly'
    alias: maven
    env:
      - value: /home/user/.m2
        name: MAVEN_CONFIG
      - value: >-
          -XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10
          -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4
          -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true
          -Xms20m -Djava.security.egd=file:/dev/./urandom -Duser.home=/home/user
        name: MAVEN_OPTS
      - value: >-
          -XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10
          -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4
          -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true
          -Xms20m -Djava.security.egd=file:/dev/./urandom
        name: JAVA_OPTS
      - value: >-
          -XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10
          -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4
          -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true
          -Xms20m -Djava.security.egd=file:/dev/./urandom
        name: JAVA_TOOL_OPTIONS
  - mountSources: true
    type: dockerimage
    image: 'centos/postgresql-10-centos7'
    alias: pgsqldb
    env:
      - value: admin
        name: POSTGRESQL_USER
      - value: admin
        name: POSTGRESQL_PASSWORD
      - value: devdb
        name: POSTGRESQL_DATABASE
      - value: admin
        name: POSTGRESQL_ADMIN_PASSWORD
    command:
      - run-postgresql
  - mountSources: true
    type: dockerimage
    image: 'airhacks/payara'
    alias: payara
    endpoints:
      - name: root
        port: 8080
      - name: payara-console
        port: 4848
        attributes:
           protocol: https
           secure: 'false'
           public: 'true'
           discoverable: 'true'           
apiVersion: 1.0.0

After you start the workspace you have to configure the payara. (not yet automated)
Start a new terminal in the payara user-runtime and:

sh-4.2$ asadmin --host localhost --port 4848 change-admin-password
Enter admin user name [default: admin]>
Enter the admin password> 
Enter the new admin password> admin
Enter the new admin password again> admin
Command change-admin-password executed successfully.
sh-4.2$ asadmin --host localhost --port 4848 enable-secure-admin
Enter admin user name>  admin
Enter admin password for user "admin">  admin
You must restart all running servers for the change in secure admin to take effect.
Command enable-secure-admin executed successfully.
sh-4.2$ asadmin --host localhost --port 4848 restart-domain
Successfully restarted the domain
Command restart-domain executed successfully.

After this you edit the generated route directly in openshift as described above.

@wgbeckmann wgbeckmann added the kind/question Questions that haven't been identified as being feature requests or bugs. label Sep 21, 2019
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Sep 21, 2019
@rhopp
Copy link
Contributor

rhopp commented Sep 23, 2019

@skabashnyuk This seems like a bug, right?

@rhopp rhopp added area/devfile severity/P1 Has a major impact to usage or development of the system. kind/bug Outline of a bug - must adhere to the bug report template. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. kind/question Questions that haven't been identified as being feature requests or bugs. labels Sep 23, 2019
@skabashnyuk
Copy link
Contributor

@wgbeckmann I think that the situation (che on http but some endpoints on https) that you've described was never considered as "working". The only suggestion that I have is to enable TLS for the whole Che environment https://github.com/eclipse/che/blob/master/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties#L558

@wgbeckmann
Copy link
Author

wgbeckmann commented Sep 23, 2019

@skabashnyuk: Ok, but what does that mean in concrete for a server if I set the attribut in a tls enabled environment to http, would openshift`s router automaticaly remove the https encryption?
And what happens when a sevice itselfs serves https? Do Openshift uses passthrough or reencryption and how do I influence it?
The docu says:

protocol: For public endpoints the protocol is a hint to the UI on how to construct the URL for the endpoint access. Typical values are http, https, ws, wss.
(Doku)

That sounds for me: Your traffic is only tunneld and not mainpulated.
But that is not possible in openshift. So perhaps there are more attribute parameters needet for configuring the endpoints right.

@skabashnyuk
Copy link
Contributor

Ok, but what does that mean in concrete for a server if I set the attribut in a tls enabled environment to http

That means that che server will override this property and set https instead of http. Opposite situation afaik never tested/checked.

And what happens when a sevice itselfs serves https? Do Openshift uses passthrough or reencryption and how do I influence it?

I would say in "production" scenario we should always enable TLS

@wgbeckmann
Copy link
Author

wgbeckmann commented Sep 25, 2019

@skabashnyuk: Before I change everything. Again the question: What happens when a sevice itselfs serves https? Do Openshift uses passthrough or reencryption?
Just because. if I want to use Payara, I must configure the server to expose tls. Otherwise I cannot use the admin-console of payara. So openshift must create a passthrough route.

@skabashnyuk
Copy link
Contributor

What happens when a sevice itselfs serves https? Do Openshift uses passthrough or reencryption?

@wgbeckmann I don't know.
@davidfestal @sleshchenko any idea about that?

@skabashnyuk skabashnyuk added kind/enhancement A feature request - must adhere to the feature request template. and removed kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. labels Mar 4, 2020
@vandepol
Copy link

Is there any update on this? I'm trying to use odo with devfiles and it's creating application route as tls termination: edge. Manually creating route with tls termination passthrough works fine, but like @wgbeckmann I'd like to configure this through the devfile.

Thanks

@sleshchenko
Copy link
Member

@davidfestal @l0rd Is it something at least addressed in the Devfile 2.0 Spec?

@l0rd l0rd added area/devfile-spec Issues related to Devfile v2 engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. and removed area/devfile-spec Issues related to Devfile v2 area/devfile labels Jun 17, 2020
@che-bot
Copy link
Contributor

che-bot commented Jan 4, 2021

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 Jan 4, 2021
@l0rd l0rd removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 11, 2021
@che-bot
Copy link
Contributor

che-bot commented Sep 2, 2021

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 Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-spec Issues related to Devfile v2 engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/enhancement A feature request - must adhere to the feature request template. 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

7 participants