Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2857815
chore: add `database` to allowed commit scopes
O7EG Mar 20, 2025
495bee0
docs(database): add initial README
O7EG Mar 20, 2025
d8f17ec
build(database): add initial `.helmignore`
O7EG Mar 20, 2025
aee2c7b
build(database): add initial chart metadata
O7EG Mar 20, 2025
8252d27
build(database): add external chart repository `cnpg`
O7EG Mar 20, 2025
3cebcef
build(database): add dependency `@cnpg/cloudnative-pg` v0.23.2
O7EG Mar 20, 2025
2b0a5f8
feat(database): add initial operator config
O7EG Mar 20, 2025
521c1fa
build(database): add dependency `@cnpg/cluster` v0.2.1
O7EG Mar 20, 2025
61be5db
feat(database): add initial cluster config
O7EG Mar 20, 2025
b524f0d
build(database): fail early when operator and cluster are enabled
O7EG Mar 20, 2025
faab8f8
feat(database): configure cluster's pod affinity
O7EG Mar 20, 2025
065c5c6
feat(database): add connection pooler for the primary instance
O7EG Mar 20, 2025
67474d9
ci(database): add helper for deploying database-operators
O7EG Mar 20, 2025
952d331
ci(database): add helper for deploying database-clusters
O7EG Mar 20, 2025
db8023e
ci: add helper for deploying all EAASI components
O7EG Mar 20, 2025
efe46c2
docs(database): describe a basic deployment procedure
O7EG Mar 20, 2025
0d52213
docs(database): describe available configuration parameters
O7EG Mar 20, 2025
f4b0d4e
docs(database): describe how a development database can be deployed
O7EG Mar 20, 2025
b3d4ba1
ci: add helpers for testing deployed charts
O7EG Mar 21, 2025
ea50c6a
ci: rework `helm-tester` job to use custom helpers instead of `ct` tool
O7EG Mar 21, 2025
4186db0
ci: ignore typo false positives triggered by `ba` surrounded by numbers
O7EG Aug 26, 2025
55b50e6
build(database): bump chart version to 0.5.0
O7EG Aug 26, 2025
da47fca
chore(database): update changelog for version 0.5.0
O7EG Aug 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,13 @@ jobs:
- name: Start Minikube cluster
run: just cluster-start
- *install-helm-step
- *install-ct-step
- *add-chart-repos-step
- name: Install and test charts
run: ct install --config ./configs/chart-testing.yaml --all
- name: Build chart dependencies
run: just build-chart-deps
- name: Install charts
run: just deploy-all
- name: Test charts
run: just test-all

spell-checker:
runs-on: ubuntu-latest
Expand Down
33 changes: 32 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ cluster := "eaasi"
# Name of the cluster namespace
namespace := "eaasi"

# Defaults for database-cluster
database_cluster_name := "database-cluster"
database_cluster_ns := "database"

### HELPERS ###################################################################

# Run spell checker
Expand Down Expand Up @@ -43,7 +47,7 @@ update-changelog chart version="" dir=(chart_dir / chart):

# Add external chart repositories
add-chart-repos:
# TODO: add repos!
helm repo add "cnpg" "https://cloudnative-pg.github.io/charts"

# Build dependencies for all charts
build-chart-deps:
Expand Down Expand Up @@ -80,6 +84,10 @@ render chart name=chart ns=namespace *args="":
helm template "{{ name }}" "{{ chart_dir / chart }}" \
--namespace "{{ ns }}" {{ args }} | less

# Test a Helm chart release
test release ns=namespace *args="":
helm test "{{ release }}" --namespace "{{ ns }}" {{ args }}

### MINIKUBE ##################################################################

# Start a Minikube cluster
Expand All @@ -106,3 +114,26 @@ cluster-unpause name=cluster:
# Delete a Minikube cluster
cluster-delete name=cluster:
minikube delete --profile "{{ name }}"

### EAASI #####################################################################

# Deploy the database-operator
deploy-database-operator name="database-operator" ns="cnpg-system" *args="--wait": \
(upgrade "database" name ns "-f" (chart_dir / "database/configs/operator.yaml") args)

# Deploy the database-cluster
deploy-database-cluster name=database_cluster_name ns=database_cluster_ns *args="--wait": \
(upgrade "database" name ns args)

# Deploy all components
deploy-all: \
(deploy-database-operator) \
(deploy-database-cluster) \

# Test the database-cluster
test-database-cluster name=database_cluster_name ns=database_cluster_ns *args="": \
(test name ns args)

# Test all components
test-all: \
(test-database-cluster) \
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ $ helm search repo eaasi
## Charts

