如何制作OpenShift ConfigMap Universal?

发布于 01-24 05:05 字数 747 浏览 5 评论 0原文

我有一个OpenShift 4.10安装,在不同的名称空间中运行了许多应用程序,我想在其中制作一个可用的tnsnames.ora文件。

我在其中使用tnsnames.ora进行了配置示意,用于我的“沙盒”名称空间,并且适用于我的测试应用程序。

OC创建configmap test-tns -from-file =/etc/tns/tnsnames.ora

,然后在我的部署中,我添加了此信息:

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

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

可以很好地工作自己的名字。

我想做的是“使其可用于所有名称空间”。 即:我不想要求我的开发人员自己制作自己的TNS ConfigMap。我只想只有一个人(当前或将来)可以将其“挂接”到我的tnsnames.vol中,并在所有命名空间中使用它在其应用程序中工作。

我不确定如何做到这一点,并且正在寻找有关如何使其工作的建议,或者 - 或者 - 如果这是一个好主意,或者人们如何提供“普遍可用的配置文件”。

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一场春暖2025-01-31 05:05:28

使用您的配置映射定义更新OpenShift群集的默认项目模板,因此,任何新的项目/名称空间都将创建您的配置映射资源。

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 .

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文