Giter VIP home page Giter VIP logo

rules_helm's Introduction

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.

Features

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_tmc_rules_helm",
    tag = "0.4.0",
    remote = "https://github.com/tmc/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_tmc_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_tmc_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.noclean
: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

See rules_helm_examples for detailed usage examples.

Istio Example

These rules demonstrae describing an installation of Istio. See https://github.com/tmc/rules_helm_example/tree/master/charts/istio for details.

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

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

helm_release(
    name = "istio_init",
    chart = "@com_github_istio_istio//:istio_init",
    namespace = "istio-system",
    release_name = "istio-init",
    values_yaml = ":istio_values.yaml",
)

helm_release(
    name = "istio",
    chart = "@com_github_istio_istio//:istio",
    namespace = "istio-system",
    release_name = "istio",
    values_yaml = ":istio_values.yaml",
)

The releases above create the following targets:

:istio_init.test.noclean
:istio_init.test
:istio_init.status
:istio_init.install.wait
:istio_init.install
:istio_init.delete

And:

:istio.test.noclean
:istio.test
:istio.status
:istio.install.wait
:istio.install
:istio.delete

Running bazel run :istio_init.install and a subsequent bazel run :istio.install (waiting for the CRDs to be created) will install Istio. See rules_helm_examples for detailed usage examples.

rules_helm's People

Contributors

jlegrone avatar thoferon avatar tmc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.