diff --git a/charts/kubebrowser/Chart.lock b/charts/kubebrowser/Chart.lock index 3cf65c2..ee3bab7 100644 --- a/charts/kubebrowser/Chart.lock +++ b/charts/kubebrowser/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: common repository: oci://registry-1.docker.io/bitnamicharts - version: 2.30.0 -digest: sha256:1d4fe7ab3d8601c2772b82ca4495929226ecbf073f9fb436f5bf5f089df6c4bd -generated: "2025-06-03T10:24:02.704756898+02:00" + version: 2.36.0 +digest: sha256:bee4492fef3cdaf3e43a7a34ea036007bd1b1dd78cc9fc6df112be21eb8d9f5d +generated: "2026-02-11T15:34:15.969714427+01:00" diff --git a/charts/kubebrowser/Chart.yaml b/charts/kubebrowser/Chart.yaml index b4aff9b..43838aa 100644 --- a/charts/kubebrowser/Chart.yaml +++ b/charts/kubebrowser/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: kubebrowser description: Allow whitelisted people to access your kubeconfigs type: application -version: 1.2.0 +version: 1.3.0 appVersion: "0.10.0" dependencies: - name: common - version: 2.30.0 + version: 2.36.0 repository: oci://registry-1.docker.io/bitnamicharts maintainers: - name: Brawdunoir diff --git a/charts/kubebrowser/README.md b/charts/kubebrowser/README.md index a702b71..065d111 100644 --- a/charts/kubebrowser/README.md +++ b/charts/kubebrowser/README.md @@ -140,3 +140,9 @@ helm install my-kubebrowser avisto/kubebrowser -f values.yaml | `ingress.extraTls` | The tls configuration for additional hostnames to be covered with this ingress record. | `[]` | | `ingress.secrets` | If you're providing your own certificates, please use this to add the certificates as secrets | `[]` | | `ingress.extraRules` | Additional rules to be covered with this ingress record | `[]` | +| `httpRoute.enabled` | Whether to enable this HTTPRoute & subsequently create the HTTPRoute resource | `false` | +| `httpRoute.annotations` | Additional HTTPRoute annotations | `{}` | +| `httpRoute.labels` | Additional HTTPRoute labels | `{}` | +| `httpRoute.parentRefs` | Gateway API parentRefs for the HTTPRoute. Must reference an existing Gateway | `[]` | +| `httpRoute.hostnames` | List of hostnames for the HTTPRoute | `[]` | +| `httpRoute.rules` | (Optional) HTTPRoute rules configuration, if overriden, backendRefs is set by default | `undefined` | diff --git a/charts/kubebrowser/templates/httproute.yaml b/charts/kubebrowser/templates/httproute.yaml new file mode 100644 index 0000000..8fa346f --- /dev/null +++ b/charts/kubebrowser/templates/httproute.yaml @@ -0,0 +1,46 @@ +{{- /* +Author: Yann Lacroix +*/}} + +{{- if .Values.httpRoute.enabled -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ include "common.names.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.httpRoute.labels .Values.commonLabels ) "context" $ ) }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} + {{- if or .Values.httpRoute.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.httpRoute.annotations .Values.commonAnnotations ) "context" $ ) }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- tpl (toYaml .Values.httpRoute.parentRefs) $ | nindent 4 }} + hostnames: + {{- tpl (toYaml .Values.httpRoute.hostnames) $ | nindent 4 }} + rules: + {{- range $ruleIdx, $rule := .Values.httpRoute.rules }} + - matches: + {{- tpl (toYaml $rule.matches) $ | nindent 8 }} + {{- if $rule.backendRefs }} + backendRefs: + {{- tpl (toYaml $rule.backendRefs) $ | nindent 8 }} + {{- else }} + backendRefs: + - group: '' + kind: Service + name: {{ include "kubebrowser.server.fullname" $ }} + port: {{ $.Values.server.containerPorts.http}} + weight: 1 + {{- end }} + {{- if $rule.filters }} + filters: + {{- tpl (toYaml $rule.filters) $ | nindent 8 }} + {{- end }} + {{- if $rule.timeouts }} + timeouts: + {{- tpl (toYaml $rule.timeouts) $ | nindent 8 }} + {{- end }} + {{- end -}} +{{- end -}} diff --git a/charts/kubebrowser/templates/ingress.yaml b/charts/kubebrowser/templates/ingress.yaml index bd2ce64..b452b9e 100644 --- a/charts/kubebrowser/templates/ingress.yaml +++ b/charts/kubebrowser/templates/ingress.yaml @@ -2,7 +2,7 @@ Author: Yann Lacroix */}} -{{- if and .Values.ingress.enabled -}} +{{- if .Values.ingress.enabled -}} apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} kind: Ingress metadata: @@ -26,9 +26,7 @@ spec: {{- toYaml .Values.ingress.extraPaths | nindent 10 }} {{- end }} - path: {{ .Values.ingress.path }} - {{- if eq "true" (include "common.ingress.supportsPathType" .) }} pathType: {{ .Values.ingress.pathType }} - {{- end }} backend: {{- include "common.ingress.backend" (dict "serviceName" (include "kubebrowser.server.fullname" .) "servicePort" "http" "context" $) | nindent 14 }} {{- end }} {{- range .Values.ingress.extraHosts }} diff --git a/charts/kubebrowser/values.schema.json b/charts/kubebrowser/values.schema.json index 2d84375..3f5e0a4 100644 --- a/charts/kubebrowser/values.schema.json +++ b/charts/kubebrowser/values.schema.json @@ -620,6 +620,38 @@ "items": {} } } + }, + "httpRoute": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether to enable this HTTPRoute & subsequently create the HTTPRoute resource", + "default": false + }, + "annotations": { + "type": "object", + "description": "Additional HTTPRoute annotations", + "default": {} + }, + "labels": { + "type": "object", + "description": "Additional HTTPRoute labels", + "default": {} + }, + "parentRefs": { + "type": "array", + "description": "Gateway API parentRefs for the HTTPRoute. Must reference an existing Gateway", + "default": [], + "items": {} + }, + "hostnames": { + "type": "array", + "description": "List of hostnames for the HTTPRoute", + "default": [], + "items": {} + } + } } } } \ No newline at end of file diff --git a/charts/kubebrowser/values.yaml b/charts/kubebrowser/values.yaml index 722c58d..08d5ca9 100644 --- a/charts/kubebrowser/values.yaml +++ b/charts/kubebrowser/values.yaml @@ -437,3 +437,52 @@ ingress: ## name: http ## extraRules: [] + +## HTTPRoute configuration +## ref: https://gateway-api.sigs.k8s.io/api-types/httproute/ +httpRoute: + ## @param httpRoute.enabled Whether to enable this HTTPRoute & subsequently create the HTTPRoute resource + ## + enabled: false + ## @param httpRoute.annotations Additional HTTPRoute annotations + ## + annotations: {} + ## @param httpRoute.labels Additional HTTPRoute labels + ## + labels: {} + ## @param httpRoute.parentRefs Gateway API parentRefs for the HTTPRoute. Must reference an existing Gateway + ## e.g: + ## parentRefs: + ## - group: gateway.networking.k8s.io + ## kind: Gateway + ## name: main-gateway + ## namespace: gateway + ## + parentRefs: [] + ## @param httpRoute.hostnames List of hostnames for the HTTPRoute + ## e.g: + ## hostnames: + ## - kubebrowser.example.com + ## + hostnames: [] + ## @skip httpRoute.rules + ## @param httpRoute.rules (Optional) HTTPRoute rules configuration, if overriden, backendRefs is set by default + ## e.g: + ## rules: + ## - matches: + ## - path: + ## type: PathPrefix + ## value: / + ## filters: + ## - type: RequestHeaderModifier + ## requestHeaderModifier: + ## add: + ## - name: X-Custom-Header + ## value: custom-value + ## timeouts: + ## request: 500ms + rules: + - matches: + - path: + type: PathPrefix + value: /