Skip to content
Closed
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
22 changes: 22 additions & 0 deletions charts/console/chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,28 @@ Override `console.fullname` template.

**Default:** `""`

### [gateway](https://artifacthub.io/packages/helm/redpanda-data/console?modal=values&path=gateway)

Gateway API `HTTPRoute` settings.

**Default:**

```
{"annotations":{},"enabled":false,"hostnames":["chart-example.local"],"parentRefs":[],"path":"/","pathType":"PathPrefix"}
```

### [gateway.parentRefs](https://artifacthub.io/packages/helm/redpanda-data/console?modal=values&path=gateway.parentRefs)

Gateway parent references for this route. If no parentRefs are specified, the HTTPRoute is still rendered but will not attach to any Gateway until configured.

**Default:** `[]`

### [gateway.pathType](https://artifacthub.io/packages/helm/redpanda-data/console?modal=values&path=gateway.pathType)

One of Exact, PathPrefix, or RegularExpression.

**Default:** `"PathPrefix"`

### [image](https://artifacthub.io/packages/helm/redpanda-data/console?modal=values&path=image)

Redpanda Console Docker image settings.
Expand Down
14 changes: 13 additions & 1 deletion charts/console/chart/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ func Notes(dot *helmette.Dot) []string {
commands := []string{
`1. Get the application URL by running these commands:`,
}
if values.Gateway.Enabled {
for _, hostname := range values.Gateway.Hostnames {
commands = append(commands, fmt.Sprintf("http://%s%s", hostname, values.Gateway.Path))
}
}

if values.Ingress.Enabled {
scheme := "http"
if len(values.Ingress.TLS) > 0 {
Expand All @@ -31,7 +37,13 @@ func Notes(dot *helmette.Dot) []string {
commands = append(commands, fmt.Sprintf("%s://%s%s", scheme, host.Host, path.Path))
}
}
} else if helmette.Contains("NodePort", string(values.Service.Type)) {
}

if len(commands) > 1 {
return commands
}

if helmette.Contains("NodePort", string(values.Service.Type)) {
commands = append(
commands,
fmt.Sprintf(` export NODE_PORT=$(kubectl get --namespace %s -o jsonpath="{.spec.ports[0].nodePort}" services %s)`, dot.Release.Namespace, Fullname(dot)),
Expand Down
2 changes: 1 addition & 1 deletion charts/console/chart/templates/_chart.chart.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{{- $_ := (set $values.secret.authentication "jwtSigningKey" (randAlphaNum (32 | int))) -}}
{{- end -}}
{{- $_is_returning = true -}}
{{- (dict "r" (mustMergeOverwrite (dict "ReleaseName" "" "Namespace" "" "Template" (coalesce nil) "CommonLabels" (coalesce nil) "Values" (dict "replicaCount" 0 "nameOverride" "" "commonLabels" (coalesce nil) "fullnameOverride" "" "image" (dict "registry" "" "repository" "" "pullPolicy" "" "tag" "") "imagePullSecrets" (coalesce nil) "automountServiceAccountToken" false "serviceAccount" (dict "create" false "automountServiceAccountToken" false "annotations" (coalesce nil) "name" "") "annotations" (coalesce nil) "podAnnotations" (coalesce nil) "podLabels" (coalesce nil) "podSecurityContext" (dict) "securityContext" (dict) "service" (dict "type" "" "port" 0 "annotations" (coalesce nil)) "ingress" (dict "enabled" false "annotations" (coalesce nil) "hosts" (coalesce nil) "tls" (coalesce nil)) "resources" (dict) "autoscaling" (dict "enabled" false "minReplicas" 0 "maxReplicas" 0 "targetCPUUtilizationPercentage" (coalesce nil)) "nodeSelector" (coalesce nil) "tolerations" (coalesce nil) "affinity" (dict) "topologySpreadConstraints" (coalesce nil) "priorityClassName" "" "config" (coalesce nil) "extraEnv" (coalesce nil) "extraEnvFrom" (coalesce nil) "extraVolumes" (coalesce nil) "extraVolumeMounts" (coalesce nil) "extraContainers" (coalesce nil) "extraContainerPorts" (coalesce nil) "initContainers" (dict "extraInitContainers" (coalesce nil)) "secretMounts" (coalesce nil) "secret" (dict "create" false "kafka" (dict) "authentication" (dict "jwtSigningKey" "" "oidc" (dict)) "license" "" "redpanda" (dict "adminApi" (dict)) "serde" (dict) "schemaRegistry" (dict)) "livenessProbe" (dict) "readinessProbe" (dict) "configmap" (dict "create" false) "deployment" (dict "create" false) "strategy" (dict) "monitoring" (dict "enabled" false "scrapeInterval" "" "labels" (coalesce nil))) "Metrics" (dict "ViaOperator" false "CloudEnvironment" "" "KubernetesVersion" "" "ChartVersion" "" "ClusterID" "")) (dict "ReleaseName" $dot.Release.Name "Namespace" $dot.Release.Namespace "Values" $values "Template" (list "chart.templater.Template" $templater) "CommonLabels" (dict "helm.sh/chart" (get (fromJson (include "chart.ChartLabel" (dict "a" (list $dot)))) "r") "app.kubernetes.io/managed-by" $dot.Release.Service "app.kubernetes.io/version" $dot.Chart.AppVersion)))) | toJson -}}
{{- (dict "r" (mustMergeOverwrite (dict "ReleaseName" "" "Namespace" "" "Template" (coalesce nil) "CommonLabels" (coalesce nil) "Values" (dict "replicaCount" 0 "nameOverride" "" "commonLabels" (coalesce nil) "fullnameOverride" "" "image" (dict "registry" "" "repository" "" "pullPolicy" "" "tag" "") "imagePullSecrets" (coalesce nil) "automountServiceAccountToken" false "serviceAccount" (dict "create" false "automountServiceAccountToken" false "annotations" (coalesce nil) "name" "") "annotations" (coalesce nil) "podAnnotations" (coalesce nil) "podLabels" (coalesce nil) "podSecurityContext" (dict) "securityContext" (dict) "service" (dict "type" "" "port" 0 "annotations" (coalesce nil)) "ingress" (dict "enabled" false "annotations" (coalesce nil) "hosts" (coalesce nil) "tls" (coalesce nil)) "gateway" (dict "enabled" false "annotations" (coalesce nil) "parentRefs" (coalesce nil) "hostnames" (coalesce nil) "path" "") "resources" (dict) "autoscaling" (dict "enabled" false "minReplicas" 0 "maxReplicas" 0 "targetCPUUtilizationPercentage" (coalesce nil)) "nodeSelector" (coalesce nil) "tolerations" (coalesce nil) "affinity" (dict) "topologySpreadConstraints" (coalesce nil) "priorityClassName" "" "config" (coalesce nil) "extraEnv" (coalesce nil) "extraEnvFrom" (coalesce nil) "extraVolumes" (coalesce nil) "extraVolumeMounts" (coalesce nil) "extraContainers" (coalesce nil) "extraContainerPorts" (coalesce nil) "initContainers" (dict "extraInitContainers" (coalesce nil)) "secretMounts" (coalesce nil) "secret" (dict "create" false "kafka" (dict) "authentication" (dict "jwtSigningKey" "" "oidc" (dict)) "license" "" "redpanda" (dict "adminApi" (dict)) "serde" (dict) "schemaRegistry" (dict)) "livenessProbe" (dict) "readinessProbe" (dict) "configmap" (dict "create" false) "deployment" (dict "create" false) "strategy" (dict) "monitoring" (dict "enabled" false "scrapeInterval" "" "labels" (coalesce nil))) "Metrics" (dict "ViaOperator" false "CloudEnvironment" "" "KubernetesVersion" "" "ChartVersion" "" "ClusterID" "")) (dict "ReleaseName" $dot.Release.Name "Namespace" $dot.Release.Namespace "Values" $values "Template" (list "chart.templater.Template" $templater) "CommonLabels" (dict "helm.sh/chart" (get (fromJson (include "chart.ChartLabel" (dict "a" (list $dot)))) "r") "app.kubernetes.io/managed-by" $dot.Release.Service "app.kubernetes.io/version" $dot.Chart.AppVersion)))) | toJson -}}
{{- break -}}
{{- end -}}
{{- end -}}
Expand Down
17 changes: 15 additions & 2 deletions charts/console/chart/templates/_chart.notes.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
{{- $_is_returning := false -}}
{{- $values := $dot.Values.AsMap -}}
{{- $commands := (list `1. Get the application URL by running these commands:`) -}}
{{- if $values.gateway.enabled -}}
{{- range $_, $hostname := $values.gateway.hostnames -}}
{{- $commands = (concat (default (list) $commands) (list (printf "http://%s%s" $hostname $values.gateway.path))) -}}
{{- end -}}
{{- if $_is_returning -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- if $values.ingress.enabled -}}
{{- $scheme := "http" -}}
{{- if (gt ((get (fromJson (include "_shims.len" (dict "a" (list $values.ingress.tls)))) "r") | int) (0 | int)) -}}
Expand All @@ -23,7 +31,13 @@
{{- if $_is_returning -}}
{{- break -}}
{{- end -}}
{{- else -}}{{- if (contains "NodePort" (toString $values.service.type)) -}}
{{- end -}}
{{- if (gt ((get (fromJson (include "_shims.len" (dict "a" (list $commands)))) "r") | int) (1 | int)) -}}
{{- $_is_returning = true -}}
{{- (dict "r" $commands) | toJson -}}
{{- break -}}
{{- end -}}
{{- if (contains "NodePort" (toString $values.service.type)) -}}
{{- $commands = (concat (default (list) $commands) (list (printf ` export NODE_PORT=$(kubectl get --namespace %s -o jsonpath="{.spec.ports[0].nodePort}" services %s)` $dot.Release.Namespace (get (fromJson (include "chart.Fullname" (dict "a" (list $dot)))) "r")) (printf ` export NODE_IP=$(kubectl get nodes --namespace %s -o jsonpath="{.items[0].status.addresses[0].address}")` $dot.Release.Namespace) " echo http://$NODE_IP:$NODE_PORT")) -}}
{{- else -}}{{- if (contains "NodePort" (toString $values.service.type)) -}}
{{- $commands = (concat (default (list) $commands) (list ` NOTE: It may take a few minutes for the LoadBalancer IP to be available.` (printf ` You can watch the status of by running 'kubectl get --namespace %s svc -w %s'` $dot.Release.Namespace (get (fromJson (include "chart.Fullname" (dict "a" (list $dot)))) "r")) (printf ` export SERVICE_IP=$(kubectl get svc --namespace %s %s --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}")` $dot.Release.Namespace (get (fromJson (include "chart.Fullname" (dict "a" (list $dot)))) "r")) (printf ` echo http://$SERVICE_IP:%d` ($values.service.port | int)))) -}}
Expand All @@ -32,7 +46,6 @@
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $_is_returning = true -}}
{{- (dict "r" $commands) | toJson -}}
{{- break -}}
Expand Down
47 changes: 47 additions & 0 deletions charts/console/chart/templates/_console.gateway.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{- /* GENERATED FILE DO NOT EDIT */ -}}
{{- /* Transpiled by gotohelm from "github.com/redpanda-data/redpanda-operator/charts/console/v3/gateway.go" */ -}}

