This post was originally written by Akram Ben Aissi in his blog: http://akrambenaissi.com/2016/02/21/run-openshift-console-on-port-443/ 

One thing that I really like on OpenShift, is that it very often eat its own food. To my opinion, it is generally a sign of a good design, but that’s another story.
In this blog, I wanted to give a clue on how to make the OpenShift console run on port 443 by using the openshift-router facilities, service and endpoints. This could be very useful for example, if you do have some network setup preventing access to port 8443, which is often the case on corporate networks.

As a disclaimer, I want just to state that this is not (well for now) a production-proof design but, at least you can use it for demonstration purposes or simply to understand the way OpenShift externalservices works.

You will guess that the idea here, is to create an OpenShift external service pointing to the OpenShift master URL and then create a route that will be served by openshift-router to forward request to the OpenShift master itself. It this road, need to create and OpenShift Endpoint as stated by documentation.
And the final trick, is to change your masterPublicURL and master publicURL parameters in master-config.yaml OpenShift configuration to match the route’s URL.

Here is the configuration: You will need to get:
– Your master internal IP address
– A wildcard entry or DNS entry pointing to your openshift-router nodes (can also the be the master itself if you are running the router on master)
– That’s all

So, let’s assume the following settings:
My master’s domaine name is: pass.mycompany.com
My master’s internal IP address is: 192.168.1.1
My openshift-router runs on IP 50.50.50.50 and my DNS entry pass.mycompany.com points to it

So you need to create a Service:

apiVersion: v1
kind
: Service
metadata
:
creationTimestamp
: null
labels
:
name
: openshift-master
spec
:
ports
:
- name: 8443-tcp
port
: 8443
protocol
: TCP
targetPort
: 8443
selector
: {}
status
:
loadBalancer
: {}

and create manually the corresponding Endpoint

apiVersion: v1
kind
: Endpoints
metadata
:
creationTimestamp
: null
name
: openshift-master
subsets
:
- addresses:
- ip: 192.168.1.1
ports
:
- name: 8443-tcp
port
: 443
protocol
: TCP

And then, you need a route with a host entry point to 50.50.50.50

apiVersion: v1
kind
: Route
metadata
:
creationTimestamp
: null
name
: openshift-master
spec
:
host
: paas.mycompany.com
port
:
targetPort
: 8443
to
:
kind
: Service
name
: openshift-master
tls
:
termination
: passthrough
status
:
ingress
: null

and the last point, is to modify your master-config.yaml to change any occurrences to masterPublicURL or publicURL to
https://paas.mycompany.com:443.
Keep in mind that the certificates that you have generated for the console must be valid for the host URL you are pointing to, and must update your corsAllowedOrigins to add the new domain you are pointing to.

apiLevels:
- v1
apiVersion
: v1
assetConfig
:
extensionDevelopment
: false
extensionScripts
: null
extensionStylesheets
: null
extensions
: null
loggingPublicURL
: ""
logoutURL
: ""
masterPublicURL
: https://paas.mycompany.com:443
metricsPublicURL
: https://paas.mycompany.com/hawkular/metrics
publicURL
: https://paas.mycompany.com:443/console/
servingInfo
:
bindAddress
: 0.0.0.0:8443
bindNetwork
: tcp4
certFile
: master.server.crt
clientCA
: ""
keyFile
: master.server.key
maxRequestsInFlight
: 0
namedCertificates
: null
requestTimeoutSeconds
: 0
controllerLeaseTTL
: 0
controllers
: '*'
corsAllowedOrigins
:
- 127.0.0.1
- 50.50.50.50:8443
- localhost
- paas.mycompany.com
disabledFeatures
: null
...

Et voilà!
Your OpenShift master console should now be available on port 443

Author

Akram Ben Aissi

Cloud and Platform Architect,
Red Hat Consulting

LinkedIn: https://linkedin.com/in/akrambenaissi

Twitter: @akrambenaissi

GitHub: https://github.com/akram


저자 소개

UI_Icon-Red_Hat-Close-A-Black-RGB

채널별 검색

automation icon

오토메이션

기술, 팀, 인프라를 위한 IT 자동화 최신 동향

AI icon

인공지능

고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트

open hybrid cloud icon

오픈 하이브리드 클라우드

하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요

security icon

보안

환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보

edge icon

엣지 컴퓨팅

엣지에서의 운영을 단순화하는 플랫폼 업데이트

Infrastructure icon

인프라

세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보

application development icon

애플리케이션

복잡한 애플리케이션에 대한 솔루션 더 보기

Virtualization icon

가상화

온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래