Skip to content

Commit 74cbd6f

Browse files
Initial commit of the first production ready version of this helm chart
0 parents  commit 74cbd6f

61 files changed

Lines changed: 7900 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.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+

.github/workflows/helm-e2e.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Helm Chart End-to-End Test
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'chart/**'
7+
- '.github/workflows/**'
8+
push:
9+
branches: [main]
10+
paths:
11+
- 'chart/**'
12+
- '.github/workflows/**'
13+
14+
jobs:
15+
e2e:
16+
runs-on: ubuntu-large
17+
permissions:
18+
contents: read
19+
env:
20+
RELEASE_NAME: openops
21+
NAMESPACE: openops
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Helm
26+
uses: azure/setup-helm@v4
27+
with:
28+
version: v3.14.4
29+
30+
- name: Cache Docker images
31+
uses: actions/cache@v4
32+
with:
33+
path: /var/lib/docker
34+
key: docker-${{ runner.os }}-${{ hashFiles('chart/values.yaml', 'chart/values.ci.yaml') }}
35+
restore-keys: |
36+
docker-${{ runner.os }}-
37+
38+
- name: Create kind cluster
39+
uses: helm/kind-action@v1.9.0
40+
with:
41+
cluster_name: openops-e2e
42+
wait: 180s
43+
44+
- name: Verify cluster
45+
run: |
46+
set -euo pipefail
47+
kubectl cluster-info
48+
kubectl get nodes -o wide
49+
50+
- name: Deploy chart
51+
run: |
52+
set -euo pipefail
53+
helm upgrade --install "$RELEASE_NAME" chart \
54+
--namespace "$NAMESPACE" \
55+
--create-namespace \
56+
-f chart/values.ci.yaml \
57+
--set nginx.service.type=ClusterIP \
58+
--wait \
59+
--timeout 15m
60+
61+
- name: Wait for workloads
62+
run: |
63+
set -euo pipefail
64+
kubectl get pods -n "$NAMESPACE" -o wide
65+
kubectl wait --for=condition=Available deployment --all -n "$NAMESPACE" --timeout=900s
66+
67+
- name: Verify application health endpoint
68+
run: |
69+
set -euo pipefail
70+
kubectl get svc -n "$NAMESPACE"
71+
kubectl port-forward -n "$NAMESPACE" svc/openops-app 18080:80 >/tmp/port-forward.log 2>&1 &
72+
pf_pid=$!
73+
cleanup() {
74+
kill "$pf_pid" >/dev/null 2>&1 || true
75+
}
76+
trap cleanup EXIT
77+
for attempt in $(seq 1 12); do
78+
if curl -fsS http://127.0.0.1:18080/api/v1/health; then
79+
echo "Health endpoint responded on attempt $attempt"
80+
exit 0
81+
fi
82+
sleep 5
83+
done
84+
echo "Health endpoint did not become ready" >&2
85+
exit 1
86+
87+
- name: Gather diagnostics on failure
88+
if: ${{ failure() }}
89+
run: |
90+
kubectl get all -n "$NAMESPACE"
91+
kubectl describe pods -n "$NAMESPACE" || true
92+
kubectl logs -n "$NAMESPACE" deployment/openops-app --tail=200 || true
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Helm Chart Validation
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'chart/**'
7+
- '.github/workflows/**'
8+
push:
9+
branches: [main]
10+
paths:
11+
- 'chart/**'
12+
- '.github/workflows/**'
13+
14+
jobs:
15+
validate:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Helm
24+
uses: azure/setup-helm@v4
25+
with:
26+
version: v3.14.4
27+
28+
- name: Lint chart
29+
run: helm lint chart
30+
31+
- name: Template with default values
32+
run: helm template openops chart --values chart/values.ci.yaml
33+
34+
- name: Template with example overrides
35+
run: helm template openops chart -f chart/values.overrides-example.yaml

.gitignore

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

