Closed Marty closed 2 years ago
@Marty You can achieve this with maven resources filtration.
${...}
substitutions in your value.yaml
which will be processed by maven on resources copying to target directory.<chartDirectory>${project.build.outputDirectory}/path/to/chart</chartDirectory>
.This advice worked pretty well for me. I did the following.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>process-helm-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<resources>
<resource>
<targetPath>${basedir}/target/helm-filtered</targetPath>
<directory>${project.basedir}/src/helm</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.3.0</version>
<configuration>
<chartDirectory>${basedir}/target/helm-filtered</chartDirectory>
<chartVersion>${project.version}</chartVersion>
<appVersion>${project.version}</appVersion>
<useLocalHelmBinary>true</useLocalHelmBinary>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<helmExecutableDirectory>/usr/local/bin</helmExecutableDirectory>
</configuration>
<executions>
<execution>
<id>helm</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
Closed because solution exists.
FEATURE REQUEST
I'd like the possibility to override the values in the
values.yaml
that gets packaged in the chart. In my CI/CD scenario I build a bunch of dockerimages and a matching helm chart.It would be nice to be able to have the correct tag of the new dockerimages already as default in the
values.yaml
.Environment (plugin version, maven version, OS, ...): Plugin Version 5.6 Apache Maven 3.6.1 Windows 10
What you expected to happen:
Either some sort of
<values><overrides>
that gets merged into thevalues.yaml
and isn't just for linting, or maven parameters to be replaced in thevalues.yaml
file.