0

Have been using the JKube maven plugin for a while and wanted to see if I could also make a Gradle based version.

I have created a ConfigMap using the DSL, but can't seem to find a way to configure it within the Deployment. So opted for a "deployment.yml" resource fragment.

So how do I inject dynamic data in this resource fragment using the gradle version?

In the maven version I would do something like:

metadata:
  annotations:
    configmap.jkube.io/update-on-change: ${service.name}
  name: ${service.name}

This to dynamically insert the service name (injected and runtime and therefore dynamic based on branchname, version etc.).

So how can I do this with gradle? The same notation isn't working, so it would seem that the vars isn't replaced...

/Tue

  • This should work with gradle properties too. These properties can be set in any of the gradle.properties files (project, global, etc.) or through the command line when running gradle `gradle -Pservice.name=name k8sResource...` – Marc Nuri Feb 09 '23 at 06:09

0 Answers0