{{- define "console.HTTPRoute" -}}
{{- $state := (index .a 0) -}}
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- if (not $state.Values.gateway.enabled) -}}
{{- $_is_returning = true -}}
{{- (dict "r" (coalesce nil)) | toJson -}}
{{- break -}}
{{- end -}}
{{- $parentRefs := (coalesce nil) -}}
{{- range $_, $parentRef := $state.Values.gateway.parentRefs -}}
{{- $ref := (mustMergeOverwrite (dict "name" "") (dict "name" (toString (get (fromJson (include (first $state.Template) (dict "a" (concat (rest $state.Template) (list $parentRef.name))))) "r")))) -}}
{{- if (ne (toJson $parentRef.namespace) "null") -}}
{{- $namespace := (get (fromJson (include (first $state.Template) (dict "a" (concat (rest $state.Template) (list $parentRef.namespace))))) "r") -}}
{{- $_ := (set $ref "namespace" (toString $namespace)) -}}
{{- end -}}
{{- if (ne (toJson $parentRef.sectionName) "null") -}}
{{- $sectionName := (toString (get (fromJson (include (first $state.Template) (dict "a" (concat (rest $state.Template) (list (toString $parentRef.sectionName)))))) "r")) -}}
{{- $_ := (set $ref "sectionName" $sectionName) -}}
{{- end -}}
{{- $parentRefs = (concat (default (list) $parentRefs) (list $ref)) -}}
{{- end -}}
{{- if $_is_returning -}}
{{- break -}}
{{- end -}}
{{- $hostnames := (coalesce nil) -}}
{{- range $_, $hostname := $state.Values.gateway.hostnames -}}
{{- $hostnames = (concat (default (list) $hostnames) (list (toString (get (fromJson (include (first $state.Template) (dict "a" (concat (rest $state.Template) (list $hostname))))) "r")))) -}}
{{- end -}}
{{- if $_is_returning -}}
{{- break -}}
{{- end -}}
{{- $pathType := "PathPrefix" -}}
{{- if (ne (toJson $state.Values.gateway.pathType) "null") -}}
{{- $pathType = $state.Values.gateway.pathType -}}
{{- end -}}
{{- $path := (get (fromJson (include (first $state.Template) (dict "a" (concat (rest $state.Template) (list $state.Values.gateway.path))))) "r") -}}
{{- $port := (($state.Values.service.port | int) | int) -}}
{{- $_is_returning = true -}}
{{- (dict "r" (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict) "status" (dict "parents" (coalesce nil))) (mustMergeOverwrite (dict) (dict "kind" "HTTPRoute" "apiVersion" "gateway.networking.k8s.io/v1")) (dict "metadata" (mustMergeOverwrite (dict) (dict "name" (get (fromJson (include "console.RenderState.FullName" (dict "a" (list $state)))) "r") "labels" (get (fromJson (include "console.RenderState.Labels" (dict "a" (list $state (coalesce nil))))) "r") "namespace" $state.Namespace "annotations" $state.Values.gateway.annotations)) "spec" (mustMergeOverwrite (dict) (mustMergeOverwrite (dict) (dict "parentRefs" $parentRefs)) (dict "hostnames" $hostnames "rules" (list (mustMergeOverwrite (dict) (dict "matches" (list (mustMergeOverwrite (dict) (dict "path" (mustMergeOverwrite (dict) (dict "type" $pathType "value" $path))))) "backendRefs" (list (mustMergeOverwrite (dict "name" "") (mustMergeOverwrite (dict "name" "") (mustMergeOverwrite (dict "name" "") (dict "name" (toString (get (fromJson (include "console.RenderState.FullName" (dict "a" (list $state)))) "r")) "port" $port)) (dict)) (dict))))))))))) | toJson -}}
{{- break -}}
{{- end -}}
{{- end -}}

