microshift
microshift copied to clipboard
[Enhancement]: Make the default Wildcard Domain configrable
What would you like to be added:
It would be nice to be able to configure the default wildcard domain to use when running oc expose svc or oc create route. The default mDNS is fine, but it would be nice to be able to configure this in the config.yaml file.
Example:
---
dataDir: /tmp/microshift/data
auditLogDir: /tmp/microshift/logs
logVLevel: 4
roles:
- role1
- role2
nodeName: node1
nodeIP: '1.2.3.4'
cluster:
url: https://1.2.3.4:6443
clusterCIDR: '10.20.30.40/16'
serviceCIDR: '40.30.20.10/16'
dns: 'cluster.dns'
domain: cluster.local
wildcardDomain: 'apps.example.com' # add this
This should produce a route of
{servicename}-{serviceproject}.apps.example.com when someone runs oc expose or oc create route
Why is this needed:
There's probably many reasons to add this, but my specific use case revolves around application delivery via GitOps (Argo CD or ACM)
Doing GitOps with the OpenShift router is sort of a pain because the hostname field is always different. So you have to store a "generic" version of it like this
apiVersion: route.openshift.io/v1
kind: Route
metadata:
creationTimestamp: null
labels:
app: bgd
name: bgd
namespace: bgd
spec:
host: ""
port:
targetPort: 8080
to:
kind: Service
name: bgd
weight: 100
status: {}
Which works, because the OpenShift Ingress Controller "automagically" fills out the host field for me. This way, I can store this as a generic file in Git, but deploy to n+∞ OpenShift/µShift clusters without worrying about the destination configuration.
Updating the Router Deployment with the following env vars worked for me...
- name: ROUTER_SUBDOMAIN
value: ${name}-${namespace}.apps.127.0.0.1.nip.io
- name: ROUTER_ALLOW_WILDCARD_ROUTES
value: "true"
- name: ROUTER_OVERRIDE_HOSTNAME
value: "true"
So maybe just make the Router Deployment a go template?
Thanks for the suggestion @christianh814 !
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
/remove-lifecycle stale
/kind feature
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.
/close
@openshift-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting
/reopen. Mark the issue as fresh by commenting/remove-lifecycle rotten. Exclude this issue from closing again by commenting/lifecycle frozen./close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.