Skip to content
Merged
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
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ and their default values.
| `secrets.htpasswd` | user and password list to generate htpasswd. | `[]` |
| `secrets.existingSecretHtpasswd` | Existing secret containing htpasswd file (alternative to `secrets.htpasswd`) | `""` |
| `secrets.existingSecretHtpasswdKey` | Key in the existing secret that contains the htpasswd file content | `"htpasswd"` |
| `gatewayApi.enabled` | Enable/Disable Gateway API HTTPRoute (alternative to Ingress) | `false` |
| `gatewayApi.parentRefs` | List of parent Gateway references | `[]` |
| `gatewayApi.hostnames` | List of hostnames for the HTTPRoute | `[]` |
| `gatewayApi.annotations` | HTTPRoute Annotations | `{}` |
| `gatewayApi.labels` | HTTPRoute Labels | `{}` |
| `gatewayApi.rules` | Custom HTTPRoute routing rules. Defaults to PathPrefix `/` if not set | `nil` |
| `ingress.enabled` | Enable/Disable Ingress | `false` |
| `ingress.className` | Ingress Class Name (k8s `>=1.18` required) | `""` |
| `ingress.labels` | Ingress Labels | `{}` |
Expand Down Expand Up @@ -234,6 +240,24 @@ kubectl create secret generic my-htpasswd-secret \
> kubectl rollout restart deployment/<release-name>-verdaccio
> ```

### Gateway API (HTTPRoute)

As an alternative to traditional Ingress, this chart supports creating an [HTTPRoute](https://gateway-api.sigs.k8s.io/) resource for use with the Gateway API. This requires a Gateway API implementation (e.g., Envoy Gateway, Istio, Cilium, nginx-gateway-fabric) and a `Gateway` resource already deployed in your cluster.

#### Example

```yaml
gatewayApi:
enabled: true
parentRefs:
- name: my-gateway
namespace: default
hostnames:
- npm.example.com
```

> **Note**: The chart only creates an `HTTPRoute` — the `Gateway` resource itself should be managed separately as cluster infrastructure. Both `ingress` and `gatewayApi` can coexist if needed during migration.

### Custom ConfigMap

When creating a new chart with this chart as a dependency, CustomConfigMap can
Expand Down
2 changes: 1 addition & 1 deletion charts/verdaccio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A lightweight private node.js proxy registry
name: verdaccio
version: 4.29.0
version: 4.30.0
appVersion: 6.2.3
home: https://verdaccio.org
icon: https://cdn.verdaccio.dev/logos/default.png
Expand Down
38 changes: 38 additions & 0 deletions charts/verdaccio/templates/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- if .Values.gatewayApi.enabled }}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ include "verdaccio.fullname" . }}
labels:
{{- include "verdaccio.labels" . | nindent 4 }}
{{- with .Values.gatewayApi.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.gatewayApi.annotations }}
annotations:
{{- include "tplvalues.render" (dict "value" . "context" $) | nindent 4 }}
{{- end }}
spec:
{{- with .Values.gatewayApi.parentRefs }}
parentRefs:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.gatewayApi.hostnames }}
hostnames:
{{- range .Values.gatewayApi.hostnames }}
- {{ tpl . $ | quote }}
{{- end }}
{{- end }}
rules:
{{- if .Values.gatewayApi.rules }}
{{- toYaml .Values.gatewayApi.rules | nindent 4 }}
{{- else }}
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: {{ include "verdaccio.fullname" . }}
port: {{ .Values.service.port }}
{{- end }}
{{- end }}
26 changes: 26 additions & 0 deletions charts/verdaccio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,32 @@ ingress:
# hosts:
# - npm.blah.com

## Gateway API - HTTPRoute
## Ref: https://gateway-api.sigs.k8s.io/
## This creates an HTTPRoute resource as an alternative to Ingress
gatewayApi:
enabled: false
## Reference to an existing Gateway
## Ref: https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ParentReference
parentRefs: []
# - name: my-gateway
# namespace: default
# sectionName: https
## Hostnames for the HTTPRoute
hostnames: []
# - npm.example.com
annotations: {}
labels: {}
## Custom routing rules. If not set, a default rule matching PathPrefix "/" is created
# rules:
# - matches:
# - path:
# type: PathPrefix
# value: /
# backendRefs:
# - name: my-service
# port: 4873

## Service account
serviceAccount:
# Specifies whether a service account should be created
Expand Down
Loading