Skip to content

Commit

Permalink
Add wave chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Sytten committed May 29, 2020
1 parent 7f4f724 commit 9e329d0
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 0 deletions.
11 changes: 11 additions & 0 deletions charts/wave/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
name: wave
description: wave chart that runs on kubernetes
version: 1.0.0
appVersion: v0.4.0
keywords:
- wave
- kubernetes
home: https://github.com/pusher/wave
sources:
- https://github.com/pusher/wave
23 changes: 23 additions & 0 deletions charts/wave/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "wave-name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" | lower -}}
{{- 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 "wave-fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "wave-labels.chart" -}}
app: {{ template "wave-name" . }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
{{- end -}}
40 changes: 40 additions & 0 deletions charts/wave/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.global.rbac.enabled }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
labels:
{{ include "wave-labels.chart" . | indent 4 }}
name: {{ template "wave-fullname" . }}
rules:
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- list
- get
- update
- patch
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- update
- patch
- apiGroups:
- apps
resources:
- deployments
- daemonsets
- statefulsets
verbs:
- list
- get
- update
- patch
- watch
{{- end }}
16 changes: 16 additions & 0 deletions charts/wave/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.global.rbac.enabled }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
{{ include "wave-labels.chart" . | indent 4 }}
name: {{ template "wave-fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "wave-fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccount.name | default (include "wave-fullname" .) }}
namespace: {{ .Release.Namespace }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/wave/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- if gt .Values.replicas 1.0 }}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
{{ include "wave-labels.chart" . | indent 4 }}
name: {{ template "wave-fullname" . }}
data:
{{- end }}
33 changes: 33 additions & 0 deletions charts/wave/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations: {{ toYaml .Values.annotations | nindent 4 }}
labels:
{{ include "wave-labels.chart" . | indent 4 }}
name: {{ template "wave-fullname" . }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
{{ include "wave-labels.chart" . | indent 6 }}
template:
metadata:
labels:
{{ include "wave-labels.chart" . | indent 8 }}
spec:
containers:
- image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: {{ template "wave-fullname" . }}
args:
{{- if gt .Values.replicas 1.0 }}
- --leader-election=true
- --leader-election-id={{ template "wave-fullname" . }}
- --leader-election-namespace={{ .Release.Namespace }}
{{- end }}
{{- if .Values.syncPeriod }}
- --sync-period={{ .Values.syncPeriod }}
{{- end }}
securityContext: {{ toYaml .Values.securityContext | nindent 8 }}
serviceAccountName: {{ .Values.serviceAccount.name | default (include "wave-fullname" .) }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
11 changes: 11 additions & 0 deletions charts/wave/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | nindent 2 }}
{{- end }}
metadata:
labels:
{{ include "wave-labels.chart" . | indent 4 }}
name: {{ .Values.serviceAccount.name | default (include "wave-fullname" .) }}
{{- end }}
37 changes: 37 additions & 0 deletions charts/wave/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
global:
## Reference to one or more secrets to be used when pulling images
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
imagePullSecrets: []
# - name: "image-pull-secret"
rbac:
enabled: true

# Annotations for the wave pods
annotations: {}
image:
name: quay.io/pusher/wave
tag: v0.4.0
pullPolicy: IfNotPresent

# Node selector for the wave pods
nodeSelector: {}

# Replicas > 1 will enable leader election
replicas: 1

# https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
securityContext:
runAsNonRoot: true
runAsUser: 1000

# Service account config for the agent pods
serviceAccount:
# Specifies whether a ServiceAccount should be created
create: true
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template
name:

# Period for reconciliation
# syncPeriod: 5m

0 comments on commit 9e329d0

Please sign in to comment.