4 changes: 2 additions & 2 deletions charts/console/chart/templates/_console.render.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
{{- $state := (index .a 0) -}}
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $manifests := (list (get (fromJson (include "console.ServiceAccount" (dict "a" (list $state)))) "r") (get (fromJson (include "console.Secret" (dict "a" (list $state)))) "r") (get (fromJson (include "console.ConfigMap" (dict "a" (list $state)))) "r") (get (fromJson (include "console.Service" (dict "a" (list $state)))) "r") (get (fromJson (include "console.Ingress" (dict "a" (list $state)))) "r") (get (fromJson (include "console.Deployment" (dict "a" (list $state)))) "r") (get (fromJson (include "console.HorizontalPodAutoscaler" (dict "a" (list $state)))) "r") (get (fromJson (include "console.ServiceMonitor" (dict "a" (list $state)))) "r")) -}}
{{- $manifests := (list (get (fromJson (include "console.ServiceAccount" (dict "a" (list $state)))) "r") (get (fromJson (include "console.Secret" (dict "a" (list $state)))) "r") (get (fromJson (include "console.ConfigMap" (dict "a" (list $state)))) "r") (get (fromJson (include "console.Service" (dict "a" (list $state)))) "r") (get (fromJson (include "console.Ingress" (dict "a" (list $state)))) "r") (get (fromJson (include "console.HTTPRoute" (dict "a" (list $state)))) "r") (get (fromJson (include "console.Deployment" (dict "a" (list $state)))) "r") (get (fromJson (include "console.HorizontalPodAutoscaler" (dict "a" (list $state)))) "r") (get (fromJson (include "console.ServiceMonitor" (dict "a" (list $state)))) "r")) -}}
{{- $_is_returning = true -}}
{{- (dict "r" $manifests) | toJson -}}
{{- break -}}
Expand All @@ -91,7 +91,7 @@
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $_is_returning = true -}}
{{- (dict "r" (list (mustMergeOverwrite (dict "metadata" (dict)) (dict)) (mustMergeOverwrite (dict "metadata" (dict)) (dict)) (mustMergeOverwrite (dict "metadata" (dict)) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict) "status" (dict "loadBalancer" (dict))) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict) "status" (dict "loadBalancer" (dict))) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict "selector" (coalesce nil) "template" (dict "metadata" (dict) "spec" (dict "containers" (coalesce nil))) "strategy" (dict)) "status" (dict)) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict "scaleTargetRef" (dict "kind" "" "name" "") "maxReplicas" 0) "status" (dict "desiredReplicas" 0 "currentMetrics" (coalesce nil))) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict "endpoints" (coalesce nil) "selector" (dict) "namespaceSelector" (dict))) (dict)))) | toJson -}}
{{- (dict "r" (list (mustMergeOverwrite (dict "metadata" (dict)) (dict)) (mustMergeOverwrite (dict "metadata" (dict)) (dict)) (mustMergeOverwrite (dict "metadata" (dict)) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict) "status" (dict "loadBalancer" (dict))) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict) "status" (dict "loadBalancer" (dict))) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict) "status" (dict "parents" (coalesce nil))) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict "selector" (coalesce nil) "template" (dict "metadata" (dict) "spec" (dict "containers" (coalesce nil))) "strategy" (dict)) "status" (dict)) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict "scaleTargetRef" (dict "kind" "" "name" "") "maxReplicas" 0) "status" (dict "desiredReplicas" 0 "currentMetrics" (coalesce nil))) (dict)) (mustMergeOverwrite (dict "metadata" (dict) "spec" (dict "endpoints" (coalesce nil) "selector" (dict) "namespaceSelector" (dict))) (dict)))) | toJson -}}
{{- break -}}
{{- end -}}
{{- end -}}
Expand Down
Loading
Loading