Skip to content

Commit 6890b43

Browse files
Initialize helm chart repo
0 parents  commit 6890b43

32 files changed

Lines changed: 1151 additions & 0 deletions

.github/prlint.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"title": [
3+
{
4+
"pattern": "^[A-Z][a-z]+?\\s",
5+
"message": "Your title must start with a capital letter, and a real word, e.g. \"Add GO support\""
6+
},
7+
{
8+
"pattern": "^\\S+\\s+\\S+\\s+\\S+",
9+
"message": "Your title must have at least three words"
10+
},
11+
{
12+
"pattern": "^(?!\\S+ing )(?!\\S+ed )|Embed ",
13+
"message": "Use imperative mood (i.e write \"Fix\", not \"Fixed\" or \"Fixing\")"
14+
}
15+
],
16+
"body": [
17+
{
18+
"pattern": "(?:Fixes|Resolves|Closes|Part of) (?:#|OPS-|OPC-|CI-|DOC-)[1-9]\\d*|Dependabot commands and options",
19+
"message": "Add a GitHub or Linear issue ID to your PR body, e.g. \"Fixes #1002\""
20+
}
21+
]
22+
}
23+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Helm Chart Validation
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'chart/**'
7+
- '.github/workflows/**'
8+
push:
9+
paths:
10+
- 'chart/**'
11+
- '.github/workflows/**'
12+
13+
jobs:
14+
validate:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Helm
23+
uses: azure/setup-helm@v4
24+
with:
25+
version: v3.14.4
26+
27+
- name: Lint chart
28+
run: helm lint chart
29+
30+
- name: Template with default values
31+
run: helm template openops chart
32+
33+
- name: Template with example overrides
34+
run: helm template openops chart -f chart/values.overrides-example.yaml

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#############################################
2+
# Helm chart artifacts
3+
#############################################
4+
*.tgz
5+
chart/charts/
6+
7+
#############################################
8+
# Local overrides
9+
#############################################
10+
values.overrides.yaml
11+
12+
#############################################
13+
# IDE / OS files
14+
#############################################
15+
.DS_Store
16+
.idea/
17+
.vscode/

AGENTS.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# AGENTS
2+
3+
## Repository structure
4+
- `/chart/Chart.yaml`: Helm chart metadata (name, version, description) – bump the version any time templates or default values change.
5+
- `/chart/values.yaml`: Default configuration for all OpenOps components; use it to learn the expected keys before adding overrides.
6+
- `/chart/values.overrides-example.yaml`: Reference file that shows how to structure your own overrides file for deployments.
7+
- `/chart/templates/`: Kubernetes manifests rendered by Helm. Each service/component has its own deployment and service files, along with shared helpers in `_helpers.tpl` and secrets/configmaps under `configmap-*.yaml`, `secret-env.yaml`, and `pvc-*.yaml`.
8+
- `/.github/prlint.json`: Pull-request lint configuration (see below) that runs in CI to enforce title/body rules.
9+
- `/.github/workflows/`: Automation (tests, lint, release) triggered by pushes and pull requests. Update these only when you need to change CI behavior.
10+
11+
## PR lint rules
12+
The `.github/prlint.json` ruleset runs on every pull request. To avoid CI failures:
13+
1. **Title requirements**
14+
- Start with a capitalized real word (`Add`, `Fix`, `Update`, etc.).
15+
- Contain at least three words so reviewers immediately understand the change.
16+
- Use the imperative mood ("Add support for X" rather than "Added" or "Adding").
17+
2. **Body requirements**
18+
- Reference the tracking item with one of `Fixes|Resolves|Closes|Part of` followed by either a GitHub issue (`#1234`) or a Linear ticket (`OPS-1234`, `OPC-1234`, `CI-1234`, `DOC-1234`).
19+
- For dependency bumps, "Dependabot commands and options" is also accepted.
20+
21+
## Commit guidelines
22+
- Write commit subjects in the imperative mood, mirroring the PR title rules (e.g., "Add Redis PVC annotations").
23+
- Capitalize the first word and keep the subject ≤ 72 characters; add a blank line before the body.
24+
- Use the body to explain *what* and *why*, wrapping at ~72 characters per line for readability.
25+
- Reference relevant issues in the body when closing or relating work (same keywords as PR bodies).
26+
- Prefer focused commits that touch a single logical change; this keeps review and potential rollbacks simple.

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# OpenOps Helm Chart
2+
3+
This repository contains the Helm chart that deploys the OpenOps application stack (nginx, app server, engine, tables, analytics, Postgres, Redis) onto a Kubernetes cluster.
4+
5+
## Repository layout
6+
- `chart/Chart.yaml`: Chart metadata for the `openops` release.
7+
- `chart/values.yaml`: Default configuration values.
8+
- `chart/values.overrides-example.yaml`: Sample overrides file to copy and customize.
9+
- `chart/templates/`: Kubernetes manifests templated by Helm.
10+
11+
## Quick start
12+
1. Copy the sample overrides file and adjust it to match your environment:
13+
```bash
14+
cp chart/values.overrides-example.yaml values.overrides.yaml
15+
```
16+
2. Install (or upgrade) the chart into your target namespace:
17+
```bash
18+
helm upgrade --install openops ./chart -n openops --create-namespace -f values.overrides.yaml
19+
```
20+
3. Retrieve the external endpoint exposed by the nginx service:
21+
```bash
22+
kubectl get svc nginx -n openops
23+
```
24+
25+
See `chart/README.md` for component details, storage guidance, and networking notes.

