Skip to content

Commit

Permalink
[feature]: Helm chart for keel
Browse files Browse the repository at this point in the history
  • Loading branch information
rimusz committed Jul 24, 2017
1 parent c582a51 commit 34acf8a
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 0 deletions.
21 changes: 21 additions & 0 deletions chart/keel/.helmignore
@@ -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
18 changes: 18 additions & 0 deletions chart/keel/Chart.yaml
@@ -0,0 +1,18 @@
apiVersion: v1
name: keel
description: Open source, tool for automating Kubernetes deployment updates. Keel is stateless, robust and lightweight.
version: 0.1.0
appversion: 0.4.0-rc.2
keywords:
- kubernetes deployment
- helm release
- continuous deployment
home: https://keel.sh
sources:
- https://github.com/rusenask/keel
maintainers:
- name: Rimas Mocevicius
email: rmocius@gmail.com
- name: Karolis Rusenas
email: karolis.rusenas@gmail.com
engine: gotpl
22 changes: 22 additions & 0 deletions chart/keel/README.md
@@ -0,0 +1,22 @@
[![CircleCI](https://circleci.com/gh/rusenask/keel/tree/master.svg?style=shield&circle-token=0239846a42cfa188de531058b9a2116a4b8600d8)](https://circleci.com/gh/rusenask/keel/tree/master)

# Keel - automated Kubernetes deployments for the rest of us

* Website [https://keel.sh](https://keel.sh)

Keel is a tool for automating [Kubernetes](https://kubernetes.io/) deployment updates. Keel is stateless, robust and lightweight.

## Install for the first time

Docker image _polling_ is set by default, we also enabling _Helm provider_ support, so Helm releases
can be upgraded when new Docker image is available:

```console
helm upgrade --install keel keel --set helmProvider.enabled="true"
```


## Run upgrades e.g. for docker image change
```console
helm upgrade keel keel --reuse-values --set image.tag="0.4.0"
```
5 changes: 5 additions & 0 deletions chart/keel/templates/NOTES.txt
@@ -0,0 +1,5 @@
1. The {{ template "name" .}} is getting provisioned in your cluster. After a few minutes, you can run the following to verify.

To verify that {{ template "name" . }} has started, run:

kubectl --namespace=kube-system get pods -l "app={{ template "name" . }}"
16 changes: 16 additions & 0 deletions chart/keel/templates/_helpers.tpl
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "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).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
67 changes: 67 additions & 0 deletions chart/keel/templates/deployment.yaml
@@ -0,0 +1,67 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "name" . }}
namespace: kube-system
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
kubernetes.io/service-account.name: keel
spec:
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ template "name" . }}
spec:
containers:
- name: keel
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/keel"]
env:
{{- if .Values.polling.enabled }}
# Enable polling
- name: POLL
value: "1"
{{- else }}
# Disable polling
- name: POLL
value: "0"
{{- end }}
{{- if .Values.helmProvider.enabled }}
# Enable/disable Helm provider
- name: HELM_PROVIDER
value: "1"
{{- end }}
{{- if .Values.gcr.enabled }}
# Enable GCR with pub/sub support
- name: PROJECT_ID
value: "{{ .Values.gcr.projectId }}"
- name: PUBSUB
value: "1"
{{- end }}
{{- if .Values.webhook.enabled }}
# Enable webhook endpoint
- name: WEBHOOK_ENDPOINT
value: "{{ .Values.webhook.endpoint }}"
{{- end }}
{{- if .Values.slack.enabled }}
- name: SLACK_TOKEN
value: "{{ .Values.slack.token }}"
- name: SLACK_CHANNELS
value: "{{ .Values.slack.channel }}"
{{- end }}
ports:
- containerPort: {{ .Values.service.internalPort }}
livenessProbe:
httpGet:
path: /healthz
port: {{ .Values.service.internalPort }}
initialDelaySeconds: 30
timeoutSeconds: 10
resources:
{{ toYaml .Values.resources | indent 12 }}
10 changes: 10 additions & 0 deletions chart/keel/templates/service-account.yaml
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "name" . }}
namespace: kube-system
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
22 changes: 22 additions & 0 deletions chart/keel/templates/service.yaml
@@ -0,0 +1,22 @@
{{- if .Values.webhook.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "name" . }}
namespace: kube-system
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.externalPort }}
targetPort: {{ .Values.service.internalPort }}
protocol: TCP
name: {{ .Values.service.name }}
selector:
app: {{ template "name" . }}
sessionAffinity: None
{{- end }}
59 changes: 59 additions & 0 deletions chart/keel/values.yaml
@@ -0,0 +1,59 @@
# Default values for keel.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: karolisr/keel
tag: 0.4.0-rc.3
pullPolicy: IfNotPresent

# Service gets set only if webhook is enabled
service:
name: ui
type: LoadBalancer
externalPort: 9300
internalPort: 9300


# Polling is enabled by default,
# you can disable it setting value below to false
polling:
enabled: true

# Helm provider support
helmProvider:
enabled: false

# Google Container Registry
# GCP Project ID
gcr:
enabled: false
projectId: ""
pubSub:
enabled: false

# Webhook Endpoint
webhook:
enabled: false
endpoint: ""

# Slack notification
slack:
enabled: false
token: ""
channel: ""

# Resources
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
#requests:
# cpu: 100m
# memory: 128Mi

0 comments on commit 34acf8a

Please sign in to comment.