This plugin provides an interface between Drone and Helm 3:
- Lint your charts
- Deploy your service
- Delete your service
- Automatically migrate a release from helm v2 to v3
The plugin is inspired by drone-helm, which fills the same role for Helm 2. It provides a comparable feature-set and the configuration settings are backward-compatible.
NOTE: This a fork of pelotech/drone-helm3 created with the main purpose of adding support to convert a v2 release to v3 as part of the plugin workflow.
The examples below give a minimal and sufficient configuration for each use-case. For a full description of each command's settings, see docs/parameter_reference.md.
steps:
- name: lint
image: example.com/drone-helm
settings:
mode: lint
chart: ./steps:
- name: deploy
image: example.com/drone-helm
settings:
mode: upgrade
chart: ./
release: my-project
# disable_v2_conversion: true
environment:
KUBE_API_SERVER: https://my.kubernetes.installation/clusters/a-1234
KUBE_TOKEN:
from_secret: kubernetes_tokensteps:
- name: deploy
image: example.com/drone-helm
settings:
mode: convert
chart: ./
release: my-project
namespace: my-namespace
tiller_ns: tiller-namespace
# delete_v2_releases: true
environment:
KUBE_API_SERVER: https://my.kubernetes.installation/clusters/a-1234
KUBE_TOKEN:
from_secret: kubernetes_tokensteps:
- name: uninstall
image: example.com/drone-helm
settings:
mode: uninstall
release: my-project
environment:
KUBE_API_SERVER: https://my.kubernetes.installation/clusters/a-1234
KUBE_TOKEN:
from_secret: kubernetes_tokendrone-helm3 is largely backward-compatible with drone-helm. There are some known differences:
- You'll need to migrate the deployments in the cluster helm-v2-to-helm-v3.
- Or automatically migrate v2 releases before upgrading by using the configured default values.
- Or use the standalone
mode: convert.
- EKS is not supported. See #5 for more information.
- The
prefixsetting is no longer supported. If you were relying on theprefixsetting withsecrets: [...], you'll need to switch to thefrom_secretsyntax. - During uninstallations, the release history is purged by default. Use
keep_history: trueto return to the old behavior. - Several settings no longer have any effect. The plugin will produce warnings if any of these are present:
purge-- this is the default behavior in Helm 3recreate_podstiller_ns-- Only used ifmode: convertordisable_v2_conversion == false(default value)upgradecanary_imageclient_onlystable_repo_url
- Several settings have been renamed, to clarify their purpose and provide a more consistent naming scheme. For backward-compatibility, the old names are still available as aliases. If the old and new names are both present, the updated form takes priority. Conflicting settings will make your
.drone.ymlharder to understand, so we recommend updating to the new names:helm_commandis nowmodehelm_reposis nowadd_reposapi_serveris nowkube_api_serverservice_accountis nowkube_service_accountkubernetes_tokenis nowkube_tokenkubernetes_certificateis nowkube_certificatewaitis nowwait_for_upgradeforceis nowforce_upgrade
Since helm 3 does not require Tiller, we also recommend switching to a service account with less-expansive permissions.
This repo is setup in a way that if you enable a personal drone server to build your fork it will build and publish your image (makes it easier to test PRs and use the image till the contributions get merged)
- Build local
DRONE_REPO_OWNER=josmo DRONE_REPO_NAME=drone-ecs drone exec - on your server (or cloud.drone.io) just make sure you have DOCKER_USERNAME, DOCKER_PASSWORD, and PLUGIN_REPO set as secrets