docs: restructure helm chart usage notes + examples

This commit is contained in:
spwoodcock
2026-02-02 21:22:21 +00:00
parent 655ac7ed08
commit f98f77281e
2 changed files with 63 additions and 65 deletions

View File

@@ -2,49 +2,17 @@
Deploys **BentoPDF** as a **single NGINX container** serving the static frontend. Deploys **BentoPDF** as a **single NGINX container** serving the static frontend.
## Prereqs ## Quickstart
- Kubernetes cluster ### Option 1: Port-forward (testing)
- Helm v3 with OCI support
- An image that serves BentoPDF via nginx (default chart expects the repo image, which listens on **8080** inside the container)
## Quickstart (ClusterIP + port-forward)
```bash ```bash
helm install bentopdf ./chart helm install bentopdf ./chart
kubectl port-forward deploy/bentopdf 8080:8080 kubectl port-forward deploy/bentopdf 8080:8080
# open http://127.0.0.1:8080 # open http://127.0.0.1:8080
``` ```
## Configuration ### Option 2: Ingress
### Image
- **`image.repository`**: container image repo (default `bentopdf/bentopdf`)
- **`image.tag`**: image tag (default: `Chart.appVersion`)
- **`image.pullPolicy`**: default `IfNotPresent`
### Ports
- **`containerPort`**: container listen port (**8080** for the BentoPDF nginx image)
- **`service.port`**: Service port exposed in-cluster (default **80**)
### Environment variables
Use **`env`** for the container.
Example (IPv4-only environments):
```yaml
env:
- name: DISABLE_IPV6
value: "true"
```
### Ingress (optional)
Enable the built-in Kubernetes Ingress:
```yaml ```yaml
ingress: ingress:
@@ -57,38 +25,56 @@ ingress:
pathType: Prefix pathType: Prefix
``` ```
### Gateway API: Gateway + HTTPRoute (optional) ### Option 3: Gateway API (Gateway + HTTPRoute)
This chart can optionally:
- Create a **Gateway** (`gateway.enabled=true`)
- Create an **HTTPRoute** (`httpRoute.enabled=true`) that points at the chart Service
If your cluster uses a shared Gateway created elsewhere, set `gateway.enabled=false` and point `httpRoute.parentRefs` to that Gateway.
Example (create both Gateway + HTTPRoute):
```yaml ```yaml
gateway: gateway:
enabled: true enabled: true
gatewayClassName: cloudflare # or nginx, istio, etc (controller-specific) gatewayClassName: "cloudflare" # or your gateway class
listeners:
- name: http
protocol: HTTP
port: 80
httpRoute: httpRoute:
enabled: true enabled: true
hostnames: hostnames:
- bentopdf.example.com - pdfs.example.com
```
**Note:** Both Gateway and HTTPRoute default to the release namespace. Omit `namespace` fields to use the release namespace automatically.
If you have an existing Gateway, set `gateway.enabled=false` and configure `httpRoute.parentRefs`:
```yaml
gateway:
enabled: false
httpRoute:
enabled: true
parentRefs: parentRefs:
- name: "" # default: release fullname (or gateway.name if set) - name: existing-gateway
namespace: gateway-namespace
sectionName: http sectionName: http
rules: hostnames:
- matches: - pdfs.example.com
- path: ```
type: PathPrefix
value: / ## Configuration
### Image
- **`image.repository`**: container image repo (default: `ghcr.io/alam00000/bentopdf-simple`)
- **`image.tag`**: image tag (default: `Chart.appVersion`)
- **`image.pullPolicy`**: default `IfNotPresent`
### Ports
- **`containerPort`**: container listen port (**8080** for the BentoPDF nginx image)
- **`service.port`**: Service port exposed in-cluster (default **80**)
### Environment Variables
```yaml
env:
- name: DISABLE_IPV6
value: "true"
``` ```
## Publish this chart to GHCR (OCI) for testing/deploying ## Publish this chart to GHCR (OCI) for testing/deploying
@@ -110,5 +96,5 @@ This could be automated as part of a Github workflow.
### Deploy ### Deploy
```bash ```bash
helm upgrade --install bentopdf oci://ghcr.io/$GHCR_USERNAME/charts/bentopdf --version 0.1.0 helm upgrade --install bentopdf oci://ghcr.io/$GHCR_USERNAME/charts/bentopdf --version 1.0.0
``` ```

View File

@@ -1,17 +1,29 @@
1. Get the application URL by running these commands: 1. Get the application URL by running these commands:
{{- if .Values.httpRoute.enabled }} {{- if .Values.httpRoute.enabled }}
{{- $defaultGatewayName := .Values.gateway.name -}}
{{- if not $defaultGatewayName -}}
{{- $defaultGatewayName = printf "%s-gateway" (include "chart.fullname" .) -}}
{{- end -}}
{{- $defaultGatewayNs := .Release.Namespace -}}
{{- if .Values.gateway.enabled -}}
{{- $defaultGatewayNs = default .Release.Namespace .Values.gateway.namespace -}}
{{- end -}}
{{- $gatewayName := $defaultGatewayName -}}
{{- $gatewayNs := $defaultGatewayNs -}}
{{- if and .Values.httpRoute.parentRefs (first .Values.httpRoute.parentRefs) -}}
{{- $firstRef := first .Values.httpRoute.parentRefs -}}
{{- $gatewayName = default $defaultGatewayName $firstRef.name -}}
{{- $gatewayNs = default $defaultGatewayNs $firstRef.namespace -}}
{{- end -}}
{{- if .Values.httpRoute.hostnames }} {{- if .Values.httpRoute.hostnames }}
export APP_HOSTNAME={{ .Values.httpRoute.hostnames | first }} export APP_HOSTNAME={{ .Values.httpRoute.hostnames | first }}
echo "Visit http://$APP_HOSTNAME to use your application"
{{- else }} {{- else }}
export APP_HOSTNAME=$(kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o jsonpath="{.spec.listeners[0].hostname}") echo "HTTPRoute is enabled. Configure httpRoute.hostnames to see your URL here."
{{- end }} {{- end }}
{{- if and .Values.httpRoute.rules (first .Values.httpRoute.rules).matches (first (first .Values.httpRoute.rules).matches).path.value }}
echo "Visit http://$APP_HOSTNAME{{ (first (first .Values.httpRoute.rules).matches).path.value }} to use your application"
NOTE: Your HTTPRoute depends on the listener configuration of your gateway and your HTTPRoute rules. NOTE: Your HTTPRoute depends on the listener configuration of your gateway and your HTTPRoute rules.
The rules can be set for path, method, header and query parameters. The rules can be set for path, method, header and query parameters.
You can check the gateway configuration with 'kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o yaml' You can check the gateway configuration with 'kubectl get --namespace {{ $gatewayNs }} gateway/{{ $gatewayName }} -o yaml'
{{- end }}
{{- else if .Values.ingress.enabled }} {{- else if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }} {{- range $host := .Values.ingress.hosts }}
{{- range .paths }} {{- range .paths }}