DeviaVir / rules_helm

rules_helm: Bazel rules for managing helm charts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rules_helm

This repository contains Bazel rules to install and manipulate Helm charts with Bazel.

This allows you to describe Kubernetes applications in a deterministic manner.

Originally forked from https://github.com/tmc/rules_helm

Features

  • Helm v3

Documentation

API

  • helm_chart - describes a helm chart.
  • helm_release - describes a helm release.

Getting started

In your Bazel WORKSPACE file add this repository as a dependency:

git_repository(
    name = "com_github_deviavir_rules_helm",
    tag = "0.0.1",
    remote = "https://github.com/deviavir/rules_helm.git",
)

Then in your BUILD files include the helm_chart and/or helm_release rules:

charts/a-great-chart/zBUILD:

load("@com_github_deviavir_rules_helm//:helm.bzl", "helm_chart")

package(default_visibility = ["//visibility:public"])

helm_chart(
    name = "a_great_chart",
    srcs = glob(["**"]),
)

Referencing the chart with helm_release:

BUILD:

load("@com_github_deviavir_rules_helm//:helm.bzl", "helm_release")

helm_release(
    name = "a_great_release",
    chart = "//charts/a-great-chart:chart",
    release_name = "a-great-release-1",
    values_yaml = "//:a-great-release-values.yaml",
)

This defines targets you can now use to manage the release:

:a_great_release.test
:a_great_release.status
:a_great_release.install.wait
:a_great_release.install
:a_great_release.delete

You could now install, test, and clean up the chart via: bazel run :a_great_release.install.wait && bazel run :a_great_release.test && bazel run :a_great_release.delete

Dependencies

helm_chart(
    name = "chart",
    srcs = glob(["**"]),
    update_deps = True,
    repositories = ["https://kubernetes-charts.storage.googleapis.com/"]
)

About

rules_helm: Bazel rules for managing helm charts


Languages

Language:Starlark 63.7%Language:Shell 21.4%Language:Makefile 13.7%Language:Dockerfile 1.2%