Kubernetes:从j2模板dynamic创buildconfigurationjson文件

在kubernetes或docker中是否有已经内置的j2模板处理器? 我正在做下面的configuration,并希望插入模板上的值。

请注意,使用hostPath不是一个选项,因为这是使用openshift并且不能使用pv / pvc。

containers: - image: some-docker-image:latest name: some-docker-image volumeMounts: - mountPath: /etc/app/conf name: configuration-volume . . Do some j2 template processing here if possible. . volumes: - name: configuration-volume gitRepo: repository: "https://gitrepo/repo/example.git 

Kubernetes中没有任何模板支持。 你可以在yaml / json文件的顶部轻松构build一个模板系统,然后通过kubectl -f create 。 我知道一些使用jsonnet来完成这个任务的人。

关于添加模板的讨论发生在https://github.com/kubernetes/kubernetes/issues/23896如果你想贡献。