Skip to content

Commit 89f8ca0

Browse files
authored
Merge branch 'master' into feat/override-app-version-label
2 parents dadd2a5 + e024777 commit 89f8ca0

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ and their default values.
136136
| `secrets.htpasswd` | user and password list to generate htpasswd. | `[]` |
137137
| `secrets.existingSecretHtpasswd` | Existing secret containing htpasswd file (alternative to `secrets.htpasswd`) | `""` |
138138
| `secrets.existingSecretHtpasswdKey` | Key in the existing secret that contains the htpasswd file content | `"htpasswd"` |
139+
| `gatewayApi.enabled` | Enable/Disable Gateway API HTTPRoute (alternative to Ingress) | `false` |
140+
| `gatewayApi.parentRefs` | List of parent Gateway references | `[]` |
141+
| `gatewayApi.hostnames` | List of hostnames for the HTTPRoute | `[]` |
142+
| `gatewayApi.annotations` | HTTPRoute Annotations | `{}` |
143+
| `gatewayApi.labels` | HTTPRoute Labels | `{}` |
144+
| `gatewayApi.rules` | Custom HTTPRoute routing rules. Defaults to PathPrefix `/` if not set | `nil` |
139145
| `ingress.enabled` | Enable/Disable Ingress | `false` |
140146
| `ingress.className` | Ingress Class Name (k8s `>=1.18` required) | `""` |
141147
| `ingress.labels` | Ingress Labels | `{}` |
@@ -234,6 +240,24 @@ kubectl create secret generic my-htpasswd-secret \
234240
> kubectl rollout restart deployment/<release-name>-verdaccio
235241
> ```
236242

243+
### Gateway API (HTTPRoute)
244+
245+
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.
246+
247+
#### Example
248+
249+
```yaml
250+
gatewayApi:
251+
enabled: true
252+
parentRefs:
253+
- name: my-gateway
254+
namespace: default
255+
hostnames:
256+
- npm.example.com
257+
```
258+
259+
> **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.
260+
237261
### Custom ConfigMap
238262

239263
When creating a new chart with this chart as a dependency, CustomConfigMap can
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{{- if .Values.gatewayApi.enabled }}
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: HTTPRoute
4+
metadata:
5+
name: {{ include "verdaccio.fullname" . }}
6+
labels:
7+
{{- include "verdaccio.labels" . | nindent 4 }}
8+
{{- with .Values.gatewayApi.labels }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
{{- with .Values.gatewayApi.annotations }}
12+
annotations:
13+
{{- include "tplvalues.render" (dict "value" . "context" $) | nindent 4 }}
14+
{{- end }}
15+
spec:
16+
{{- with .Values.gatewayApi.parentRefs }}
17+
parentRefs:
18+
{{- toYaml . | nindent 4 }}
19+
{{- end }}
20+
{{- if .Values.gatewayApi.hostnames }}
21+
hostnames:
22+
{{- range .Values.gatewayApi.hostnames }}
23+
- {{ tpl . $ | quote }}
24+
{{- end }}
25+
{{- end }}
26+
rules:
27+
{{- if .Values.gatewayApi.rules }}
28+
{{- toYaml .Values.gatewayApi.rules | nindent 4 }}
29+
{{- else }}
30+
- matches:
31+
- path:
32+
type: PathPrefix
33+
value: /
34+
backendRefs:
35+
- name: {{ include "verdaccio.fullname" . }}
36+
port: {{ .Values.service.port }}
37+
{{- end }}
38+
{{- end }}

charts/verdaccio/values.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,32 @@ ingress:
9696
# hosts:
9797
# - npm.blah.com
9898

99+
## Gateway API - HTTPRoute
100+
## Ref: https://gateway-api.sigs.k8s.io/
101+
## This creates an HTTPRoute resource as an alternative to Ingress
102+
gatewayApi:
103+
enabled: false
104+
## Reference to an existing Gateway
105+
## Ref: https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ParentReference
106+
parentRefs: []
107+
# - name: my-gateway
108+
# namespace: default
109+
# sectionName: https
110+
## Hostnames for the HTTPRoute
111+
hostnames: []
112+
# - npm.example.com
113+
annotations: {}
114+
labels: {}
115+
## Custom routing rules. If not set, a default rule matching PathPrefix "/" is created
116+
# rules:
117+
# - matches:
118+
# - path:
119+
# type: PathPrefix
120+
# value: /
121+
# backendRefs:
122+
# - name: my-service
123+
# port: 4873
124+
99125
## Service account
100126
serviceAccount:
101127
# Specifies whether a service account should be created

0 commit comments

Comments
 (0)