Skip to content

Commit

Permalink
Merge pull request helm#2 from hmcts/fluxcloud
Browse files Browse the repository at this point in the history
Add fluxcloud chart
  • Loading branch information
luigibk authored Mar 7, 2019
2 parents c80082f + 924e3b6 commit a702a7c
Show file tree
Hide file tree
Showing 8 changed files with 201 additions and 0 deletions.
21 changes: 21 additions & 0 deletions incubator/fluxcloud/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
12 changes: 12 additions & 0 deletions incubator/fluxcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
appVersion: "0.3.4"
version: 0.0.1
kubeVersion: ">=1.9.0-0"
name: fluxcloud
description: Fluxcloud is a tool to receive events from the Weave flux. It allows to send Flux events to Slack or a webhook without using Weave Cloud.
home: https://github.com/justinbarrick/fluxcloud
sources:
- https://github.com/justinbarrick/fluxcloud
keywords:
- gitops
- flux
54 changes: 54 additions & 0 deletions incubator/fluxcloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Fluxcloud

Fluxcloud is a tool to receive events from the [Weave flux](https://github.com/weaveworks/flux).

Fluxcloud is a valid upstream for Weave, allowing you to send Flux events to Slack or a
webhook without using Weave Cloud.

## Introduction

This chart bootstraps a [Flux](https://github.com/justinbarrick/fluxcloud) deployment on
a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Installation

I assume if you got here you have already installed at least Flux using Helm. This is of course very similar (and simpler).


### Installing the Chart

```sh
helm install incubator/fluxcloud
```

### Configuration

The following configuration values are defaults that can be modified:

```yaml
replicaCount: 1

imageRepository: justinbarrick/fluxcloud
imageTag: v0.3.4
imagePullPolicy: IfNotPresent

servicePort: 80
serviceTargetPort: 3032

extraEnvs: []
#extraEnvs:
#- name: SLACK_URL
# value: "https://hooks.slack.com/services/WEBHOOK_URL"
#- name: SLACK_CHANNEL
# value: "#kubernetes" # Or multiple channels (comma separated <channel>=<namespace>). e.g.: value: "#kubernetes=*,#team=team"
#- name: SLACK_USERNAME
# value: Flux Deployer
#- name: SLACK_ICON_EMOJI
# value: ":heart:"
#- name: GITHUB_URL
# value: "https://github.com/justinbarrick/fluxcloud/"
#- name: LISTEN_ADDRESS
# value: ":3032"
```

For the available environment variables check the [Fluxcloud documentation]((https://github.com/justinbarrick/fluxcloud))
8 changes: 8 additions & 0 deletions incubator/fluxcloud/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Thank you for installing {{ .Chart.Name }}.

Your release is named {{ .Release.Name }}.

To learn more about the release, try:

$ helm status {{ .Release.Name }}
$ helm get {{ .Release.Name }}
31 changes: 31 additions & 0 deletions incubator/fluxcloud/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "fluxcloud.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "fluxcloud.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "fluxcloud.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
33 changes: 33 additions & 0 deletions incubator/fluxcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fluxcloud.fullname" . }}
labels:
app: {{ template "fluxcloud.name" . }}
chart: {{ template "fluxcloud.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "fluxcloud.name" . }}
release: {{ .Release.Name }}
strategy:
type: Recreate
template:
metadata:
labels:
app: {{ template "fluxcloud.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: fluxcloud
image: "{{ .Values.imageRepository }}:{{ .Values.imageTag }}"
imagePullPolicy: {{ .Values.imagePullPolicy }}
ports:
- containerPort: {{ .Values.serviceTargetPort }}
{{- if .Values.extraEnvs }}
env:
{{ toYaml .Values.extraEnvs | indent 8 }}
{{- end }}
17 changes: 17 additions & 0 deletions incubator/fluxcloud/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
kind: Service
apiVersion: v1
metadata:
name: {{ template "fluxcloud.fullname" . }}
labels:
app: {{ template "fluxcloud.name" . }}
chart: {{ template "fluxcloud.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
app: {{ template "fluxcloud.name" . }}
release: {{ .Release.Name }}
ports:
- protocol: TCP
port: {{ .Values.servicePort }}
targetPort: {{ .Values.serviceTargetPort }}
25 changes: 25 additions & 0 deletions incubator/fluxcloud/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Default values for fluxcloud.

replicaCount: 1

imageRepository: justinbarrick/fluxcloud
imageTag: v0.3.4
imagePullPolicy: IfNotPresent

servicePort: 80
serviceTargetPort: 3032

extraEnvs: []
#extraEnvs:
#- name: SLACK_URL
# value: "https://hooks.slack.com/services/WEBHOOK_URL"
#- name: SLACK_CHANNEL
# value: "#kubernetes" # Or multiple channels (comma separated <channel>=<namespace>). e.g.: value: "#kubernetes=*,#team=team"
#- name: SLACK_USERNAME
# value: Flux Deployer
#- name: SLACK_ICON_EMOJI
# value: ":heart:"
#- name: GITHUB_URL
# value: "https://github.com/justinbarrick/fluxcloud/"
#- name: LISTEN_ADDRESS
# value: ":3032"

0 comments on commit a702a7c

Please sign in to comment.