chart/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
values.*.yaml
2+
!values.overrides-example.yaml

chart/.helmignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Patterns to ignore when packaging this chart
2+
.DS_Store
3+
.git/
4+
.hg/
5+
.svn/
6+
.idea/
7+
.vscode/
8+
*.swp
9+
*.bak
10+
*.tmp
11+
*.orig
12+
*~
13+
14+
# Local override values should never be bundled
15+
values.overrides.yaml

chart/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
name: openops
3+
description: A Helm chart for the OpenOps platform
4+
type: application
5+
version: 0.1.0
6+
appVersion: "latest"
7+
icon: https://openops.com/favicon.ico

chart/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# OpenOps Helm Chart
2+
3+
> **Note**: This chart is a work in progress and may not be production-ready.
4+
5+
This Helm chart deploys the OpenOps application stack to a Kubernetes cluster.
6+
7+
## Components
8+
9+
- **nginx**: Reverse proxy and load balancer (exposed via LoadBalancer)
10+
- **openops-app**: Main application server
11+
- **openops-engine**: Task execution engine
12+
- **openops-tables**: Data tables service (Baserow)
13+
- **openops-analytics**: Analytics dashboard (Superset)
14+
- **postgres**: PostgreSQL database
15+
- **redis**: Redis cache
16+
17+
## Installation
18+
19+
1. Add a values.overrides.yaml file (see `values.overrides-example.yaml` for reference).
20+
2. Install the chart:
21+
22+
```bash
23+
helm install openops ./chart -n openops --create-namespace -f values.overrides.yaml
24+
```
25+
3. Get the external IP of the nginx service to access the application:
26+
27+
```bash
28+
kubectl get services/nginx -n openops
29+
```
30+
31+
32+
## Storage
33+
34+
The chart creates PersistentVolumeClaims for:
35+
- PostgreSQL data (20Gi)
36+
- Redis data (5Gi)
37+
- Tables data (10Gi)
38+
39+
You can configure storage classes in the values.yaml file.
40+
41+
## Networking
42+
43+
- nginx service is exposed as LoadBalancer on port 80
44+
- All other services use ClusterIP for internal communication
45+
- The nginx configuration routes traffic to appropriate backend services
46+
47+
## Dependencies
48+
49+
The deployments include proper dependency management with health checks and readiness probes.

