Create OpenShift TLS route from secret

10/25/2018

I am looking to know (and how to do it), to create a secured (tls) route in OpenShift from a Secret that would contain my cert and key(or JAVA keystore) or 2 secret (1 with certificat, another with key) so that I do not need to write both of them in a ''route.yaml'' file directly but only refer to them......

UPDATE:

It look's like it is not possible. Unless I do passthrough to the pod... see here ---> https://access.redhat.com/solutions/1582583

Still, I do not want that it to be the definitive answer since I think this should be supported.

Can someone tell me otherwise ? Please !

-- yield
kubernetes-ingress
kubernetes-secrets
openshift
ssl

2 Answers

10/17/2019

My RFE was closed by RedHat because it should be a requirement for OpenShift4. Meanwhile, I started using tls secrets instead and managing TLS termination directly in my containers, not on the route.

It goest like this. There is a secret type for TLS

oc create secret tls mytlsSecret --cert= --key=

Hope this help !

-- yield
Source: StackOverflow

10/26/2018

Unfortunately, as far as I know, it can't configure certificates as secret in route. If you just want to make the route object using other way except a yaml file, then you can configure route using following CLI.

oc create route edge --service=frontend \
    --cert=${MASTER_CONFIG_DIR}/ca.crt \
    --key=${MASTER_CONFIG_DIR}/ca.key \
    --ca-cert=${MASTER_CONFIG_DIR}/ca.crt \
    --hostname=www.example.com

I hope it help you :^)

-- Daein Park
Source: StackOverflow