Can not access to container port via service on OCP
See original GitHub issueDescription
Can not access to container port via service on local OCP.
This feature is needed for running language servers in parallel containers.
Reproduction Steps
- Run OCP with the following script https://github.com/eclipse/che/blob/master/deploy/openshift/ocp.sh
- 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
- Open terminal in the newly created pod in
requester
container. - Try to access tomcat via service. Execute
curl tomcat:8080
Expected: ResponseHELLO
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:
Issue Analytics
- State:
- Created 6 years ago
- Comments:21 (10 by maintainers)
Top Results From Across the Web
Using port forwarding to access applications in a container
OpenShift Container Platform supports port forwarding to pods. Understanding port forwarding. You can use the CLI to forward one or more local ports...
Read more >Troubleshooting OpenShift Internal Networking
Service Port is Incorrect ... This port, port 443, reroutes to port 8443 on the target container. Make sure that your requests are...
Read more >Troubleshooting Guide for OpenShift Container Platform
Open a terminal session to each master and examine /var/log/messages · If there are no clues there, edit /etc/sysconfig/atomic-openshift-master-api · change ...
Read more >Accessing Red Hat OpenShift clusters - IBM Cloud Docs
Both service endpoint URLs: You can access your cluster either through the public or ... If you can't or don't want to open...
Read more >Using a NodePort to Get Traffic into the Cluster - Fedora People
The first step in allowing access to a service is to define an external IP address range in the master configuration file: Log...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.
Closing since we found a solution with userland proxy.