che: Can not access to container port via service on OCP

Description

Can not access to container port via service on local OCP.

This feature is needed for running language servers in parallel containers.

Reproduction Steps

  1. Run OCP with the following script https://github.com/eclipse/che/blob/master/deploy/openshift/ocp.sh
  2. Create the following objects via OCP console:
  • Create a project;
  • Click Add to Project
  • Click Import YAML/JSON
  • Paste the following YAML and click Create
Objects to import
---
kind: List
items:
-
  apiVersion: v1
  kind: Pod
  metadata:
    name: tomcat-pod
    labels:
      app: tomcat
  spec:
    containers:
      -
        image: sleshchenko/webapp
        name: tomcat-container
        ports:
          -
            containerPort: 8080
            protocol: TCP
      -
        image: eclipse/ubuntu_jdk8
        name: requester
-
  apiVersion: v1
  kind: Service
  metadata:
    name: tomcat
  spec:
    ports:
      - name: tomcat
        port: 8080
        protocol: TCP
        targetPort: 8080
    selector:
      app: tomcat
  1. Open terminal in the newly created pod in requester container.
  2. Try to access tomcat via service. Execute curl tomcat:8080 Expected: Response HELLO Actual: Request hung up.

Note that it works fine on https://console.codenvy.openshift.com/ or http://console.starter-us-east-2.openshift.com/. Note that it works fine if containers are in separated pods.

Containers in separated pods
---
kind: List
items:
-
  apiVersion: v1
  kind: Pod
  metadata:
    name: tomcat-pod
    labels:
      app: tomcat
  spec:
    containers:
      -
        image: sleshchenko/webapp
        name: tomcat-container
        ports:
          -
            containerPort: 8080
            protocol: TCP
-
  apiVersion: v1
  kind: Pod
  metadata:
    name: requester
  spec:
    containers:
      -
        image: eclipse/ubuntu_jdk8
        name: requester
-
  apiVersion: v1
  kind: Service
  metadata:
    name: tomcat
  spec:
    ports:
      - name: tomcat
        port: 8080
        protocol: TCP
        targetPort: 8080
    selector:
      app: tomcat

OCP version:
3.7.0 and 3.9.0

Diagnostics:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

Should we perhaps close the issue as it cannot be fixed on Che side. The issue has been opened for a while and the issue in Origin does not seem to get any attention either.