Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The full documentation is available [here](https://codegouvfr.github.io/catalogi
## It is deployed on several places

1. [https://code.gouv.fr/sill](https://code.gouv.fr/sill/) for the
list of recommanded Free Software for French administrations.
list of recommanded Free Software for French administrations.
2. [https://logiciels.catalogue-esr.fr/](https://logiciels.catalogue-esr.fr/) for the French Research Minister, listing mostly HAL softwares.

## Code organization
Expand All @@ -22,7 +22,7 @@ This "monorepo" is made of several directories:
- api: Application API (also includes jobs, that can be run periodically)
- web: Web frontend
- docs: Documentation, as deployed [here](https://codegouvfr.github.io/catalogi/)
- deploy-examples: Examples of deployment. For now, there is only a Docker Compose example.
- deploy-examples: Examples of deployment, including [Docker Compose](deploy-examples/docker-compose) and [Kubernetes with Helm](docs/5-deploying-with-kubernetes.md).

## Governance and contributions

Expand Down
93 changes: 93 additions & 0 deletions deployment-examples/helm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Deploying Catalogi with Helm

This directory contains examples for deploying Catalogi using Helm charts.

## Prerequisites

- Kubernetes cluster (1.19+)
- Helm 3.x installed
- kubectl configured to access your cluster

## Quick Start

### 1. Add the Helm repository (if published)

```bash
# If published to a helm repository
helm repo add catalogi https://your-helm-repo.com
helm repo update
```

### 2. Install with default values

```bash
helm install catalogi catalogi/catalogi
```

### 3. Install from local chart

```bash
# From the root of this repository
helm install catalogi ./helm-charts/catalogi
```

## Configuration Examples

### Basic Configuration

See `values-basic.yaml` for a minimal production-ready configuration.

```bash
helm install catalogi ./helm-charts/catalogi -f deployment-examples/helm/values-basic.yaml
```

### Production Configuration

See `values-production.yaml` for a comprehensive production setup with:
- External PostgreSQL database
- TLS configuration
- Resource limits
- Security contexts

```bash
helm install catalogi ./helm-charts/catalogi -f deployment-examples/helm/values-production.yaml
```

### Development Configuration

See `values-development.yaml` for local development with:
- Adminer enabled
- Lower resource requirements
- Debug settings

```bash
helm install catalogi ./helm-charts/catalogi -f deployment-examples/helm/values-development.yaml
```

## Customization

The chart supports extensive customization through the `customization` section in values.yaml. See the example files for different configuration patterns.

## Monitoring Health

Check the status of your deployment:

```bash
kubectl get pods -l app.kubernetes.io/name=catalogi
kubectl get ingress
helm status catalogi
```

## Upgrading

```bash
helm upgrade catalogi ./helm-charts/catalogi -f your-values.yaml
```

## Uninstalling

```bash
helm uninstall catalogi
```

Note: This will not delete persistent volumes by default. Delete them manually if needed.
32 changes: 32 additions & 0 deletions deployment-examples/helm/ingress-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: catalogi-api
namespace: catalogi
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/enable-modsecurity: "false"
nginx.ingress.kubernetes.io/enable-owasp-core-rules: "false"
spec:
ingressClassName: nginx
rules:
- host: catalogi.127.0.0.1.nip.io
http:
paths:
- path: /api(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: catalogi-api
port:
number: 3000
- host: localhost
http:
paths:
- path: /api(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: catalogi-api
port:
number: 3000
31 changes: 31 additions & 0 deletions deployment-examples/helm/ingress-web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: catalogi-web
namespace: catalogi
annotations:
nginx.ingress.kubernetes.io/enable-modsecurity: "false"
nginx.ingress.kubernetes.io/enable-owasp-core-rules: "false"
spec:
ingressClassName: nginx
rules:
- host: catalogi.127.0.0.1.nip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: catalogi-web
port:
number: 80
- host: localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: catalogi-web
port:
number: 80
73 changes: 73 additions & 0 deletions deployment-examples/helm/values-basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Basic production-ready configuration for Catalogi
# This example shows minimal required changes for production

# Configure your domain
ingress:
enabled: true
className: "nginx" # Change to your ingress class
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod" # If using cert-manager
hosts:
- host: catalogi.yourdomain.com # CHANGE THIS
paths:
- path: /
pathType: ImplementationSpecific
service:
name: web
port: 80
- path: /api
pathType: ImplementationSpecific
service:
name: api
port: 3000
tls:
- secretName: catalogi-tls
hosts:
- catalogi.yourdomain.com # CHANGE THIS

# Database configuration - CHANGE THESE PASSWORDS
database:
user: "catalogi_user"
db: "catalogi_db"
password: "your-secure-password-here" # CHANGE THIS

postgresql:
enabled: true
auth:
username: "catalogi_user"
database: "catalogi_db"
password: "your-secure-password-here" # CHANGE THIS
primary:
persistence:
enabled: true
size: 20Gi

# Basic resource limits
web:
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 256Mi

api:
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 200m
memory: 512Mi

# Basic customization
customization:
enabled: true
uiConfig: |-
{
"organizationFullName": "Your Organization",
"organizationShortName": "YourOrg",
"websiteUrl": "https://yourorg.com",
"logoUrl": "https://yourorg.com/logo.png"
}
107 changes: 107 additions & 0 deletions deployment-examples/helm/values-development.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Development configuration for Catalogi
# This example is optimized for local development and testing

# Single replica for development
web:
replicaCount: 1
image:
tag: "latest"
pullPolicy: Always

# Lower resource requirements
resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 50m
memory: 128Mi

api:
replicaCount: 1
image:
tag: "latest"
pullPolicy: Always

# Lower resource requirements
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 256Mi

# Local database with small storage
database:
user: "catalogi_dev"
db: "catalogi_dev"
password: "dev_password"

postgresql:
enabled: true
auth:
username: "catalogi_dev"
database: "catalogi_dev"
password: "dev_password"
primary:
persistence:
enabled: true
size: 1Gi

# Development ingress (no TLS)
ingress:
enabled: true
className: ""
annotations: {}
hosts:
- host: catalogi.local
paths:
- path: /
pathType: ImplementationSpecific
service:
name: web
port: 80
- path: /api
pathType: ImplementationSpecific
service:
name: api
port: 3000
tls: []

# More frequent updates for development
update:
schedule: "*/30 * * * *" # Every 30 minutes
image:
tag: "latest"
resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 50m
memory: 128Mi

# Enable adminer for database inspection
adminer:
enabled: true
image:
repository: adminer
tag: "latest"

# Development customization
customization:
enabled: true
uiConfig: |-
{
"organizationFullName": "Development Instance",
"organizationShortName": "DEV",
"websiteUrl": "http://catalogi.local",
"logoUrl": "/logo.png"
}
translations:
en: |-
{
"welcome": "Development Environment",
"description": "This is a development instance"
}
Loading