chart/templates/_helpers.tpl

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "openops.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 "openops.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 "openops.chart" -}}
28+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
29+
{{- end }}
30+
31+
{{/*
32+
Common labels
33+
*/}}
34+
{{- define "openops.labels" -}}
35+
helm.sh/chart: {{ include "openops.chart" . }}
36+
{{ include "openops.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 "openops.selectorLabels" -}}
47+
app.kubernetes.io/name: {{ include "openops.name" . }}
48+
app.kubernetes.io/instance: {{ .Release.Name }}
49+
{{- end }}
50+
51+
{{/*
52+
Redis connection parameters
53+
*/}}
54+
{{- define "openops.redisHost" -}}
55+
{{- .Values.redis.name -}}
56+
{{- end }}
57+
58+
{{- define "openops.redisPort" -}}
59+
{{- .Values.redis.service.port | toString -}}
60+
{{- end }}
61+
62+
{{- define "openops.redisUrl" -}}
63+
{{- printf "redis://%s:%s/0" (include "openops.redisHost" .) (include "openops.redisPort" .) -}}
64+
{{- end }}
65+
66+
{{/*
67+
PostgreSQL connection parameters
68+
*/}}
69+
{{- define "openops.postgresHost" -}}
70+
{{- .Values.postgres.name -}}
71+
{{- end }}
72+
73+
{{- define "openops.postgresPort" -}}
74+
{{- default (.Values.postgres.service.port | toString) -}}
75+
{{- end }}
76+
77+
{{/*
78+
Service URLs
79+
*/}}
80+
{{- define "openops.appServiceUrl" -}}
81+
{{- printf "http://%s" .Values.app.name -}}
82+
{{- end }}
83+
84+
{{- define "openops.engineServiceUrl" -}}
85+
{{- printf "http://%s:3005" .Values.engine.name -}}
86+
{{- end }}
87+
88+
{{- define "openops.tablesServiceUrl" -}}
89+
{{- printf "http://%s" .Values.tables.name -}}
90+
{{- end }}
91+
92+
{{- define "openops.analyticsServiceUrl" -}}
93+
{{- printf "http://%s:8088" .Values.analytics.name -}}
94+
{{- end }}
95+
96+
{{/*
97+
Secret name used to store sensitive environment variables.
98+
*/}}
99+
{{- define "openops.secretName" -}}
100+
{{- printf "%s-env" (include "openops.fullname" .) -}}
101+
{{- end }}
102+
103+
{{/*
104+
Determine if an environment variable name should be treated as a secret.
105+
*/}}
106+
{{- define "openops.isSecretKey" -}}
107+
{{- $key := upper . -}}
108+
{{- if or (contains "PASSWORD" $key) (contains "SECRET" $key) (contains "KEY" $key) -}}
109+
true
110+
{{- else -}}
111+
false
112+
{{- end -}}
113+
{{- end }}
114+
115+
{{/*
116+
Render a single environment variable, sourcing secrets from the shared secret when needed.
117+
Expected dict: { "root": $, "key": "ENV", "value": "value" }
118+
*/}}
119+
{{- define "openops.envVar" -}}
120+
{{- $root := .root -}}
121+
{{- $key := .key -}}
122+
{{- $value := .value -}}
123+
{{- if eq (include "openops.isSecretKey" $key) "true" -}}
124+
- name: {{ $key }}
125+
valueFrom:
126+
secretKeyRef:
127+
name: {{ include "openops.secretName" $root }}
128+
key: {{ $key }}
129+
{{- else -}}
130+
- name: {{ $key }}
131+
value: {{ tpl (tpl $value $root) $root | quote }}
132+
{{- end -}}
133+
{{- end }}
134+
135+
{{/*
136+
Render environment variables from a map using openops.envVar.
137+
Expected dict: { "root": $, "env": dict }
138+
*/}}
139+
{{- define "openops.renderEnv" -}}
140+
{{- $root := .root -}}
141+
{{- $env := .env -}}
142+
{{- if $env }}
143+
{{- range $k, $v := $env }}
144+
{{ include "openops.envVar" (dict "root" $root "key" $k "value" $v) }}
145+
{{- end }}
146+
{{- end }}
147+
{{- end }}

0 commit comments

Comments
 (0)