Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-13398

ch03s01: incorrectly states that OpenShift web console does not use the EXPOSE value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • DO288 - OCP4.12-en-4-20240304
    • DO288
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • 3
    • en-US (English)

      Please fill in the following information:


      https://rol.redhat.com/rol/app/courses/do288-4.12/pages/ch03

      Issue description

      The section "Expose Ports" incorrectly states:

      In contrast, adding a new application from the OpenShift web console typically does not use the EXPOSE value. You must set the port explicitly by using web forms.

      The port that is suggested in "Advanced options" section of the image deployment workflow is the first port found in the list of exposed ports (using the EXPOSE directive), but any other ports declared in EXPOSE also appear in the dropdown list.

      What is not used any more (by either the web console or the oc new-app command) is the label io.openshift.expose-services.

      $ podman inspect registry.ocp4.example.com:8443/redhattraining/php-hello-dockerfile:latest | jq .[0].Config.ExposedPorts
      {
        "8080/tcp": {}
      }
      
      $ cat Containerfile
      FROM registry.ocp4.example.com:8443/redhattraining/php-hello-dockerfile:latest
      USER 0
      RUN sed -i 's/Listen 8080/Listen 1234/' /etc/httpd/conf/httpd.conf
      USER 1001
      EXPOSE 1234/tcp 
      
      $ podman build -t php-hello-newport:latest .
      ...
      
      $ podman inspect php-hello-newport:latest | jq .[0].Config.ExposedPorts
      {
        "1234/tcp": {},
        "8080/tcp": {}
      }
      
      $ skopeo copy containers-storage:localhost/php-hello-newport:latest docker://registry.ocp4.example.com:8443/developer/php-hello-newport:latest
      ...

      After performing the above, the OpenShift web console will show both ports in target port selection drop-down list, with 1234 being the default selection (see screenshots below).

        1. image-2024-05-07-17-41-18-674.png
          24 kB
          Carlos Arias
        2. Screenshot 2024-05-06 at 06.34.23.png
          102 kB
          Grega Bremec
        3. Screenshot 2024-05-06 at 06.34.44.png
          48 kB
          Grega Bremec

            gregab@p0f.net Grega Bremec
            gregab@p0f.net Grega Bremec
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: