Skip to content

Commit 2b4e553

Browse files
First commit
0 parents  commit 2b4e553

18 files changed

+483
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release Helm Chart
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Helm
22+
uses: azure/setup-helm@v3
23+
with:
24+
version: 'latest'
25+
26+
- name: Configure Docker for OCI
27+
run: |
28+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io \
29+
--username ${{ github.actor }} \
30+
--password-stdin
31+
32+
- name: Extract version from tag
33+
id: get_version
34+
run: |
35+
# Remove 'v' prefix from tag
36+
VERSION="${GITHUB_REF#refs/tags/v}"
37+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
38+
echo "Tag version: ${VERSION}"
39+
40+
- name: Update Chart.yaml with tag version
41+
run: |
42+
# Update the version in Chart.yaml to match the tag
43+
yq eval ".version = \"${{ steps.get_version.outputs.VERSION }}\"" -i Chart.yaml
44+
echo "Updated Chart.yaml version to ${{ steps.get_version.outputs.VERSION }}"
45+
cat Chart.yaml
46+
47+
- name: Package Helm chart
48+
id: package
49+
run: |
50+
helm package .
51+
PACKAGE_FILE=$(ls -t *.tgz | head -n1)
52+
echo "package_file=${PACKAGE_FILE}" >> $GITHUB_OUTPUT
53+
echo "Packaged file: ${PACKAGE_FILE}"
54+
55+
- name: Push to GitHub Container Registry
56+
run: |
57+
REPO_LOWERCASE=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
58+
helm push "${{ steps.package.outputs.package_file }}" oci://ghcr.io/${REPO_LOWERCASE}

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# General
2+
.DS_Store
3+
__MACOSX/
4+
.AppleDouble
5+
.LSOverride
6+
Icon[
7+
]
8+
9+
# Thumbnails
10+
._*
11+
12+
# Files that might appear in the root of a volume
13+
.DocumentRevisions-V100
14+
.fseventsd
15+
.Spotlight-V100
16+
.TemporaryItems
17+
.Trashes
18+
.VolumeIcon.icns
19+
.com.apple.timemachine.donotpresent
20+
21+
# Directories potentially created on remote AFP share
22+
.AppleDB
23+
.AppleDesktop
24+
Network Trash Folder
25+
Temporary Items
26+
.apdisk
27+
28+
*.tgz

.helmignore

Lines changed: 23 additions & 0 deletions
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/

Chart.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v2
2+
name: runboat
3+
4+
description: A Helm chart for OCA's Runboat
5+
6+
version: 1.1.1
7+
8+
appVersion: "1.16.0"

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Helm chart for OCA's Runboat
2+
3+
### Required Values
4+
5+
The Helm chart includes placeholder values, however following values **must be provided** for the chart to work correctly:
6+
7+
| Value | Description |
8+
|-------|-------------|
9+
| `controllerenv.runboatBuildEnv` | Postgres connection details (host, port, username, password, database) |
10+
| `runboatSecret.repos` | List of allowed repositories |
11+
| `ingress.host` | Hostname for base url for runboat controller & ingress |
12+
| `runboatSecret.apiAdminUser` | API admin username |
13+
| `runboatSecret.apiAdminPasswd` | API admin password |
14+
15+
## Installation
16+
17+
```bash
18+
helm upgrade --install runboat \
19+
oci://ghcr.io/secretagentnull/runboat-helm/runboat \
20+
-f my-values.yaml \
21+
-n runboat-controller
22+
```
23+
24+
### Enabling Ingress
25+
26+
The Helm chart includes an ingress resource, which is **disabled by default**. To enable ingress, pass:
27+
28+
```yaml
29+
ingress:
30+
enabled: true
31+
host: example.com

templates/_helpers.tpl

Lines changed: 62 additions & 0 deletions
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 }}

templates/configmap.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
data:
4+
log-config.yaml: |
5+
{{ toYaml .Values.logConfig | indent 4 }}
6+
metadata:
7+
name: runboat-controller-configmap1
8+
namespace: {{ .Release.Namespace }}
9+
annotations:
10+
use-subpath: "true"

templates/deployment.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: runboat-controller-deployment
5+
namespace: {{ .Release.Namespace }}
6+
spec:
7+
replicas: 1
8+
strategy:
9+
type: Recreate
10+
selector:
11+
matchLabels:
12+
app: runboat-controller
13+
template:
14+
metadata:
15+
labels:
16+
app: runboat-controller
17+
spec:
18+
containers:
19+
- name: runboat-controller
20+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
21+
imagePullPolicy: {{ .Values.image.pullPolicy }}
22+
{{- with .Values.imagePullSecrets }}
23+
imagePullSecrets:
24+
{{- toYaml . | nindent 8 }}
25+
{{- end }}
26+
ports:
27+
- containerPort: 8000
28+
protocol: TCP
29+
envFrom:
30+
- configMapRef:
31+
name: runboat-controller-env
32+
- secretRef:
33+
name: runboat-secret
34+
volumeMounts:
35+
- mountPath: /etc/runboat-log-config.yaml
36+
name: runboat-controller-configmap1
37+
readOnly: true
38+
subPath: runboat-log-config.yaml
39+
restartPolicy: Always
40+
volumes:
41+
- configMap:
42+
items:
43+
- key: log-config.yaml
44+
path: runboat-log-config.yaml
45+
name: runboat-controller-configmap1
46+
name: runboat-controller-configmap1

templates/env.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: runboat-controller-env
5+
namespace: {{ .Release.Namespace }}
6+
data:
7+
RUNBOAT_BUILD_ENV: {{ .Values.controllerEnv.RUNBOAT_BUILD_ENV | toJson | quote }}
8+
RUNBOAT_BUILD_NAMESPACE: {{ .Values.controllerEnv.RUNBOAT_BUILD_NAMESPACE | quote }}
9+
RUNBOAT_MAX_DEPLOYED: {{ .Values.controllerEnv.RUNBOAT_MAX_DEPLOYED | quote }}
10+
RUNBOAT_MAX_INITIALIZING: {{ .Values.controllerEnv.RUNBOAT_MAX_INITIALIZING | quote }}
11+
RUNBOAT_MAX_STARTED: {{ .Values.controllerEnv.RUNBOAT_MAX_STARTED | quote }}
12+
RUNBOAT_BUILD_TEMPLATE_VARS: |
13+
{{ toJson .Values.controllerEnv.RUNBOAT_BUILD_TEMPLATE_VARS | indent 4 }}

templates/ingress.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- if .Values.ingress.enabled }}
2+
{{- $host := .Values.ingress.host | default (printf "%s.%s.local" .Release.Name .Release.Namespace) -}}
3+
4+
apiVersion: networking.k8s.io/v1
5+
kind: Ingress
6+
metadata:
7+
name: runboat-controller-ingress
8+
namespace: {{ .Release.Namespace }}
9+
spec:
10+
tls:
11+
- hosts:
12+
- runboat.{{ $host }}
13+
secretName: runboat-tls-secret
14+
rules:
15+
- host: runboat.{{ $host }}
16+
http:
17+
paths:
18+
- path: /
19+
pathType: Prefix
20+
backend:
21+
service:
22+
name: runboat-controller-service
23+
port:
24+
number: 8000
25+
{{- end }}

0 commit comments

Comments
 (0)