Bug 1583274 - [DOCS] oc new-app ignores LABEL io.openshift.expose-services
Summary: [DOCS] oc new-app ignores LABEL io.openshift.expose-services
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 3.11.0
Assignee: Vikram Goyal
QA Contact: Vikram Goyal
Vikram Goyal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-28 15:47 UTC by Jens Reimann
Modified: 2021-09-09 14:16 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-04 14:35:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jens Reimann 2018-05-28 15:47:29 UTC
Description of problem:

The documentation at <https://docs.openshift.org/latest/creating_images/metadata.html> states that you can add a LABEL in the Dockerfile named "io.openshift.expose-services" which should name ports when creating new applications.

However, creating a new application with "oc new-app" this information is ignored (at least when using S2I) and only the information of the "EXPORT" keyword is used.

Which results in ports being created nameless.

Version-Release number of selected component (if applicable):

oc v3.9.14
kubernetes v1.9.1+a0ce1bc657
features: Basic-Auth GSSAPI Kerberos SPNEGO
Server https://<myurl>:8443
openshift v3.9.14
kubernetes v1.9.1+a0ce1bc657

How reproducible:


Steps to Reproduce:
1. oc new-project foo
2. oc new-app ctron/s2i-java~https://github.com/ctron/hono-example-bridge

Actual results:

Check "dc/hono-example-bridge", container ports are present but don't have a name.

Expected results:

Port 8778 is named "jolokia". Port 9779 is named "prometheus".

Additional info:

YML created by "oc new-app"
---
spec:
       containers:
       - image: docker-registry.default.svc:5000/foo/hono-example-bridge@sha256:d691f8eebb1088a8d4084ba93aea6e28ae983ae226b2a996654a64aaaa84a2e1
         imagePullPolicy: Always
         name: hono-example-bridge
         ports:
         - containerPort: 8778
           protocol: TCP
         - containerPort: 9779
           protocol: TCP
         resources: {}
         terminationMessagePath: /dev/termination-log
         terminationMessagePolicy: File
       dnsPolicy: ClusterFirst
       restartPolicy: Always
       schedulerName: default-scheduler
       securityContext: {}
       terminationGracePeriodSeconds: 30
   test: false
   triggers:
---

Docker inspect image info:

---
            "Labels": {
…
                "com.redhat.deployments-dir": "/deployments",
                "com.redhat.dev-mode": "JAVA_DEBUG:false",
                "com.redhat.dev-mode.port": "JAVA_DEBUG_PORT:5005",
                "io.fabric8.s2i.version.jolokia": "1.5.0",
                "io.fabric8.s2i.version.maven": "3.3.3",
                "io.fabric8.s2i.version.prometheus.jmx_exporter": "0.1.0",
                "io.k8s.description": "Platform for building and running plain Java applications (fat-jar and flat classpath)",
                "io.k8s.display-name": "Java Applications",

-->             "io.openshift.expose-services": "8778:jolokia,9779:prometheus",

                "io.openshift.s2i.destination": "/tmp",
                "io.openshift.s2i.scripts-url": "image:///usr/local/s2i",
                "io.openshift.tags": "builder,java",
…
            }

---

Comment 5 Ben Parees 2018-06-19 14:00:15 UTC
Moving to docs component as the plan for this bug is to remove the docs that imply those image labels are consumed by openshift in a meaningful way.

Comment 6 Adam Kaplan 2018-06-29 13:56:56 UTC
Docs PR: https://github.com/openshift/openshift-docs/pull/10531

Comment 7 openshift-github-bot 2018-07-02 02:47:36 UTC
Commit pushed to master at https://github.com/openshift/openshift-docs

https://github.com/openshift/openshift-docs/commit/23bfa744c82ff759b295dce559a3548412fa31a1
rm io.openshift.expose-services label

Remove the io.openshift.expose-services label from docs.
This is not consumed in any meaningful way by OpenShift.

Bug 1583274

Comment 9 Jens Reimann 2018-07-04 13:54:47 UTC
I think this feature is still helpful when you are using "oc new-app", simply removing this isn't really helping.

> Remove the io.openshift.expose-services label from docs.
> This is not consumed in any meaningful way by OpenShift.

I agree that it is not consumed in a meaningful way at the moment, but maybe the that should be changed instead.

When you are preparing a tutorial about OpenShift and offer the (super simple) use of "oc new-app", showing how easy it is with OpenShift to build and deploy e.g a Java application. Then, in the case of Java, you need to name the port on which Jolokia is exposed "jolokia". Otherwise the console link it not provided in the OpenShift Web UI.

However there seems to be no way to set the name of a port after using "oc new-app" other than editing the YAML code with the Web UI or "oc edit". Which completely ruins the whole experience.

Comment 10 Ben Parees 2018-07-04 14:35:05 UTC
The reported bug is resolved. Please don't reopen this again. If you want to file an rfe requesting a new metadata feature, please do so, but understand my above comment will still apply for why I do not think it is something we should pursue, and that bar will need to be cleared.


Note You need to log in before you can comment on or make changes to this bug.