https://github.com/bitsbeats/drone-helm3
Helm3 plugin for Drone CI
https://github.com/bitsbeats/drone-helm3
continues-integration drone drone-ci helm helm3 kubernetes
Last synced: 3 months ago
JSON representation
Helm3 plugin for Drone CI
- Host: GitHub
- URL: https://github.com/bitsbeats/drone-helm3
- Owner: bitsbeats
- License: apache-2.0
- Created: 2019-12-19T09:32:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-05T11:46:02.000Z (about 2 years ago)
- Last Synced: 2025-11-22T15:02:29.465Z (7 months ago)
- Topics: continues-integration, drone, drone-ci, helm, helm3, kubernetes
- Language: Go
- Size: 180 KB
- Stars: 20
- Watchers: 2
- Forks: 14
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# drone-helm3
[](https://cloud.drone.io/bitsbeats/drone-helm3)
[](https://hub.docker.com/r/bitsbeats/drone-helm3)
[](https://goreportcard.com/report/github.com/bitsbeats/drone-helm3)
Drone plugin for Helm3.
Helm Version: 3.11.1
Kubectl Version: 1.25.8
## Drone settings
Example:
```yaml
- name: deploy app
image: ghcr.io/bitsbeats/drone-helm3:latest
settings:
kube_api_server: kube.example.com
kube_token: { from_secret: kube_token }
chart: ./path-to/chart
release: release-name
namespace: namespace-name
timeout: 20m
helm_repos:
- bitnami=https://charts.bitnami.com/bitnami
envsubst: true
values:
- app.environment=awesome
- app.tag=${DRONE_TAG/v/}
- app.commit=${DRONE_COMMIT_SHA}
```
**Note**: If you enable envsubst make sure to surrount your variables like
`${variable}`, `$variable` will *not* work.
An always up2date version of the availible config options can be viewed on the
source on the `Config` `struct` [here][1].
## Monitoring
Its possible to monitor your builds and rollbacks using prometheus and
prometheus-pushgateway. To enable specify the `pushgateway_url` setting.
Example alertrule:
```
- alert: Helm3RolloutFailed
expr: |
drone_helm3_build_status{status!="success"}
labels:
severity: critical
annotations:
summary: >-
Helm3 was unable to deploy {{ $labels.repo }} as
{{ $labels.release }} into namespace {{ $labels.namespace }}
action: >-
Validate the `deploy` step of the last drone ci run for this
repository. Either the build has *failed entirely* or the
`helm test` did fail. For more information on tests see
https://github.com/bitsbeats/drone-helm3/#monitoring
```
## Helm Tests
Helm tests are special Pods that have the `"helm.sh/hook": test` annotation set.
If the command in the docker container returns an exitcode > 0 the drone step
will be marked as failed. See the [Helm documentation][2].
In addition you can set the `test_rollback` setting to run `helm rollback` if
the tests fail.
## `post_kustomization`
The `post_kustomization` allows to modify helm charts with customize.
See [here][3] for the official documentation. The `resources` field is
set via the plugin.
Example:
```yaml
post_kustomization: |
patches:
- patch: |
- op: remove
path: /spec/template/spec/securityContext
- op: remove
path: /spec/template/spec/containers/0/securityContext
target:
kind: StatefulSet
labelSelector:
app.kubernetes.io/name=opensearch
```
[1]: https://github.com/bitsbeats/drone-helm3/blob/master/main.go#L22
[2]: https://helm.sh/docs/topics/chart_tests/
[3]: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/