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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- **Helm chart: the chart-templated Namespace no longer conflicts with
`helm install --create-namespace` or gets deleted on uninstall**
With Helm(4) server-side apply silently adopted the namespace and a
`helm uninstall` then deleted the namespace and everything in it.
The Namespace template is now gated behind a new `createNamespace`
value (default `false`), so the documented `--create-namespace`
flow works on both Helm major versions.
- **Redirect port now derives from the Gateway listener, not the `Host`
header.** A `RequestRedirect` filter with no `scheme` and no `port` was
building the `Location` port from the client's `Host` header, so a request
Expand Down
16 changes: 16 additions & 0 deletions charts/varnish-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ helm install varnish-gateway oci://ghcr.io/varnish/charts/varnish-gateway \
--create-namespace
```

### Namespace management

If instead you want the chart to own the namespace (e.g. rendering with
`helm template | kubectl apply`) set `createNamespace=true`

```bash
helm install varnish-gateway oci://ghcr.io/varnish/charts/varnish-gateway \
--version 0.x.y \
--set namespace=varnish-gateway-system \
--set createNamespace=true
```

The chart-created namespace carries `helm.sh/resource-policy: keep`, so
uninstalling the release leaves the namespace (and anything in it) intact.

## Configuration

The following table lists the configurable parameters of the Varnish Gateway chart and their default values.
Expand Down Expand Up @@ -84,6 +99,7 @@ Requires the prometheus-operator CRDs (`monitoring.coreos.com`) — e.g. from
| Parameter | Description | Default |
|-----------|-------------|---------|
| `namespace` | Namespace for operator deployment | `varnish-gateway-system` |
| `createNamespace` | Let the chart create the namespace itself | `false` |
| `rbac.create` | Create RBAC resources | `true` |
| `serviceAccount.create` | Create service account | `true` |
| `commonLabels` | Extra labels added to all resources | `{}` |
Expand Down
7 changes: 5 additions & 2 deletions charts/varnish-gateway/templates/namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{{- if .Values.createNamespace }}
apiVersion: v1
kind: Namespace
metadata:
name: {{ include "varnish-gateway.namespace" . }}
labels:
{{- include "varnish-gateway.labels" . | nindent 4 }}
{{- with .Values.commonAnnotations }}
annotations:
helm.sh/resource-policy: keep
{{- with .Values.commonAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Exercises the opt-in chart-managed Namespace (createNamespace=true),
# which is gated off by default so `helm install --create-namespace` and
# pre-existing namespaces don't conflict with a templated Namespace.
createNamespace: true
namespace: custom-gateway-ns
commonAnnotations:
team: platform
1 change: 1 addition & 0 deletions charts/varnish-gateway/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"additionalProperties": true,
"properties": {
"namespace": { "type": "string", "minLength": 1 },
"createNamespace": { "type": "boolean" },
"operator": {
"type": "object",
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions charts/varnish-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
# Namespace where the operator will be installed
namespace: varnish-gateway-system

# Set true for flows where nothing else creates the namespace
# example: helm template | kubectl apply
createNamespace: false

# Operator configuration
operator:
# Number of operator replicas
Expand Down
Loading