microshift icon indicating copy to clipboard operation
microshift copied to clipboard

[Enhancement]: Make the default Wildcard Domain configrable

Open christianh814 opened this issue 3 years ago • 5 comments

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.

christianh814 avatar Mar 04 '22 16:03 christianh814

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?

christianh814 avatar Mar 05 '22 19:03 christianh814

Thanks for the suggestion @christianh814 !

mangelajo avatar May 04 '22 09:05 mangelajo

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

openshift-bot avatar Aug 02 '22 13:08 openshift-bot

/remove-lifecycle stale

christianh814 avatar Aug 02 '22 13:08 christianh814

/kind feature

dhellmann avatar Aug 21 '22 17:08 dhellmann

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

openshift-bot avatar Nov 20 '22 01:11 openshift-bot

/remove-lifecycle stale

christianh814 avatar Nov 20 '22 01:11 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

openshift-bot avatar Feb 18 '23 09:02 openshift-bot

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

openshift-bot avatar Mar 21 '23 00:03 openshift-bot

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 avatar Apr 20 '23 08:04 openshift-bot

@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.

openshift-ci[bot] avatar Apr 20 '23 08:04 openshift-ci[bot]