在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):kokuwaio/helm-maven-plugin开源软件地址(OpenSource Url):https://github.com/kokuwaio/helm-maven-plugin开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):Helm Maven PluginThis is a Maven plugin for testing, packaging and uploading HELM charts. "HELM is a tool for managing Kubernetes charts. Charts are packages of pre-configured Kubernetes resources." Visit https://docs.helm.sh for detailed information. Currently the upload to ChartMuseum, Artifactory and Nexus is supported. Helm v3From version 5.0 Helm v3 is required. There is no longer support for Helm v2. For convenience reasons the stable repo is added by default. Helm v2 users can still use plugin version 4.13. Why?Currently (October 2017) there is no simple Maven plugin to package existing HELM charts. How?By default, the plugin automatically downloads Helm at the specified version. You can also manually specify the download URL. Next to that it is possible to specify a local Helm binary. In all cases Helm will be executed in the background. Add following dependency to your pom.xml: <dependency>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.3.0</version>
</dependency> Configuration ExamplesHelm URL Auto DetectionThe default setting is to construct the Helm download URL based upon the detected OS and architecture: <build>
<plugins>
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.3.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
</configuration>
</plugin>
</plugins>
</build> If you leave Usage with Downloaded Binary<build>
<plugins>
...
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.3.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
<!-- This is the related section when using binary download -->
<helmDownloadUrl>https://get.helm.sh/helm-v3.8.1-linux-amd64.tar.gz</helmDownloadUrl>
</configuration>
</plugin>
...
</plugins>
</build> Usage with Local BinaryWhen <build>
<plugins>
...
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.3.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
<!-- This is the related section to use local binary with auto-detection enabled. -->
<useLocalHelmBinary>true</useLocalHelmBinary>
</configuration>
</plugin>
...
</plugins>
</build> The following is an example configuration that explicitly sets the directory in which to look for the <build>
<plugins>
...
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.3.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
<!-- This is the related section to use local binary with auto-detection disabled. -->
<useLocalHelmBinary>true</useLocalHelmBinary>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<helmExecutableDirectory>/usr/local/bin</helmExecutableDirectory>
</configuration>
</plugin>
...
</plugins>
</build> Configure Plugin to Use Credentials from settings.xml for Upload<build>
<plugins>
...
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.3.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
<!-- This is the related section to configure upload repos -->
<uploadRepoStable>
<name>stable-repo</name>
<url>https://repo.example.com/artifactory/helm-stable</url>
<type>ARTIFACTORY</type>
</uploadRepoStable>
<uploadRepoSnapshot>
<name>snapshot-repo</name>
<url>https://my.chart.museum:8080/api/charts</url>
<type>CHARTMUSEUM</type>
</uploadRepoSnapshot>
<helmDownloadUrl>https://get.helm.sh/helm-v3.8.1-linux-amd64.tar.gz</helmDownloadUrl>
</configuration>
</plugin>
...
</plugins>
</build> More Complex Example<build>
<plugins>
...
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.3.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
<uploadRepoStable>
<name>stable-repo</name>
<url>https://repo.example.com/artifactory/helm-stable</url>
<type>ARTIFACTORY</type>
<username>foo</username>
<password>bar</password>
</uploadRepoStable>
<uploadRepoSnapshot>
<name>snapshot-repo</name>
<url>https://my.chart.museum/api/charts</url>
<type>CHARTMUSEUM</type>
</uploadRepoSnapshot>
<helmDownloadUrl>https://get.helm.sh/helm-v3.8.2-linux-amd64.tar.gz</helmDownloadUrl>
<registryConfig>~/.config/helm/registry.json</registryConfig>
<repositoryCache>~/.cache/helm/repository</repositoryCache>
<repositoryConfig>~/.config/helm/repositories.yaml</repositoryConfig>
<!-- Add a gpg signature to the chart -->
<keyring>~/.gpg/secring.gpg</keyring>
<key>MySigningKey</key>
<passphrase>SecretPassPhrase</passphrase>
<!-- Lint with strict mode -->
<lintStrict>true</lintStrict>
<!-- Disable adding of default repo stable https://charts.helm.sh/stable -->
<addDefaultRepo>false</addDefaultRepo>
<!-- Exclude a directory to avoid processing -->
<excludes>
<exclude>${project.basedir}/excluded</exclude>
<exclude>${project.basedir}/**/excluded*</exclude>
</excludes>
<!-- Add an additional repo -->
<helmExtraRepos>
<helmRepo>
<name>kokuwa</name>
<url>https://kokuwa.github.io</url>
</helmRepo>
</helmExtraRepos>
<!-- extra value settings for the lint command -->
<values>
<overrides>
<component1.install.path>/opt/component1</component1.install.path>
</overrides>
<yamlFile>${project.basedir}/src/test/resources/myOverrides.yaml</yamlFile>
<yamlFiles>
<yamlFile>${project.basedir}/src/test/resources/myOverrides-1.yaml</yamlFile>
<yamlFile>${project.basedir}/src/test/resources/myOverrides-2.yaml</yamlFile>
</yamlFiles>
</values>
</configuration>
</plugin>
...
</plugins>
</build> Features
UsageGoals
Configuration
Packaging with the Helm LifecycleTo keep your pom files small you can use 'helm' packaging. This binds <pom>
<artifactId>my-helm-charts</artifactId>
<version>0.0.1</version>
<packaging>helm</packaging>
...
<build>
<plugins>
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<!-- Mandatory when you use a custom lifecycle -->
<extensions>true</extensions>
<configuration>
...
</configuration>
</plugin>
</plugins>
....
</build>
</pom> |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论