forked from redpanda-data/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redpanda: add console as subchart to redpanda
- Loading branch information
Showing
10 changed files
with
215 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
*/**/*.tfstate* | ||
ansible/playbooks/grafana_dashboards/redpanda-grafana.json | ||
.idea/ | ||
|
||
charts/*/charts/*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: console | ||
repository: https://charts.redpanda.com | ||
version: 0.5.0 | ||
digest: sha256:7fd70de57651b2f1857f3eb519c427dbbcad8fc6ea656925651bb0c10839b035 | ||
generated: "2023-02-09T08:51:15.13722333-08:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{ $values := .Values }} | ||
|
||
{{/* if the console chart has the creation of the configmap disabled, create it here instead */}} | ||
{{ if not .Values.console.configmap.create }} | ||
{{ $consoleConfigmap := dict "create" true }} | ||
|
||
{{/* kafka section */}} | ||
|
||
{{/* brokers */}} | ||
{{ $kafkaBrokers := list }} | ||
{{ range (include "seed-server-list" . | mustFromJson) }} | ||
{{ $kafkaBrokers = append $kafkaBrokers (printf "%s:%d" . (int $values.listeners.kafka.port)) }} | ||
{{ end }} | ||
|
||
{{/* sasl */}} | ||
{{/* the rest of sasl is configured through the secret */}} | ||
{{ $kafkaSASL := dict "enabled" (include "sasl-enabled" . | fromJson).bool }} | ||
|
||
{{/* tls */}} | ||
{{/* the rest of tls is configured through the secret */}} | ||
{{ $kafkaTLS := dict "enabled" (include "kafka-internal-tls-enabled" . | fromJson).bool }} | ||
|
||
{{/* schemaRegistry */}} | ||
{{- $urls := list -}} | ||
{{ $proto := "http" }} | ||
{{ if (include "schemaRegistry-internal-tls-enabled" . | fromJson).bool }} | ||
{{ $proto = "https" }} | ||
{{ end }} | ||
{{ $port := int $values.listeners.schemaRegistry.port }} | ||
{{ range (include "seed-server-list" . | mustFromJson) }} | ||
{{ $urls = append $urls (printf "%s://%s:%d" $proto . $port) }} | ||
{{ end }} | ||
{{/* tls */}} | ||
{{/* the rest of tls is configured through the secret */}} | ||
{{ $schemaRegistryTLS := dict "enabled" (include "schemaRegistry-internal-tls-enabled" . | fromJson).bool }} | ||
|
||
{{ $kafkaSchemaRegistry := dict | ||
"enabled" .Values.listeners.schemaRegistry.enabled | ||
"urls" $urls | ||
"tls" $schemaRegistryTLS | ||
}} | ||
{{ $consoleConfigKafka := dict | ||
"brokers" $kafkaBrokers | ||
"sasl" $kafkaSASL | ||
"tls" $kafkaTLS | ||
"schemaRegistry" $kafkaSchemaRegistry | ||
}} | ||
{{ $consoleConfig := dict "kafka" $consoleConfigKafka }} | ||
{{ $config := dict | ||
"Values" (dict | ||
"console" (dict "config" $consoleConfig) | ||
"configmap" $consoleConfigmap | ||
) | ||
}} | ||
|
||
{{ $console := deepCopy .Subcharts.console }} | ||
{{ $console := merge $config $console }} | ||
|
||
{{ include (print .Subcharts.console.Template.BasePath "/configmap.yaml") $console }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
{{ if (not .Values.console.deployment.create) }} | ||
|
||
{{ $extraVolumes := list }} | ||
{{ $extraVolumeMounts := list }} | ||
{{ $command := list }} | ||
{{ if (include "sasl-enabled" . | fromJson).bool }} | ||
{{ $command = concat $command (list "sh" "-xc") }} | ||
{{ $command = append $command (printf "set -e; IFS=: read -r KAFKA_SASL_USERNAME KAFKA_SASL_PASSWORD KAFKA_SASL_MECHANISM < /mnt/users/users.txt; KAFKA_SASL_MECHANISM=${KAFKA_SASL_MECHANISM:-%s}; export KAFKA_SASL_USERNAME KAFKA_SASL_PASSWORD KAFKA_SASL_MECHANISM; /app/console $@" ( include "sasl-mechanism" . )) }} | ||
{{ $command = append $command "--" }} | ||
{{ $extraVolumes = append $extraVolumes (dict | ||
"name" (printf "%s-users" (include "redpanda.fullname" .)) | ||
"secret" (dict | ||
"secretName" .Values.auth.sasl.secretRef | ||
) | ||
)}} | ||
{{ $extraVolumeMounts = append $extraVolumeMounts (dict | ||
"name" (printf "%s-users" (include "redpanda.fullname" .)) | ||
"mountPath" "/mnt/users" | ||
"readOnly" true | ||
) }} | ||
{{ end }} | ||
|
||
{{ $kafkaTLS := list }} | ||
{{ if (include "kafka-internal-tls-enabled" . | fromJson).bool }} | ||
{{ $service := .Values.listeners.kafka }} | ||
{{ $cert := get .Values.tls.certs $service.tls.cert }} | ||
{{ if $cert.caEnabled }} | ||
{{ $kafkaTLS = append $kafkaTLS (dict | ||
"name" "KAFKA_TLS_CAFILEPATH" | ||
"value" (printf "/mnt/cert/kafka/%s/ca.crt" $service.tls.cert) | ||
)}} | ||
{{ $extraVolumes = append $extraVolumes (dict | ||
"name" (printf "kafka-%s-cert" $service.tls.cert) | ||
"secret" (dict | ||
"defaultMode" 0420 | ||
"items" (list (dict "key" "ca.crt" "path" "ca.crt") ) | ||
"secretName" (printf "%s-%s-cert" (include "redpanda.fullname" .) $service.tls.cert) | ||
))}} | ||
{{ $extraVolumeMounts = append $extraVolumeMounts (dict | ||
"name" (printf "kafka-%s-cert" $service.tls.cert) | ||
"mountPath" (printf "/mnt/cert/kafka/%s" $service.tls.cert) | ||
"readOnly" true | ||
)}} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ $schemaRegistryTLS := list }} | ||
{{ if (include "schemaRegistry-internal-tls-enabled" . | fromJson).bool }} | ||
{{ $service := .Values.listeners.schemaRegistry }} | ||
{{ $cert := get .Values.tls.certs $service.tls.cert }} | ||
{{ if $cert.caEnabled }} | ||
{{ $schemaRegistryTLS = append $schemaRegistryTLS (dict | ||
"name" "KAFKA_SCHEMAREGISTRY_TLS_CAFILEPATH" | ||
"value" (printf "/mnt/cert/schemaregistry/%s/ca.crt" $service.tls.cert) | ||
)}} | ||
{{ $extraVolumes = append $extraVolumes (dict | ||
"name" (printf "schemaregistry-%s-cert" $service.tls.cert) | ||
"secret" (dict | ||
"defaultMode" 0420 | ||
"items" (list (dict "key" "ca.crt" "path" "ca.crt") ) | ||
"secretName" (printf "%s-%s-cert" (include "redpanda.fullname" .) $service.tls.cert) | ||
))}} | ||
{{ $extraVolumeMounts = append $extraVolumeMounts (dict | ||
"name" (printf "schemaregistry-%s-cert" $service.tls.cert) | ||
"mountPath" (printf "/mnt/cert/schemaregistry/%s" $service.tls.cert) | ||
"readOnly" true | ||
)}} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ $adminTLS := list }} | ||
{{ if (include "admin-internal-tls-enabled" . | fromJson).bool }} | ||
{{ $service := .Values.listeners.admin }} | ||
{{ $cert := get .Values.tls.certs $service.tls.cert }} | ||
{{ if $cert.caEnabled }} | ||
{{ $adminTLS = append $adminTLS (dict | ||
"name" "REDPANDA_ADMINAPI_TLS_CAFILEPATH" | ||
"value" (printf "/mnt/cert/adminapi/%s/ca.crt" $service.tls.cert) | ||
)}} | ||
{{ $extraVolumes = append $extraVolumes (dict | ||
"name" (printf "adminapi-%s-cert" $service.tls.cert) | ||
"secret" (dict | ||
"defaultMode" 0420 | ||
"items" (list (dict "key" "ca.crt" "path" "ca.crt") ) | ||
"secretName" (printf "%s-%s-cert" (include "redpanda.fullname" .) $service.tls.cert) | ||
))}} | ||
{{ $extraVolumeMounts = append $extraVolumeMounts (dict | ||
"name" (printf "adminapi-%s-cert" $service.tls.cert) | ||
"mountPath" (printf "/mnt/cert/adminapi/%s" $service.tls.cert) | ||
"readOnly" true | ||
)}} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ $extraEnv := concat $kafkaTLS $adminTLS $schemaRegistryTLS }} | ||
{{ $consoleValues := dict "Values" (dict | ||
"extraVolumes" $extraVolumes | ||
"extraVolumeMounts" $extraVolumeMounts | ||
"extraEnv" $extraEnv | ||
)}} | ||
{{ if not (empty $command) }} | ||
{{ $consoleValues := merge $consoleValues (dict "Values" (dict "deployment" (dict "command" $command))) }} | ||
{{ end }} | ||
{{ $consoleValues := merge $consoleValues (dict "Values" (dict "deployment" (dict "create" (not .Values.console.deployment.create)))) }} | ||
{{ $helmVars := deepCopy .Subcharts.console }} | ||
{{ $helmVars := merge $consoleValues $helmVars }} | ||
{{ include (print .Subcharts.console.Template.BasePath "/deployment.yaml") $helmVars }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,4 +120,4 @@ stringData: | |
{{- end }} | ||
{{- end }} | ||
# intentional empty line | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters