Code Monkey home page Code Monkey logo

hello-helm's Introduction

Hello Helm

This is a simple demo of an ACR webhook to automatically upgrade a Helm chart. The brigade.js is configured to upgrade a Helm release every time the specified Docker image is upgraded in an Azure Container Registry (ACR).

This is not production quailty. It is a demo.

To use this demo, you will need to point it to your own ACR repository. To do this, you will need to edit the registry in the following places:

  • Makefile
  • charts/values.yaml

Then you will need to configure your ACR to trigger a webhook on each push event.

Note: With a little bit of modification to the brigade.js, you can also use this for DockerHub webhooks.

Prerequisites

  • Helm and Brigade must be installed on your cluster
  • Your cluster must have a routable IP attached to the brigade-gw service
  • You must have an ACR created with type Managed
  • You need a clone of this repository
  • You need to configure a Slack incomming webhook. See Slack-Notify

Configuring ACR

You can either use the az acr webhook tool or use the webhooks panel in the Container Registry section of the Azure portal. You must configure the webhook to point to the Brigade gateway.

To get the external IP of the gateway, do:

$ kubectl get svc | brigade-gw

Set up your webhook to use http://<IP>:7744/events/dockerhub/<Project Name>/<Commit>.

  • The IP is the gateway IP from the command above (or a DNS address, if you set one up)
  • Project name is the name of your Brigade project (foo/bar)
  • Commit is the commit/branch/repo in the repo you want to use to fetch the brigade.js from, usually master

So if project name is technosophos/hello-helm, and the host is example.com, then the URL would be something like:

http://example.com:7744/events/dockerhub/technosophos/hello-helm/master

Configuring your Brigade project

If this is the first time you have used the Slack Notifier webhook, you need to add the Slack incomming webhook URL to your project.

Typically, you will want to edit the project's values.yaml overrides. But here's how to do it from the Helm commandline:

$ helm upgrade myproject brigade/brigade-project --set secrets.SLACK_WEBHOOK=https://rest/of/url

How it works

  • make docker-build docker-push pushes a new image
  • ACR responds to the push by calling the webhook
  • The webhook triggers a brigade event
  • The brigade event handler causes Helm to upgrade the chart with the new label

You can update the new build by running:

$ VERSION=0.1.2 make docker-build docker-push

The above will create a new tag for the image (0.1.2), which will trigger a new helm upgrade.

hello-helm's People

Contributors

bacongobbler avatar lachie83 avatar stuartleeks avatar technosophos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.