Skip to content
Open
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
93 changes: 51 additions & 42 deletions charts/redpanda/chart/templates/_configmap.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,20 @@
{{- $pool := (index .a 1) -}}
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $_36_bootstrap_fixups := (get (fromJson (include "redpanda.BootstrapFile" (dict "a" (list $state $pool)))) "r") -}}
{{- $bootstrap := (index $_36_bootstrap_fixups 0) -}}
{{- $fixups := (index $_36_bootstrap_fixups 1) -}}
{{- $_36_bootstrap_bootstrapFixups := (get (fromJson (include "redpanda.BootstrapFile" (dict "a" (list $state $pool)))) "r") -}}
{{- $bootstrap := (index $_36_bootstrap_bootstrapFixups 0) -}}
{{- $bootstrapFixups := (index $_36_bootstrap_bootstrapFixups 1) -}}
{{- $redpandaYamlFixups := (list) -}}
{{- if (and (and (get (fromJson (include "redpanda.Auth.IsSASLEnabled" (dict "a" (list $state.Values.auth)))) "r") (ne (toJson $state.Values.config.schema_registry_client) "null")) (ne (toJson $state.Values.config.schema_registry_client.saslSecretRef) "null")) -}}
{{- $redpandaYamlFixups = (concat (default (list) $redpandaYamlFixups) (default (list) (get (fromJson (include "redpanda.SASLFixups" (dict "a" (list "schema_registry_client" $state.Values.config.schema_registry_client.saslSecretRef.name)))) "r"))) -}}
{{- end -}}
{{- $redpandaYamlFixupsStr := (toJson $redpandaYamlFixups) -}}
{{- if (eq ((get (fromJson (include "_shims.len" (dict "a" (list $redpandaYamlFixups)))) "r") | int) (0 | int)) -}}
{{- $redpandaYamlFixupsStr = `[]` -}}
{{- end -}}
{{- $data := (dict ".bootstrap.json.in" $bootstrap "bootstrap.yaml.fixups" $bootstrapFixups "redpanda.yaml" (get (fromJson (include "redpanda.RedpandaConfigFile" (dict "a" (list $state true $pool)))) "r") "redpanda.yaml.fixups" $redpandaYamlFixupsStr) -}}
{{- $_is_returning = true -}}
{{- (dict "r" (mustMergeOverwrite (dict "metadata" (dict)) (mustMergeOverwrite (dict) (dict "kind" "ConfigMap" "apiVersion" "v1")) (dict "metadata" (mustMergeOverwrite (dict) (dict "name" (printf "%s%s" (get (fromJson (include "redpanda.Fullname" (dict "a" (list $state)))) "r") (get (fromJson (include "redpanda.Pool.Suffix" (dict "a" (list (deepCopy $pool))))) "r")) "namespace" $state.Release.Namespace "labels" (get (fromJson (include "redpanda.FullLabels" (dict "a" (list $state)))) "r"))) "data" (dict ".bootstrap.json.in" $bootstrap "bootstrap.yaml.fixups" $fixups "redpanda.yaml" (get (fromJson (include "redpanda.RedpandaConfigFile" (dict "a" (list $state true $pool)))) "r"))))) | toJson -}}
{{- (dict "r" (mustMergeOverwrite (dict "metadata" (dict)) (mustMergeOverwrite (dict) (dict "kind" "ConfigMap" "apiVersion" "v1")) (dict "metadata" (mustMergeOverwrite (dict) (dict "name" (printf "%s%s" (get (fromJson (include "redpanda.Fullname" (dict "a" (list $state)))) "r") (get (fromJson (include "redpanda.Pool.Suffix" (dict "a" (list (deepCopy $pool))))) "r")) "namespace" $state.Release.Namespace "labels" (get (fromJson (include "redpanda.FullLabels" (dict "a" (list $state)))) "r"))) "data" $data))) | toJson -}}
{{- break -}}
{{- end -}}
{{- end -}}
Expand All @@ -37,9 +46,9 @@
{{- $pool := (index .a 1) -}}
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $_67_template_fixups := (get (fromJson (include "redpanda.BootstrapContents" (dict "a" (list $state $pool)))) "r") -}}
{{- $template := (index $_67_template_fixups 0) -}}
{{- $fixups := (index $_67_template_fixups 1) -}}
{{- $_80_template_fixups := (get (fromJson (include "redpanda.BootstrapContents" (dict "a" (list $state $pool)))) "r") -}}
{{- $template := (index $_80_template_fixups 0) -}}
{{- $fixups := (index $_80_template_fixups 1) -}}
{{- $fixupStr := (toJson $fixups) -}}
{{- if (eq ((get (fromJson (include "_shims.len" (dict "a" (list $fixups)))) "r") | int) (0 | int)) -}}
{{- $fixupStr = `[]` -}}
Expand All @@ -62,20 +71,20 @@
{{- $bootstrap = (merge (dict) $bootstrap (get (fromJson (include "redpanda.TunableConfig.Translate" (dict "a" (list $state.Values.config.tunable)))) "r")) -}}
{{- $bootstrap = (merge (dict) $bootstrap (get (fromJson (include "redpanda.ClusterConfig.Translate" (dict "a" (list $state.Values.config.cluster)))) "r")) -}}
{{- $bootstrap = (merge (dict) $bootstrap (get (fromJson (include "redpanda.Auth.Translate" (dict "a" (list $state.Values.auth (get (fromJson (include "redpanda.Auth.IsSASLEnabled" (dict "a" (list $state.Values.auth)))) "r"))))) "r")) -}}
{{- $_91_attrs_fixes := (get (fromJson (include "redpanda.TieredStorageConfig.Translate" (dict "a" (list (deepCopy (get (fromJson (include "redpanda.Storage.GetTieredStorageConfig" (dict "a" (list $state.Values.storage)))) "r")) $state.Values.storage.tiered.credentialsSecretRef)))) "r") -}}
{{- $attrs := (index $_91_attrs_fixes 0) -}}
{{- $fixes := (index $_91_attrs_fixes 1) -}}
{{- $_104_attrs_fixes := (get (fromJson (include "redpanda.TieredStorageConfig.Translate" (dict "a" (list (deepCopy (get (fromJson (include "redpanda.Storage.GetTieredStorageConfig" (dict "a" (list $state.Values.storage)))) "r")) $state.Values.storage.tiered.credentialsSecretRef)))) "r") -}}
{{- $attrs := (index $_104_attrs_fixes 0) -}}
{{- $fixes := (index $_104_attrs_fixes 1) -}}
{{- $bootstrap = (merge (dict) $bootstrap $attrs) -}}
{{- $fixups = (concat (default (list) $fixups) (default (list) $fixes)) -}}
{{- $_101___ok_1 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $state.Values.config.cluster "default_topic_replications" (coalesce nil))))) "r") -}}
{{- $_ := (index $_101___ok_1 0) -}}
{{- $ok_1 := (index $_101___ok_1 1) -}}
{{- $_114___ok_1 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $state.Values.config.cluster "default_topic_replications" (coalesce nil))))) "r") -}}
{{- $_ := (index $_114___ok_1 0) -}}
{{- $ok_1 := (index $_114___ok_1 1) -}}
{{- if (and (not $ok_1) (ge ($pool.Statefulset.replicas | int) (3 | int))) -}}
{{- $_ := (set $bootstrap "default_topic_replications" (3 | int)) -}}
{{- end -}}
{{- $_106___ok_2 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $state.Values.config.cluster "storage_min_free_bytes" (coalesce nil))))) "r") -}}
{{- $_ := (index $_106___ok_2 0) -}}
{{- $ok_2 := (index $_106___ok_2 1) -}}
{{- $_119___ok_2 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $state.Values.config.cluster "storage_min_free_bytes" (coalesce nil))))) "r") -}}
{{- $_ := (index $_119___ok_2 0) -}}
{{- $ok_2 := (index $_119___ok_2 1) -}}
{{- if (not $ok_2) -}}
{{- $_ := (set $bootstrap "storage_min_free_bytes" ((get (fromJson (include "redpanda.Storage.StorageMinFreeBytes" (dict "a" (list $state.Values.storage)))) "r") | int64)) -}}
{{- end -}}
Expand All @@ -86,10 +95,10 @@
{{- if $_is_returning -}}
{{- break -}}
{{- end -}}
{{- $_117_extra_fixes__ := (get (fromJson (include "redpanda.ClusterConfiguration.Translate" (dict "a" (list (deepCopy $state.Values.config.extraClusterConfiguration))))) "r") -}}
{{- $extra := (index $_117_extra_fixes__ 0) -}}
{{- $fixes := (index $_117_extra_fixes__ 1) -}}
{{- $_ := (index $_117_extra_fixes__ 2) -}}
{{- $_130_extra_fixes__ := (get (fromJson (include "redpanda.ClusterConfiguration.Translate" (dict "a" (list (deepCopy $state.Values.config.extraClusterConfiguration))))) "r") -}}
{{- $extra := (index $_130_extra_fixes__ 0) -}}
{{- $fixes := (index $_130_extra_fixes__ 1) -}}
{{- $_ := (index $_130_extra_fixes__ 2) -}}
{{- $template = (merge (dict) $template $extra) -}}
{{- $fixups = (concat (default (list) $fixups) (default (list) $fixes)) -}}
{{- $_is_returning = true -}}
Expand Down Expand Up @@ -173,23 +182,23 @@
{{- break -}}
{{- end -}}
{{- $kafkaTLS := (get (fromJson (include "redpanda.rpkKafkaClientTLSConfiguration" (dict "a" (list $state)))) "r") -}}
{{- $_206___ok_3 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $kafkaTLS "ca_file" (coalesce nil))))) "r") -}}
{{- $_ := (index $_206___ok_3 0) -}}
{{- $ok_3 := (index $_206___ok_3 1) -}}
{{- $_219___ok_3 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $kafkaTLS "ca_file" (coalesce nil))))) "r") -}}
{{- $_ := (index $_219___ok_3 0) -}}
{{- $ok_3 := (index $_219___ok_3 1) -}}
{{- if $ok_3 -}}
{{- $_ := (set $kafkaTLS "ca_file" "ca.crt") -}}
{{- end -}}
{{- $adminTLS := (get (fromJson (include "redpanda.rpkAdminAPIClientTLSConfiguration" (dict "a" (list $state)))) "r") -}}
{{- $_212___ok_4 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $adminTLS "ca_file" (coalesce nil))))) "r") -}}
{{- $_ := (index $_212___ok_4 0) -}}
{{- $ok_4 := (index $_212___ok_4 1) -}}
{{- $_225___ok_4 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $adminTLS "ca_file" (coalesce nil))))) "r") -}}
{{- $_ := (index $_225___ok_4 0) -}}
{{- $ok_4 := (index $_225___ok_4 1) -}}
{{- if $ok_4 -}}
{{- $_ := (set $adminTLS "ca_file" "ca.crt") -}}
{{- end -}}
{{- $schemaTLS := (get (fromJson (include "redpanda.rpkSchemaRegistryClientTLSConfiguration" (dict "a" (list $state)))) "r") -}}
{{- $_218___ok_5 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $schemaTLS "ca_file" (coalesce nil))))) "r") -}}
{{- $_ := (index $_218___ok_5 0) -}}
{{- $ok_5 := (index $_218___ok_5 1) -}}
{{- $_231___ok_5 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $schemaTLS "ca_file" (coalesce nil))))) "r") -}}
{{- $_ := (index $_231___ok_5 0) -}}
{{- $ok_5 := (index $_231___ok_5 1) -}}
{{- if $ok_5 -}}
{{- $_ := (set $schemaTLS "ca_file" "ca.crt") -}}
{{- end -}}
Expand Down Expand Up @@ -387,10 +396,10 @@
{{- if (gt ((get (fromJson (include "_shims.len" (dict "a" (list $tls_8)))) "r") | int) (0 | int)) -}}
{{- $schemaRegistryTLS = $tls_8 -}}
{{- end -}}
{{- $_405_lockMemory_overprovisioned_flags := (get (fromJson (include "redpanda.RedpandaAdditionalStartFlags" (dict "a" (list $state.Values $pool)))) "r") -}}
{{- $lockMemory := (index $_405_lockMemory_overprovisioned_flags 0) -}}
{{- $overprovisioned := (index $_405_lockMemory_overprovisioned_flags 1) -}}
{{- $flags := (index $_405_lockMemory_overprovisioned_flags 2) -}}
{{- $_418_lockMemory_overprovisioned_flags := (get (fromJson (include "redpanda.RedpandaAdditionalStartFlags" (dict "a" (list $state.Values $pool)))) "r") -}}
{{- $lockMemory := (index $_418_lockMemory_overprovisioned_flags 0) -}}
{{- $overprovisioned := (index $_418_lockMemory_overprovisioned_flags 1) -}}
{{- $flags := (index $_418_lockMemory_overprovisioned_flags 2) -}}
{{- $result := (dict "additional_start_flags" $flags "enable_memory_locking" $lockMemory "overprovisioned" $overprovisioned "kafka_api" (dict "brokers" $brokerList "tls" $brokerTLS) "admin_api" (dict "addresses" (get (fromJson (include "redpanda.BrokerList" (dict "a" (list $state ($state.Values.listeners.admin.port | int))))) "r") "tls" $adminTLS) "schema_registry" (dict "addresses" (get (fromJson (include "redpanda.BrokerList" (dict "a" (list $state ($state.Values.listeners.schemaRegistry.port | int))))) "r") "tls" $schemaRegistryTLS)) -}}
{{- $result = (merge (dict) $result (get (fromJson (include "redpanda.Tuning.Translate" (dict "a" (list $state.Values.tuning)))) "r")) -}}
{{- $result = (merge (dict) $result (get (fromJson (include "redpanda.Config.CreateRPKConfiguration" (dict "a" (list $state.Values.config)))) "r")) -}}
Expand Down Expand Up @@ -471,9 +480,9 @@
{{- $brokerList := (list) -}}
{{- $useLocalhostKey := (printf "%s_client.use_localhost" $clientType) -}}
{{- $useLocalhost := false -}}
{{- $_506_val_ok := (get (fromJson (include "_shims.dicttest" (dict "a" (list $state.Values.config.node $useLocalhostKey (coalesce nil))))) "r") -}}
{{- $val := (index $_506_val_ok 0) -}}
{{- $ok := (index $_506_val_ok 1) -}}
{{- $_519_val_ok := (get (fromJson (include "_shims.dicttest" (dict "a" (list $state.Values.config.node $useLocalhostKey (coalesce nil))))) "r") -}}
{{- $val := (index $_519_val_ok 0) -}}
{{- $ok := (index $_519_val_ok 1) -}}
{{- if $ok -}}
{{- if (kindIs "bool" $val) -}}
{{- $useLocalhost = (eq $val true) -}}
Expand Down Expand Up @@ -642,17 +651,17 @@
{{- end -}}
{{- $enabledOptions := (dict "true" true "1" true "" true) -}}
{{- $lockMemory := false -}}
{{- $_692_value_14_ok_15 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $flags "--lock-memory" "")))) "r") -}}
{{- $value_14 := (index $_692_value_14_ok_15 0) -}}
{{- $ok_15 := (index $_692_value_14_ok_15 1) -}}
{{- $_705_value_14_ok_15 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $flags "--lock-memory" "")))) "r") -}}
{{- $value_14 := (index $_705_value_14_ok_15 0) -}}
{{- $ok_15 := (index $_705_value_14_ok_15 1) -}}
{{- if $ok_15 -}}
{{- $lockMemory = (ternary (index $enabledOptions $value_14) false (hasKey $enabledOptions $value_14)) -}}
{{- $_ := (unset $flags "--lock-memory") -}}
{{- end -}}
{{- $overprovisioned := false -}}
{{- $_699_value_16_ok_17 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $flags "--overprovisioned" "")))) "r") -}}
{{- $value_16 := (index $_699_value_16_ok_17 0) -}}
{{- $ok_17 := (index $_699_value_16_ok_17 1) -}}
{{- $_712_value_16_ok_17 := (get (fromJson (include "_shims.dicttest" (dict "a" (list $flags "--overprovisioned" "")))) "r") -}}
{{- $value_16 := (index $_712_value_16_ok_17 0) -}}
{{- $ok_17 := (index $_712_value_16_ok_17 1) -}}
{{- if $ok_17 -}}
{{- $overprovisioned = (ternary (index $enabledOptions $value_16) false (hasKey $enabledOptions $value_16)) -}}
{{- $_ := (unset $flags "--overprovisioned") -}}
Expand Down
7 changes: 6 additions & 1 deletion charts/redpanda/chart/templates/_statefulset.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,13 @@
{{- if $state.Values.rackAwareness.enabled -}}
{{- $volMounts = (concat (default (list) $volMounts) (list (mustMergeOverwrite (dict "name" "" "mountPath" "") (dict "name" "kube-api-access" "mountPath" "/var/run/secrets/kubernetes.io/serviceaccount" "readOnly" true)))) -}}
{{- end -}}
{{- $baseEnv := (list (mustMergeOverwrite (dict "name" "") (dict "name" "CONFIGURATOR_SCRIPT" "value" "/etc/secrets/configurator/scripts/configurator.sh")) (mustMergeOverwrite (dict "name" "") (dict "name" "SERVICE_NAME" "valueFrom" (mustMergeOverwrite (dict) (dict "fieldRef" (mustMergeOverwrite (dict "fieldPath" "") (dict "fieldPath" "metadata.name")) "resourceFieldRef" (coalesce nil) "configMapKeyRef" (coalesce nil) "secretKeyRef" (coalesce nil))))) (mustMergeOverwrite (dict "name" "") (dict "name" "KUBERNETES_NODE_NAME" "valueFrom" (mustMergeOverwrite (dict) (dict "fieldRef" (mustMergeOverwrite (dict "fieldPath" "") (dict "fieldPath" "spec.nodeName")))))) (mustMergeOverwrite (dict "name" "") (dict "name" "HOST_IP_ADDRESS" "valueFrom" (mustMergeOverwrite (dict) (dict "fieldRef" (mustMergeOverwrite (dict "fieldPath" "") (dict "apiVersion" "v1" "fieldPath" "status.hostIP"))))))) -}}
{{- if (and (and (get (fromJson (include "redpanda.Auth.IsSASLEnabled" (dict "a" (list $state.Values.auth)))) "r") (ne (toJson $state.Values.config.schema_registry_client) "null")) (ne (toJson $state.Values.config.schema_registry_client.saslSecretRef) "null")) -}}
{{- $envVars := (get (fromJson (include "redpanda.SASLEnvVars" (dict "a" (list "schema_registry_client" $state.Values.config.schema_registry_client.saslSecretRef.name)))) "r") -}}
{{- $baseEnv = (concat (default (list) $baseEnv) (default (list) $envVars)) -}}
{{- end -}}
{{- $_is_returning = true -}}
{{- (dict "r" (mustMergeOverwrite (dict "name" "" "resources" (dict)) (dict "name" "redpanda-configurator" "image" (printf `%s:%s` $state.Values.image.repository (get (fromJson (include "redpanda.Tag" (dict "a" (list $state)))) "r")) "command" (list `/bin/bash` `-c` `trap "exit 0" TERM; exec $CONFIGURATOR_SCRIPT "${SERVICE_NAME}" "${KUBERNETES_NODE_NAME}" & wait $!`) "env" (get (fromJson (include "redpanda.rpkEnvVars" (dict "a" (list $state (list (mustMergeOverwrite (dict "name" "") (dict "name" "CONFIGURATOR_SCRIPT" "value" "/etc/secrets/configurator/scripts/configurator.sh")) (mustMergeOverwrite (dict "name" "") (dict "name" "SERVICE_NAME" "valueFrom" (mustMergeOverwrite (dict) (dict "fieldRef" (mustMergeOverwrite (dict "fieldPath" "") (dict "fieldPath" "metadata.name")) "resourceFieldRef" (coalesce nil) "configMapKeyRef" (coalesce nil) "secretKeyRef" (coalesce nil))))) (mustMergeOverwrite (dict "name" "") (dict "name" "KUBERNETES_NODE_NAME" "valueFrom" (mustMergeOverwrite (dict) (dict "fieldRef" (mustMergeOverwrite (dict "fieldPath" "") (dict "fieldPath" "spec.nodeName")))))) (mustMergeOverwrite (dict "name" "") (dict "name" "HOST_IP_ADDRESS" "valueFrom" (mustMergeOverwrite (dict) (dict "fieldRef" (mustMergeOverwrite (dict "fieldPath" "") (dict "apiVersion" "v1" "fieldPath" "status.hostIP"))))))))))) "r") "volumeMounts" $volMounts "securityContext" (mustMergeOverwrite (dict) (dict "runAsNonRoot" true "allowPrivilegeEscalation" false))))) | toJson -}}
{{- (dict "r" (mustMergeOverwrite (dict "name" "" "resources" (dict)) (dict "name" "redpanda-configurator" "image" (printf `%s:%s` $state.Values.image.repository (get (fromJson (include "redpanda.Tag" (dict "a" (list $state)))) "r")) "command" (list `/bin/bash` `-c` `trap "exit 0" TERM; exec $CONFIGURATOR_SCRIPT "${SERVICE_NAME}" "${KUBERNETES_NODE_NAME}" & wait $!`) "env" (get (fromJson (include "redpanda.rpkEnvVars" (dict "a" (list $state $baseEnv)))) "r") "volumeMounts" $volMounts "securityContext" (mustMergeOverwrite (dict) (dict "runAsNonRoot" true "allowPrivilegeEscalation" false))))) | toJson -}}
{{- break -}}
{{- end -}}
{{- end -}}
Expand Down
Loading