AGENTS.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# AGENTS
2+
3+
## Repository structure
4+
- `/chart/Chart.yaml`: Helm chart metadata (name, version, description). **Do not bump the version manually**—it is updated automatically during release workflows.
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/values.ci.yaml`: Resource-constrained overlay for CI environments.
8+
- `/chart/values.dev.yaml`: Development overlay for local development environments.
9+
- `/chart/values.production.yaml`: Production overlay with externalized dependencies and cloud settings.
10+
- `/chart/templates/`: Kubernetes manifests rendered by Helm (43 files). Includes deployments/statefulsets, services, configmaps (`configmap-*.yaml`), secrets (`secret-env.yaml`, `external-secret.yaml`), service accounts, PodDisruptionBudgets, HorizontalPodAutoscalers, NetworkPolicy, LimitRange, ServiceMonitor for Prometheus, and Helm tests. Shared template helpers live in `_helpers.tpl` (561 lines with 49+ helper functions). Postgres and Redis use StatefulSets with volumeClaimTemplates for stable storage and safe rollouts.
11+
- `/chart/templates/NOTES.txt`: Helm installation notes displayed after deployment with important warnings and next steps.
12+
- `/chart/.helmignore`: Excludes development and repository files from packaged charts to reduce size and prevent leaking unnecessary files.
13+
- `/LICENSE`: Apache 2.0 license for this Helm chart repository.
14+
- `/README.md`: Comprehensive documentation covering installation, configuration, operational toggles (secrets, TLS, scaling, production hardening), and multi-environment deployments.
15+
- `/docs/`: Deployment guides including AWS EKS (EC2), AWS EKS Fargate, and platform-specific instructions.
16+
- `/.github/prlint.json`: Pull-request lint configuration (see below) that runs in CI to enforce title/body rules.
17+
- `/.github/workflows/`: Automation (tests, lint, release) triggered by pushes and pull requests. Update these only when you need to change CI behavior.
18+
19+
## Stateful dependencies
20+
- **Postgres and Redis** are deployed as StatefulSets with volumeClaimTemplates for per-pod persistent storage, ordered rollouts, and stable network identities.
21+
- Both support optional authentication, TLS encryption, and backup annotations for production use.
22+
- Set `replicas: 0` in production overlays to use external managed services (AWS RDS, ElastiCache, etc.) instead of in-cluster instances.
23+
- **Tables** uses a PersistentVolumeClaim for `/baserow/data` and includes an init container to fix volume ownership (uid:gid 1000:1000) to ensure compatibility with non-root security contexts.
24+
25+
## Production features
26+
- **Security-first design**: Security contexts enabled by default (runAsNonRoot, drop ALL capabilities, seccomp RuntimeDefault profile).
27+
- **Service accounts**: Dedicated service accounts for each component (app, engine, tables, analytics, nginx, postgres, redis) with configurable annotations for AWS IAM roles (IRSA), GCP Workload Identity, or Azure Managed Identity.
28+
- **External Secrets Operator**: Built-in support for AWS Secrets Manager, HashiCorp Vault, GCP Secret Manager, and Azure Key Vault integration.
29+
- **PodDisruptionBudgets (PDBs)**: Configured for all stateless components to ensure minimum availability during voluntary disruptions (node drains, upgrades).
30+
- **HorizontalPodAutoscalers (HPAs)**: Optional autoscaling for app, engine, analytics, and nginx based on CPU/memory metrics.
31+
- **NetworkPolicy**: Optional network segmentation to restrict pod-to-pod communication and enforce least-privilege networking with explicit allow rules.
32+
- **LimitRange**: Optional namespace-level resource defaults and constraints to prevent resource exhaustion.
33+
- **ServiceMonitor**: Prometheus Operator integration for scraping application metrics from `/metrics` endpoints.
34+
- **Helm tests**: Post-installation connectivity tests to validate deployment health.
35+
- **Validation helpers**: Runtime validation of required secrets (OPS_ENCRYPTION_KEY, OPS_JWT_SECRET, etc.) with helpful error messages at render time.
36+
37+
## PR lint rules
38+
The `.github/prlint.json` ruleset runs on every pull request. To avoid CI failures:
39+
1. **Title requirements**
40+
- Start with a capitalized real word (`Add`, `Fix`, `Update`, etc.).
41+
- Contain at least three words so reviewers immediately understand the change.
42+
- Use the imperative mood ("Add support for X" rather than "Added" or "Adding").
43+
2. **Body requirements**
44+
- 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`).
45+
- For dependency bumps, "Dependabot commands and options" is also accepted.
46+
47+
## License
48+
This Helm chart repository is licensed under the Apache License 2.0. See the LICENSE file for full terms.
49+
50+
## Documentation updates
51+
- **Update both AGENTS.md and README.md** with every PR if there are relevant changes to repository structure, workflows, guidelines, or usage instructions.
52+
- Keep documentation synchronized with code changes to ensure agents and users have accurate information.
53+
- The chart is production-ready and follows enterprise-grade best practices for security, high availability, and observability.
54+
55+
## Commit guidelines
56+
- Write commit subjects in the imperative mood, mirroring the PR title rules (e.g., "Add Redis PVC annotations").
57+
- Capitalize the first word and keep the subject ≤ 72 characters; add a blank line before the body.
58+
- Use the body to explain *what* and *why*, wrapping at ~72 characters per line for readability.
59+
- Reference relevant issues in the body when closing or relating work (same keywords as PR bodies).
60+
- Prefer focused commits that touch a single logical change; this keeps review and potential rollbacks simple.

0 commit comments

Comments
 (0)