Skip to content

Commit d9720de

Browse files
authored
🚀 Add Kubernetes Helm chart (#79)
2 parents be25816 + 27248c4 commit d9720de

File tree

15 files changed

+916
-0
lines changed

15 files changed

+916
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ yarn-error.log
2525
public/build/*
2626
public/hot
2727

28+
# Helm
29+
/helm/octa/charts/*
30+

helm/HELM.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Octa Helm Chart
2+
3+
This document provides information about the Helm chart for deploying Octa, a WordPress theme based on Laravel, Bedrock, and Sage.
4+
5+
## Installation
6+
7+
```bash
8+
# Add the repository (if applicable)
9+
# helm repo add octa-repo <repository-url>
10+
11+
# Install the chart
12+
helm install octa ./octa
13+
```
14+
15+
## Configuration
16+
17+
The following table lists the configurable parameters of the Octa chart and their default values.
18+
19+
### General Configuration
20+
21+
| Parameter | Description | Default |
22+
|-----------|-------------|---------|
23+
| `replicaCount` | Number of replicas | `1` |
24+
| `image.repository` | Image repository | `nginx` |
25+
| `image.tag` | Image tag | `""` (defaults to chart appVersion) |
26+
| `image.pullPolicy` | Image pull policy | `Always` |
27+
| `app.environment` | Application environment | `production` |
28+
29+
### Database Configuration
30+
31+
| Parameter | Description | Default |
32+
|-----------|-------------|---------|
33+
| `mariadb.enabled` | Enable MariaDB | `true` |
34+
| `mariadb.url` | MariaDB URL | `""` |
35+
| `mariadb.auth.username` | MariaDB username | `octa` |
36+
| `mariadb.auth.password` | MariaDB password | `!ThisMustBeChanged!` |
37+
| `mariadb.auth.rootPassword` | MariaDB root password | `!ThisMustBeChanged!` |
38+
| `mariadb.auth.database` | MariaDB database name | `octa` |
39+
40+
### Valkey Configuration (Redis-compatible)
41+
42+
| Parameter | Description | Default |
43+
|-----------|-------------|---------|
44+
| `valkey.enabled` | Enable Valkey | `false` |
45+
| `valkey.token` | Valkey token | `""` |
46+
| `valkey.auth.enabled` | Enable Valkey authentication | `false` |
47+
48+
### Uploads Volume Configuration
49+
50+
The chart now supports configuring a volume for uploads. This allows you to persist uploads across pod restarts and share them between replicas.
51+
52+
| Parameter | Description | Default |
53+
|-----------|-------------|---------|
54+
| `uploads.enabled` | Enable uploads volume | `true` |
55+
| `uploads.hostPath` | Host path for uploads | `/data/website` |
56+
| `uploads.containerPath` | Container path for uploads | `/var/www/html/public/content/uploads` |
57+
58+
### Mail Configuration
59+
60+
The chart supports conditional mail configuration with two modes:
61+
62+
| Parameter | Description | Default |
63+
|-----------|-------------|---------|
64+
| `mail.mailer` | Mail driver (native or smtps) | `native` |
65+
| `mail.host` | SMTP host (only for smtps) | `""` |
66+
| `mail.port` | SMTP port (only for smtps) | `""` |
67+
| `mail.username` | SMTP username (only for smtps) | `""` |
68+
| `mail.password` | SMTP password (only for smtps) | `""` |
69+
| `mail.encryption` | SMTP encryption (only for smtps) | `""` |
70+
| `mail.fromAddress` | From email address (only for smtps) | `""` |
71+
| `mail.fromName` | From name (only for smtps) | `""` |
72+
73+
## Usage Examples
74+
75+
### Basic Installation
76+
77+
```bash
78+
helm install octa ./octa
79+
```
80+
81+
### Custom Uploads Path
82+
83+
To use a custom path for uploads on the host:
84+
85+
```bash
86+
helm install octa ./octa --set uploads.hostPath=/custom/path/for/uploads
87+
```
88+
89+
### Disable Uploads Volume
90+
91+
If you don't need the uploads volume:
92+
93+
```bash
94+
helm install octa ./octa --set uploads.enabled=false
95+
```
96+
97+
### Mail Configuration Examples
98+
99+
```bash
100+
# Default installation (native mail)
101+
helm install octa ./octa
102+
103+
# SMTP configuration
104+
helm install octa ./octa \
105+
--set mail.mailer=smtps \
106+
--set mail.host=smtp.mailjet.com \
107+
--set mail.port=587 \
108+
--set mail.username=myusername \
109+
--set mail.password=mypassword \
110+
--set mail.encryption=tls \
111+
--set mail.fromAddress=noreply@example.com \
112+
--set mail.fromName="My App"
113+
```
114+
115+
### Complete Example with Custom Configuration
116+
117+
```bash
118+
helm install octa ./octa \
119+
--set app.environment=production \
120+
--set mariadb.auth.password=mySecurePassword \
121+
--set mariadb.auth.rootPassword=mySecureRootPassword \
122+
--set uploads.hostPath=/mnt/nfs/website-uploads \
123+
--set uploads.containerPath=/var/www/html/public/content/uploads \
124+
--set mail.mailer=smtps \
125+
--set mail.host=smtp.mailjet.com \
126+
--set mail.port=587
127+
```
128+
129+
## Additional Volumes
130+
131+
If you need to mount additional volumes, you can use the `volumes` and `volumeMounts` parameters:
132+
133+
```yaml
134+
volumes:
135+
- name: config-volume
136+
configMap:
137+
name: my-config
138+
139+
volumeMounts:
140+
- name: config-volume
141+
mountPath: /etc/config
142+
readOnly: true
143+
```
144+
145+
These can be set using `--set-file` or by providing a values file.

helm/octa/.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/

helm/octa/Chart.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dependencies:
2+
- name: mariadb
3+
repository: https://charts.bitnami.com/bitnami/
4+
version: 21.0.8
5+
- name: valkey
6+
repository: https://valkey.io/valkey-helm/
7+
version: 0.9.3
8+
digest: sha256:b854b734c38196e02602e70d03ad8c6049e5f3f733fe139504bc4945c3a6c18d
9+
generated: "2026-02-26T10:43:23.954724+01:00"

helm/octa/Chart.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v2
2+
name: octa
3+
icon: https://github.com/inrage/octa/blob/helm-chart/helm/logo.png
4+
description: A Helm chart for deploying an Octa WordPress project
5+
type: application
6+
version: 0.1.0
7+
appVersion: "1.1.0"
8+
9+
dependencies:
10+
- name: mariadb
11+
version: ~21.0.3
12+
repository: https://charts.bitnami.com/bitnami/
13+
condition: mariadb.enabled
14+
- name: valkey
15+
version: ~0.9.3
16+
repository: https://valkey.io/valkey-helm/
17+
condition: valkey.enabled

helm/octa/templates/_helpers.tpl

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "helm.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 "helm.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 "helm.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "helm.labels" -}}
37+
helm.sh/chart: {{ include "helm.chart" . }}
38+
{{ include "helm.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 "helm.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "helm.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+

helm/octa/templates/configmap.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "helm.fullname" . }}
5+
labels:
6+
{{- include "helm.labels" . | nindent 4 }}
7+
data:
8+
wp-env: {{ .Values.app.environment | quote }}
9+
wp-home: "https://{{ .Values.ingress.host }}"
10+
wp-siteurl: "https://{{ .Values.ingress.host }}/wp"
11+
apache-vhost-dir: "/var/www/html/public"
12+
valkey-host: "{{ .Release.Name }}-valkey"
13+
mail-mailer: {{ .Values.mail.mailer | quote }}
14+
{{- if eq .Values.mail.mailer "smtps" }}
15+
{{- if .Values.mail.host }}
16+
mail-host: {{ .Values.mail.host | quote }}
17+
{{- end }}
18+
{{- if .Values.mail.port }}
19+
mail-port: {{ .Values.mail.port | quote }}
20+
{{- end }}
21+
{{- if .Values.mail.encryption }}
22+
mail-encryption: {{ .Values.mail.encryption | quote }}
23+
{{- end }}
24+
{{- if .Values.mail.fromAddress }}
25+
mail-from-address: {{ .Values.mail.fromAddress | quote }}
26+
{{- end }}
27+
{{- if .Values.mail.fromName }}
28+
mail-from-name: {{ .Values.mail.fromName | quote }}
29+
{{- end }}
30+
{{- end }}
31+

0 commit comments

Comments
 (0)