Skip to content

Commit 531754a

Browse files
committed
helm chart
1 parent 65163f3 commit 531754a

File tree

4 files changed

+150
-0
lines changed

4 files changed

+150
-0
lines changed

chart/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: playout
3+
description: A Helm chart for Frikanalen Playout service
4+
type: application
5+
version: 0.1.0
6+
appVersion: "latest"

chart/templates/_helpers.tpl

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "playout.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
*/}}
11+
{{- define "playout.fullname" -}}
12+
{{- if .Values.fullnameOverride }}
13+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
14+
{{- else }}
15+
{{- $name := default .Chart.Name .Values.nameOverride }}
16+
{{- if contains $name .Release.Name }}
17+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
18+
{{- else }}
19+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
20+
{{- end }}
21+
{{- end }}
22+
{{- end }}
23+
24+
{{/*
25+
Create chart name and version as used by the chart label.
26+
*/}}
27+
{{- define "playout.chart" -}}
28+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
29+
{{- end }}
30+
31+
{{/*
32+
Common labels
33+
*/}}
34+
{{- define "playout.labels" -}}
35+
helm.sh/chart: {{ include "playout.chart" . }}
36+
{{ include "playout.selectorLabels" . }}
37+
{{- if .Chart.AppVersion }}
38+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
39+
{{- end }}
40+
app.kubernetes.io/managed-by: {{ .Release.Service }}
41+
{{- end }}
42+
43+
{{/*
44+
Selector labels
45+
*/}}
46+
{{- define "playout.selectorLabels" -}}
47+
app.kubernetes.io/name: {{ include "playout.name" . }}
48+
app.kubernetes.io/instance: {{ .Release.Name }}
49+
app: playout
50+
{{- end }}

chart/templates/statefulset.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: {{ include "playout.fullname" . }}
5+
labels:
6+
{{- include "playout.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
podManagementPolicy: {{ .Values.podManagementPolicy }}
10+
selector:
11+
matchLabels:
12+
{{- include "playout.selectorLabels" . | nindent 6 }}
13+
updateStrategy:
14+
type: {{ .Values.updateStrategy.type }}
15+
{{- if .Values.updateStrategy.rollingUpdate }}
16+
rollingUpdate:
17+
partition: {{ .Values.updateStrategy.rollingUpdate.partition }}
18+
{{- end }}
19+
template:
20+
metadata:
21+
annotations:
22+
{{- with .Values.podAnnotations }}
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
labels:
26+
{{- include "playout.selectorLabels" . | nindent 8 }}
27+
spec:
28+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
29+
containers:
30+
- name: {{ .Chart.Name }}
31+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
32+
imagePullPolicy: {{ .Values.image.pullPolicy }}
33+
{{- if .Values.env }}
34+
env:
35+
{{- range .Values.env }}
36+
- name: {{ .name }}
37+
value: {{ .value | quote }}
38+
{{- end }}
39+
{{- end }}
40+
resources:
41+
{{- toYaml .Values.resources | nindent 10 }}
42+
{{- if .Values.timezone.enabled }}
43+
volumeMounts:
44+
- name: tz-config
45+
mountPath: /etc/localtime
46+
{{- end }}
47+
{{- if .Values.timezone.enabled }}
48+
volumes:
49+
- name: tz-config
50+
hostPath:
51+
path: {{ .Values.timezone.path }}
52+
type: File
53+
{{- end }}

chart/values.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
replicaCount: 1
2+
3+
image:
4+
repository: frikanalen/playout
5+
pullPolicy: Always
6+
tag: "latest"
7+
8+
nameOverride: ""
9+
fullnameOverride: ""
10+
11+
env:
12+
- name: USE_ORIGINAL
13+
value: "true"
14+
- name: CASPAR_HOST
15+
value: "192.168.3.35"
16+
17+
timezone:
18+
enabled: true
19+
path: /usr/share/zoneinfo/Europe/Oslo
20+
21+
podAnnotations:
22+
co.elastic.logs/json.add_error_key: "true"
23+
co.elastic.logs/json.keys_under_root: "true"
24+
co.elastic.logs/json.overwrite_keys: "true"
25+
26+
resources: {}
27+
# limits:
28+
# cpu: 100m
29+
# memory: 128Mi
30+
# requests:
31+
# cpu: 100m
32+
# memory: 128Mi
33+
34+
terminationGracePeriodSeconds: 30
35+
36+
podManagementPolicy: OrderedReady
37+
38+
updateStrategy:
39+
type: RollingUpdate
40+
rollingUpdate:
41+
partition: 0

0 commit comments

Comments
 (0)