Skip to content

Commit ebfa84d

Browse files
committed
Add initial runboat Helm chart
1 parent 3c890c8 commit ebfa84d

10 files changed

+441
-0
lines changed

charts/runboat/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/runboat/Chart.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: v2
2+
name: runboat
3+
description: A simple Odoo runbot lookalike
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
dependencies:
25+
- name: postgresql
26+
version: 16.4.16
27+
repository: https://charts.bitnami.com/bitnami
28+
condition: postgresql.enabled

charts/runboat/templates/NOTES.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "runboat.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "runboat.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "runboat.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "runboat.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20+
echo "Visit http://127.0.0.1:8080 to use your application"
21+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
22+
{{- end }}

charts/runboat/templates/_helpers.tpl

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "runboat.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "runboat.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "runboat.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "runboat.labels" -}}
37+
helm.sh/chart: {{ include "runboat.chart" . }}
38+
{{ include "runboat.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "runboat.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "runboat.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "runboat.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "runboat.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "runboat.fullname" . }}
5+
labels:
6+
{{- include "runboat.labels" . | nindent 4 }}
7+
spec:
8+
selector:
9+
matchLabels:
10+
{{- include "runboat.selectorLabels" . | nindent 6 }}
11+
template:
12+
metadata:
13+
{{- with .Values.podAnnotations }}
14+
annotations:
15+
{{- toYaml . | nindent 8 }}
16+
{{- end }}
17+
labels:
18+
{{- include "runboat.labels" . | nindent 8 }}
19+
{{- with .Values.podLabels }}
20+
{{- toYaml . | nindent 8 }}
21+
{{- end }}
22+
spec:
23+
{{- with .Values.imagePullSecrets }}
24+
imagePullSecrets:
25+
{{- toYaml . | nindent 8 }}
26+
{{- end }}
27+
serviceAccountName: {{ include "runboat.serviceAccountName" . }}
28+
{{- with .Values.podSecurityContext }}
29+
securityContext:
30+
{{- toYaml . | nindent 8 }}
31+
{{- end }}
32+
containers:
33+
- name: {{ .Chart.Name }}
34+
{{- with .Values.securityContext }}
35+
securityContext:
36+
{{- toYaml . | nindent 12 }}
37+
{{- end }}
38+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
39+
imagePullPolicy: {{ .Values.image.pullPolicy }}
40+
ports:
41+
- name: http
42+
containerPort: 8000
43+
protocol: TCP
44+
{{- with .Values.livenessProbe }}
45+
livenessProbe:
46+
{{- toYaml . | nindent 12 }}
47+
{{- end }}
48+
{{- with .Values.readinessProbe }}
49+
readinessProbe:
50+
{{- toYaml . | nindent 12 }}
51+
{{- end }}
52+
{{- with .Values.resources }}
53+
resources:
54+
{{- toYaml . | nindent 12 }}
55+
{{- end }}
56+
{{- with .Values.volumeMounts }}
57+
volumeMounts:
58+
{{- toYaml . | nindent 12 }}
59+
{{- end }}
60+
env:
61+
- name: RUNBOAT_BUILD_NAMESPACE
62+
value: {{ .Values.runboat.buildNamespace | quote }}
63+
- name: RUNBOAT_API_ADMIN_USER
64+
value: {{ .Values.runboat.adminUser | quote }}
65+
- name: RUNBOAT_API_ADMIN_PASSWD
66+
valueFrom:
67+
secretKeyRef:
68+
name: {{ .Values.runboat.secret.name | default include "runboat.fullname" . | quote }}
69+
key: {{ .Values.runboat.secret.adminPasswordKey | default "password" | quote }}
70+
- name: RUNBOAT_MAX_INITIALIZING
71+
value: {{ .Values.runboat.maxInitializing | quote }}
72+
- name: RUNBOAT_MAX_STARTED
73+
value: {{ .Values.runboat.maxStarted | quote }}
74+
- name: RUNBOAT_MAX_DEPLOYED
75+
value: {{ .Values.runboat.maxDeployed | quote }}
76+
- name: RUNBOAT_BUILD_ENV
77+
value: {{ .Values.runboat.buildEnv | toJson }}
78+
{{- with .Values.runboat.secret }}
79+
{{- if .buildSecretEnvKey }}
80+
- name: RUNBOAT_BUILD_SECRET_ENV
81+
valueFrom:
82+
secretKeyRef:
83+
name: {{ .Values.runboat.secret.name | default include "runboat.fullname" . | quote }}
84+
key: {{ .Values.runboat.secret.buildSecretEnvKey | quote }}
85+
{{- end }}
86+
{{- end }}
87+
- name: RUNBOAT_BUILD_TEMPLATE_VARS
88+
value: {{ .Values.runboat.buildTemplateVars | toJson }}
89+
- name: RUNBOAT_BASE_URL
90+
value: http{{- if .Values.ingress.tls -}}s{{- end -}}://{{ .Values.ingress.host }}
91+
- name: RUNBOAT_BUILD_DOMAIN
92+
value: {{ .Values.runboat.buildDomain | quote }}
93+
- name: RUNBOAT_GITHUB_TOKEN
94+
valueFrom:
95+
secretKeyRef:
96+
name: {{ .Values.runboat.secret.name | default include "runboat.fullname" . | quote }}
97+
key: {{ .Values.runboat.secret.githubTokenKey default "githubToken" | quote }}
98+
- name: RUNBOAT_REPOS
99+
value: {{ .Values.runboat.repos | toJson }}
100+
{{- with .Values.volumes }}
101+
volumes:
102+
{{- toYaml . | nindent 8 }}
103+
{{- end }}
104+
{{- with .Values.nodeSelector }}
105+
nodeSelector:
106+
{{- toYaml . | nindent 8 }}
107+
{{- end }}
108+
{{- with .Values.affinity }}
109+
affinity:
110+
{{- toYaml . | nindent 8 }}
111+
{{- end }}
112+
{{- with .Values.tolerations }}
113+
tolerations:
114+
{{- toYaml . | nindent 8 }}
115+
{{- end }}

charts/runboat/templates/ingress.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{- if .Values.ingress.enabled -}}
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
name: {{ include "runboat.fullname" . }}
6+
labels:
7+
{{- include "runboat.labels" . | nindent 4 }}
8+
{{- with .Values.ingress.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
ingressClassName: {{ with .Values.ingress.className }}
14+
{{- if .Values.ingress.tls }}
15+
tls:
16+
- hosts:
17+
- {{ .Values.ingress.host | quote }}
18+
secretName: {{ .Values.ingress.tls.secretName | default (printf "%s-%s" .Values.ingress.host "tls") | quote }}
19+
{{- end }}
20+
rules:
21+
- host: {{ .Values.ingress.host | quote }}
22+
http:
23+
paths:
24+
- path: /
25+
pathType: ImplementationSpecific
26+
backend:
27+
service:
28+
name: {{ include "runboat.fullname" $ }}
29+
port:
30+
name: http
31+
{{- end }}

charts/runboat/templates/secret.yaml

Whitespace-only changes.

charts/runboat/templates/service.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "runboat.fullname" . }}
5+
labels:
6+
{{- include "runboat.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: http
12+
protocol: TCP
13+
name: http
14+
selector:
15+
{{- include "runboat.selectorLabels" . | nindent 4 }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "runboat.serviceAccountName" . }}
6+
labels:
7+
{{- include "runboat.labels" . | nindent 4 }}
8+
{{- with .Values.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
13+
{{- end }}

0 commit comments

Comments
 (0)