For more details, see the documentation for each chart:
- [database](./charts/database/README.md)

## Development

Expand Down Expand Up @@ -113,6 +114,18 @@ Next, rebuild all required chart dependencies with:
$ just build-chart-deps
```

The [database](./charts/database) operator can be deployed with:

```console
$ just deploy-database-operator # <name> <namespace>
```

Then, a [database](./charts/database) cluster can be deployed with:

```console
$ just deploy-database-cluster # <name> <namespace>
```

## License

Helm charts for EAASI are distributed under the [Apache-2.0](./LICENSE) license.
Expand Down
Empty file removed charts/.gitkeep
Empty file.
26 changes: 26 additions & 0 deletions charts/database/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Patterns to ignore when building packages.

CHANGELOG.md
.DS_Store

# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/

# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~

# Various IDEs
.project
.idea/
*.tmproj
.vscode/
29 changes: 29 additions & 0 deletions charts/database/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Changelog


## 0.5.0 - *2025-08-26*

### Features

- Add initial operator config - ([`ec01985`](https://github.com/eaasi/helm-charts/commit/ec019857db9d8ec8d4421df9d57e51fd8fdfb62d) by @O7EG)
- Add initial cluster config - ([`21e72aa`](https://github.com/eaasi/helm-charts/commit/21e72aae7a91ec2a3f894018a359cc42b2c045c6) by @O7EG)
- Configure cluster's pod affinity - ([`0253975`](https://github.com/eaasi/helm-charts/commit/0253975bb5445897edc45eb2cda7aaeaa035c686) by @O7EG)
- Add connection pooler for the primary instance - ([`c9730a7`](https://github.com/eaasi/helm-charts/commit/c9730a7a5adc9841ad6824249b7ff0517edb4e0c) by @O7EG)

### Continuous Integration

- Add helper for deploying database-operators - ([`39478ba`](https://github.com/eaasi/helm-charts/commit/39478ba46fde82d5b0ea5590634c726578059b61) by @O7EG)

### Documentation

- Add initial README - ([`87fd8c4`](https://github.com/eaasi/helm-charts/commit/87fd8c48e4324b1b78ce2d6479552d269663e92d) by @O7EG)
- Describe a basic deployment procedure - ([`9d7d3b2`](https://github.com/eaasi/helm-charts/commit/9d7d3b2c308255e1b4f372e729aecd03edcbc26c) by @O7EG)
- Describe available configuration parameters - ([`56558e6`](https://github.com/eaasi/helm-charts/commit/56558e6cb1bda369c8e47f1cc1b55de53a8259c5) by @O7EG)

### Miscellaneous

- Add initial `.helmignore` - ([`f830406`](https://github.com/eaasi/helm-charts/commit/f830406e30a9325a45db7c6c0a5e64b226fa4fe9) by @O7EG)
- Add initial chart metadata - ([`631b0e6`](https://github.com/eaasi/helm-charts/commit/631b0e62c074e8552b3457ef2a7e6e0d96e138a8) by @O7EG)
- Add dependency `@cnpg/cloudnative-pg` v0.23.2 - ([`d334337`](https://github.com/eaasi/helm-charts/commit/d3343379e2255eb0b61718417e52cd2f8a71103b) by @O7EG)
- Add dependency `@cnpg/cluster` v0.2.1 - ([`84049a2`](https://github.com/eaasi/helm-charts/commit/84049a228fc9766b13e253dd364debc64ea838d5) by @O7EG)
- Fail early when operator and cluster are enabled - ([`0ffa5c5`](https://github.com/eaasi/helm-charts/commit/0ffa5c5ff5c9c4cd5276fba0dd8503632e8b9d41) by @O7EG)
9 changes: 9 additions & 0 deletions charts/database/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: cloudnative-pg
repository: https://cloudnative-pg.github.io/charts
version: 0.23.2
- name: cluster
repository: https://cloudnative-pg.github.io/charts
version: 0.2.1
digest: sha256:a08a4edc8fc4f25677834d9157b702c8eeb5c33ace93f60fd5f450f5ce393d76
generated: "2025-03-20T17:10:37.269076118+01:00"
20 changes: 20 additions & 0 deletions charts/database/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2025 Yale University
# SPDX-License-Identifier: Apache-2.0

apiVersion: v2
name: database
version: "0.5.0"
description: EAASI Database Helm Chart
type: application
sources:
- https://github.com/eaasi/helm-charts
dependencies:
- repository: "@cnpg"
name: cloudnative-pg
version: "0.23.2"
alias: operator
condition: operator.enabled
- repository: "@cnpg"
name: cluster
version: "0.2.1"
condition: cluster.enabled
41 changes: 41 additions & 0 deletions charts/database/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# EAASI Database Helm Chart

This Helm chart deploys the EAASI Database on [Kubernetes](https://kubernetes.io/) using the [Helm](https://helm.sh) package manager.

## Getting Started

This chart depends on the [operator](https://github.com/cloudnative-pg/charts/tree/main/charts/cloudnative-pg) and the [cluster](https://github.com/cloudnative-pg/charts/tree/main/charts/cluster) charts from the [CloudNativePG](https://github.com/cloudnative-pg) project.

### Adding the Repositories

```console
$ helm repo add cnpg "https://cloudnative-pg.github.io/charts"
$ helm repo add eaasi "https://eaasi.github.io/helm-charts"
```

### Installing the Operator

First, the *CNPG operator* must be installed, since it provides several CRDs required for setting up new database *clusters*.
Skip this step if the operator is already installed in your K8s cluster:

```console
$ helm install database-operator eaasi/database \
--namespace cnpg-system --create-namespace \
-f ./configs/operator.yaml
```

### Creating a Cluster

A new *CNPG cluster* can be created with the following command:

```console
$ helm install database-cluster eaasi/database \
--namespace database --create-namespace
```

## Configuration

A minimal configuration for an operator and a cluster is provided in the default [values.yaml](./values.yaml) file.
For further details on all available parameters, please refer to the configuration files of the upstream [operator](https://github.com/cloudnative-pg/charts/tree/main/charts/cloudnative-pg) and [cluster](https://github.com/cloudnative-pg/charts/tree/main/charts/cluster) charts.

The extensive documentation for the CloudNativePG project can be found [here](https://cloudnative-pg.io/documentation/current/).
12 changes: 12 additions & 0 deletions charts/database/configs/operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2025 Yale University
# SPDX-License-Identifier: Apache-2.0

# Override values for installing the operator

operator:
# Enable the operator
enabled: true

cluster:
# Disable the cluster
enabled: false
6 changes: 6 additions & 0 deletions charts/database/templates/assertions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: 2025 Yale University
# SPDX-License-Identifier: Apache-2.0

{{- if and .Values.operator.enabled .Values.cluster.enabled -}}
{{- fail "Either the operator or the cluster should be enabled, not both!" -}}
{{- end -}}
58 changes: 58 additions & 0 deletions charts/database/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# SPDX-FileCopyrightText: 2025 Yale University
# SPDX-License-Identifier: Apache-2.0

# Default values for the EAASI Database

# Configuration for the CNPG operator:
# https://github.com/cloudnative-pg/charts/tree/main/charts/cloudnative-pg
operator:
# -- Should the operator be enabled?
enabled: false
# -- Override operator name
fullnameOverride: cnpg-operator
# -- Override subchart name
# NOTE: The original chart name must be used here for now, because
# the upstream chart hard-codes it in multiple templates!
nameOverride: cloudnative-pg
# -- Number of replicas
replicaCount: 1

# Configuration for the CNPG cluster:
# https://github.com/cloudnative-pg/charts/tree/main/charts/cluster
cluster:
# -- Should the cluster be enabled?
enabled: true
# -- Override cluster name
fullnameOverride: eaasi
# -- Override subchart name
nameOverride: database-cluster
# -- Cluster mode of operation
mode: standalone
# -- Type of the CNPG database
type: postgresql
# -- Version of the CNPG database
version:
postgresql: "17.4"
# -- CNPG cluster config
cluster:
# -- Number of instances
instances: 1
# -- Affinity rules for Pods
affinity:
enablePodAntiAffinity: true
podAntiAffinityType: preferred
topologyKey: kubernetes.io/hostname
# -- Database storage config
storage:
size: 1Gi
# -- PgBouncer poolers
poolers:
- name: rw
type: rw
instances: 1
poolMode: transaction
parameters:
max_client_conn: "250"
default_pool_size: "20"
reserve_pool_size: "5"
min_pool_size: "5"
5 changes: 5 additions & 0 deletions configs/committed.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ allowed_types = [
"style",
"test",
]

# allowed commit scopes
allowed_scopes = [
"database",
]
3 changes: 3 additions & 0 deletions configs/typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ extend-ignore-re = [
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
# ignore blocks with "spellchecker:<on|off>"
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
# ignore false positives triggered by "ba" surrounded by numbers
"[0-9]+ba",
"ba[0-9]+",
]

[default.extend-words]
Expand Down
Loading