0

I have an Openshift 4.10 install, running a bunch of applications in different namespaces, in which I want to make a tnsnames.ora file available.

I've made a configmap with the tnsnames.ora in it, for my 'sandbox' namespace and that works for my test app.

oc create configmap test-tns --from-file=/etc/tns/tnsnames.ora

and then in my deployment I've added this in :

    spec:
      volumes:
        - name: tnsnames-vol
          configMap:
            name: test-tns
            defaultMode: 420

and

          volumeMounts:
            - name: tnsnames-vol
              mountPath: /etc/tns/

This works fine, for that one app in my own namepsace.

What I'd like to do is "make it available to all namespaces". Ie: I don't want to require my developers to make their own tns configmap. I'd like to have just one available to anyone ( current or in the future) to be able to just 'hook into' my tnsnames.vol and have it work in their app, across all namespaces.

I'm unsure on how to do that, and I'm looking for advice on how to get that to work, or - alternatively if this is even a good idea or how folks provide 'universally available config files'.

someguy
  • 1
  • 1
  • I think you want to handle this at the git level, then have developers pulling this resource from a shared repository you control. then when the file changes, they will need to pull the update and roll a new deployment. – MikeA Apr 30 '22 at 00:02

1 Answers1

0

Update the default project template for openshift cluster with your config map definition and that way any new project/namespace will also have your config map resource created .

Manmohan Mittal
  • 339
  • 1
  • 6
  • until the contents of tsnames.ora changes, then the default configmap that was created in all of the projects needs to be updated – MikeA Apr 29 '22 at 23:56