Skip to content

Remove hard-coded cert-manager configuration and improve TLS docs #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
74 changes: 71 additions & 3 deletions docs/unified-ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ ingress:
tls:
enabled: false
secretName: eoapi-tls
certManager: false
certManagerIssuer: letsencrypt-prod
certManagerEmail: ""
```

## Controller-Specific Configurations
Expand Down Expand Up @@ -89,6 +86,77 @@ ingress:
secretName: eoapi-tls
```

## Setting up TLS with cert-manager

[cert-manager](https://cert-manager.io) can be used to automatically obtain and manage TLS certificates. Here's how to set it up with Let's Encrypt:

1. First, install cert-manager in your cluster:
```bash
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--set installCRDs=true
```

2. Create a ClusterIssuer for Let's Encrypt (staging first for testing):
```yaml
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
# Use Let's Encrypt staging environment first
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: your-email@example.com
privateKeySecretRef:
name: letsencrypt-staging
solvers:
- http01:
ingress:
class: nginx # or traefik, depending on your setup
```

3. After testing with staging, create the production issuer:
```yaml
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: your-email@example.com
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- http01:
ingress:
class: nginx # or traefik, depending on your setup
```

4. Configure your eoAPI ingress to use cert-manager:
```yaml
ingress:
enabled: true
className: "nginx" # or "traefik"
host: "eoapi.example.com"
annotations:
# Add cert-manager annotations
cert-manager.io/cluster-issuer: "letsencrypt-prod"
tls:
enabled: true
secretName: eoapi-tls # cert-manager will create this secret
```

The certificate will be automatically obtained and renewed by cert-manager. The process typically takes a few minutes. You can check the certificate status with:
```bash
kubectl get certificate
```

## Migration

If you're migrating from a version 0.6.0 or earlier, follow these guidelines:
Expand Down
3 changes: 0 additions & 3 deletions helm-chart/eoapi/templates/services/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ metadata:
traefik.ingress.kubernetes.io/router.entrypoints: web
traefik.ingress.kubernetes.io/router.middlewares: {{ $.Release.Namespace }}-strip-prefix-middleware-{{ $.Release.Name }}@kubernetescrd
{{- end }}
{{- if and .Values.ingress.tls.enabled .Values.ingress.tls.certManager .Values.ingress.tls.certManagerIssuer }}
cert-manager.io/issuer: {{ .Values.ingress.tls.certManagerIssuer }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
Expand Down
3 changes: 0 additions & 3 deletions helm-chart/eoapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ ingress:
tls:
enabled: false
secretName: eoapi-tls
certManager: false
certManagerIssuer: letsencrypt-prod
certManagerEmail: ""

######################
# DATABASE
Expand Down
Loading