diff --git a/charts/kubebrowser/Chart.yaml b/charts/kubebrowser/Chart.yaml index 43838aa..69d0946 100644 --- a/charts/kubebrowser/Chart.yaml +++ b/charts/kubebrowser/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubebrowser description: Allow whitelisted people to access your kubeconfigs type: application -version: 1.3.0 +version: 1.3.1 appVersion: "0.10.0" dependencies: - name: common diff --git a/charts/kubebrowser/README.md b/charts/kubebrowser/README.md index 065d111..5d4d799 100644 --- a/charts/kubebrowser/README.md +++ b/charts/kubebrowser/README.md @@ -95,6 +95,7 @@ helm install my-kubebrowser avisto/kubebrowser -f values.yaml | `server.hostAliases` | kubebrowser server pods host aliases | `[]` | | `server.hostNetwork` | Specify if host network should be enabled for kubebrowser pod | `false` | | `server.containerPorts.http` | kubebrowser server container port for http | `8080` | +| `server.hostname` | Hostname for kubebrowser server | `""` | | `server.hostIPC` | Specify if host IPC should be enabled for kubebrowser pod | `false` | | `server.labels` | Map of labels to add to the statefulset | `{}` | | `server.annotations` | Annotations for server pods | `{}` | @@ -129,7 +130,7 @@ helm install my-kubebrowser avisto/kubebrowser -f values.yaml | `ingress.enabled` | Enable ingress controller resource for frontend | `false` | | `ingress.apiVersion` | Force Ingress API version (automatically detected if not set) | `""` | | `ingress.ingressClassName` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) | `""` | -| `ingress.hostname` | Default host for the ingress resource | `kubebrowser.local` | +| `ingress.hostname` | (DEPRECATED use server.hostname instead) Default host for the ingress resource | `""` | | `ingress.pathType` | Ingress path type | `ImplementationSpecific` | | `ingress.path` | Ingress path | `/` | | `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` | @@ -144,5 +145,4 @@ helm install my-kubebrowser avisto/kubebrowser -f values.yaml | `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/_helpers.tpl b/charts/kubebrowser/templates/_helpers.tpl index 85c3f60..3f815c2 100644 --- a/charts/kubebrowser/templates/_helpers.tpl +++ b/charts/kubebrowser/templates/_helpers.tpl @@ -46,8 +46,8 @@ Return the ingress anotation {{- end -}} {{/* -Return the ingress hostname +Return the correct hostname */}} -{{- define "kubebrowser.ingress.hostname" -}} -{{- tpl .Values.ingress.hostname $ -}} +{{- define "kubebrowser.hostname" -}} +{{- coalesce (tpl .Values.server.hostname $) (tpl .Values.ingress.hostname $) -}} {{- end -}} diff --git a/charts/kubebrowser/templates/deployment.yaml b/charts/kubebrowser/templates/deployment.yaml index ad4b211..76c71a8 100644 --- a/charts/kubebrowser/templates/deployment.yaml +++ b/charts/kubebrowser/templates/deployment.yaml @@ -88,7 +88,7 @@ spec: value: "release" {{- if .Values.ingress.enabled }} - name: KUBEBROWSER_HOSTNAME - value: {{ printf "%s://%s" (ternary "https" "http" (or .Values.ingress.tls (gt (len .Values.ingress.extraTls) 0))) .Values.ingress.hostname }} + value: {{ printf "%s://%s" (ternary "https" "http" (or .Values.ingress.tls (gt (len .Values.ingress.extraTls) 0) .Values.httpRoute.enabled)) (include "kubebrowser.hostname" $) }} {{- end }} - name: KUBEBROWSER_OAUTH2_CLIENT_ID valueFrom: diff --git a/charts/kubebrowser/templates/httproute.yaml b/charts/kubebrowser/templates/httproute.yaml index 8fa346f..f6f6a24 100644 --- a/charts/kubebrowser/templates/httproute.yaml +++ b/charts/kubebrowser/templates/httproute.yaml @@ -18,7 +18,7 @@ spec: parentRefs: {{- tpl (toYaml .Values.httpRoute.parentRefs) $ | nindent 4 }} hostnames: - {{- tpl (toYaml .Values.httpRoute.hostnames) $ | nindent 4 }} + - {{ include "kubebrowser.hostname" $ }} rules: {{- range $ruleIdx, $rule := .Values.httpRoute.rules }} - matches: diff --git a/charts/kubebrowser/templates/ingress.yaml b/charts/kubebrowser/templates/ingress.yaml index b452b9e..477c4e7 100644 --- a/charts/kubebrowser/templates/ingress.yaml +++ b/charts/kubebrowser/templates/ingress.yaml @@ -18,8 +18,8 @@ spec: ingressClassName: {{ .Values.ingress.ingressClassName | quote }} {{- end }} rules: - {{- if (include "kubebrowser.ingress.hostname" .) }} - - host: {{ include "kubebrowser.ingress.hostname" . }} + {{- if (include "kubebrowser.hostname" .) }} + - host: {{ include "kubebrowser.hostname" . }} http: paths: {{- if .Values.ingress.extraPaths }} @@ -50,8 +50,8 @@ spec: tls: {{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" $annotationsMap )) .Values.ingress.selfSigned) }} - hosts: - - {{ include "kubebrowser.ingress.hostname" . }} - secretName: {{ printf "%s-tls" (include "kubebrowser.ingress.hostname" .) }} + - {{ include "kubebrowser.hostname" . }} + secretName: {{ printf "%s-tls" (include "kubebrowser.hostname" .) }} {{- end }} {{- if .Values.ingress.extraTls }} {{- include "common.tplvalues.render" ( dict "value" .Values.ingress.extraTls "context" $ ) | nindent 4 }} diff --git a/charts/kubebrowser/values.schema.json b/charts/kubebrowser/values.schema.json index 3f5e0a4..0cbbec6 100644 --- a/charts/kubebrowser/values.schema.json +++ b/charts/kubebrowser/values.schema.json @@ -361,6 +361,11 @@ } } }, + "hostname": { + "type": "string", + "description": "Hostname for kubebrowser server", + "default": "" + }, "hostIPC": { "type": "boolean", "description": "Specify if host IPC should be enabled for kubebrowser pod", @@ -561,8 +566,8 @@ }, "hostname": { "type": "string", - "description": "Default host for the ingress resource", - "default": "kubebrowser.local" + "description": "(DEPRECATED use server.hostname instead) Default host for the ingress resource", + "default": "" }, "pathType": { "type": "string", @@ -644,12 +649,6 @@ "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": {} } } } diff --git a/charts/kubebrowser/values.yaml b/charts/kubebrowser/values.yaml index 08d5ca9..6583765 100644 --- a/charts/kubebrowser/values.yaml +++ b/charts/kubebrowser/values.yaml @@ -191,11 +191,14 @@ server: hostAliases: [] ## @param server.hostNetwork Specify if host network should be enabled for kubebrowser pod ## + hostNetwork: false ## @param server.containerPorts.http kubebrowser server container port for http ## containerPorts: http: 8080 - hostNetwork: false + ## @param server.hostname Hostname for kubebrowser server + ## + hostname: "" ## @param server.hostIPC Specify if host IPC should be enabled for kubebrowser pod ## hostIPC: false @@ -350,9 +353,9 @@ ingress: ## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/ ## ingressClassName: "" - ## @param ingress.hostname Default host for the ingress resource + ## @param ingress.hostname (DEPRECATED use server.hostname instead) Default host for the ingress resource ## - hostname: kubebrowser.local + hostname: "" ## @param ingress.pathType Ingress path type ## pathType: ImplementationSpecific @@ -372,7 +375,7 @@ ingress: ## annotations: {} ## @param ingress.tls Enable TLS configuration for the hostname defined at `ingress.hostname` parameter - ## TLS certificates will be retrieved from a TLS secret with name: `{{- printf "%s-tls" .Values.ingress.hostname }}` + ## TLS certificates will be retrieved from a TLS secret with name: `{{- printf "%s-tls" .Values.hostname }}` ## You can: ## - Use the `ingress.secrets` parameter to create this TLS secret ## - Rely on cert-manager to create it by setting the corresponding annotations @@ -459,12 +462,6 @@ httpRoute: ## 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: