Provides access to helm
, a package manager for Kubernetes.
The plugin works together with the kubectl
plugin and reuses its context configuration.
Add this library to the classpath:
buildscript {
dependencies {
...
classpath 'gradle.plugin.com.github.rmee:helm:<VERSION>'
}
}
An example usage may look like:
apply plugin: 'helm'
helm {
tillerNamespace = oc.projectName
cli {
version = '3.2.1` // version to use
imageName = 'dtzar/helm-kubectl'
}
}
task helmStatus(type: HelmExec) {
dependsOn ocLogin, helmPackage
commandLine "helm status demo"
}
task helmInstall(type: HelmExec) {
dependsOn ocLogin, helmPackage
commandLine "helm install ${helmPackage.outputs.files.singleFile} --name demo"
}
task helmUpgrade(type: HelmExec) {
dependsOn ocLogin, helmPackage
commandLine "helm upgrade demo ${helmPackage.outputs.files.singleFile}"
}
For more detailed information, have a look at the HelmExtension
.
The helm
plugin makes this tasks available:
HelmBootstrap
downloads the cli.HelmExec
allow to issue a command. Alternatively,helm.exec(...)
can be used.HelmPackage
to package the Helm sources. Helm packages must be specified insrc/main/helm
. Each subdirectory will make up one helm package. ThehelmPackage
command will then build each of the packages and put the result intobuild/distributions
.HelmExec
to setup custom commands. Alternatively,helm.exec(...)
can be used.
For an example app have a look at https://github.com/crnk-project/crnk-example[crnk-example] how to deploy to Google Cloud with Kubernetes and Helm. Or https://github.com/cord3c/cord3c-project/tree/master/cord3c-example-deployment[cord3c-example] for how to deploy to DigitalOcean.
A wrapper helm
will be generated into the project root to allow easy access from the command line next to Gradle tasks.