Currently I have an OKD/openshift template which exposes port 1883 on a specific container:
ports:
- name: 1883-tcp
port: 1883
containerPort: 1883
protocol: TCP
hostPort: ${MQTT-PORT}
Is it possible to have an if/else clause depending on parameters. For example:
ports:
- name: 1883-tcp
port: 1883
containerPort: 1883
protocol: TCP
{{ if ${MQTT-PORT} != 0 }}
hostPort: ${MQTT-PORT}
{{ /if }}
By doing this, I can have the same template in all my environments (e.g.: development/testing/production) but based on the parameters given by creation, some ports are available for debugging or testing without having to forward them each time using the oc command.