Skip to content

Commit 9569ee8

Browse files
committed
init files for template
1 parent ca60831 commit 9569ee8

12 files changed

Lines changed: 600 additions & 0 deletions

redpanda/versions/1.0.0/Chart.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v2
2+
name: redpanda
3+
description: Kafka-compatible event streaming platform with built-in Schema Registry and no ZooKeeper.
4+
type: application
5+
version: 1.0.0
6+
appVersion: "26.1"
7+
8+
dependencies:
9+
- name: cpln-common
10+
version: 1.0.0
11+
repository: "oci://ghcr.io/controlplane-com/templates"
12+
13+
annotations:
14+
created: "2026-06-04"
15+
lastModified: "2026-06-04"
16+
category: "event-streaming"
17+
createsGvc: false
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{{/*
2+
Release name
3+
*/}}
4+
{{- define "redpanda.name" -}}
5+
{{- printf "%s" .Release.Name -}}
6+
{{- end }}
7+
8+
{{/*
9+
Broker cluster workload name
10+
*/}}
11+
{{- define "redpanda.clusterName" -}}
12+
{{- printf "%s-%s" (include "redpanda.name" .) .Values.redpanda.name -}}
13+
{{- end }}
14+
15+
{{/*
16+
Console workload name
17+
*/}}
18+
{{- define "redpanda.consoleName" -}}
19+
{{- printf "%s-%s" (include "redpanda.name" .) .Values.redpanda_console.name -}}
20+
{{- end }}
21+
22+
{{/*
23+
Default replication factor: min(3, replicas). Redpanda rejects a replication factor greater
24+
than the number of brokers, so we clamp to the cluster size.
25+
*/}}
26+
{{- define "redpanda.defaultReplicationFactor" -}}
27+
{{- $replicas := .Values.redpanda.replicas | int -}}
28+
{{- if lt $replicas 3 -}}{{ $replicas }}{{- else -}}3{{- end -}}
29+
{{- end }}
30+
31+
{{/*
32+
Validate replica count — Raft consensus requires an odd number for quorum.
33+
*/}}
34+
{{- define "redpanda.validateReplicas" -}}
35+
{{- $replicas := .Values.redpanda.replicas | int -}}
36+
{{- if or (eq $replicas 2) (eq $replicas 4) (gt $replicas 5) -}}
37+
{{- fail "redpanda.replicas must be 1, 3, or 5 — Raft consensus requires an odd number for quorum." -}}
38+
{{- end -}}
39+
{{- end }}
40+
41+
{{/*
42+
Common labels
43+
*/}}
44+
{{- define "redpanda.tags" -}}
45+
{{- include "cpln-common.tags" . }}
46+
{{- end }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- if .Values.redpanda.listeners.kafka.external }}
2+
kind: domain
3+
name: {{ .Values.redpanda.listeners.kafka.external.directReplicaRouting.publicAddress }}
4+
description: {{ .Values.redpanda.listeners.kafka.external.directReplicaRouting.publicAddress }}
5+
spec:
6+
acceptAllHosts: false
7+
acceptAllSubdomains: false
8+
certChallengeType: dns01
9+
dnsMode: cname
10+
ports:
11+
- number: {{ .Values.redpanda.listeners.kafka.external.directReplicaRouting.containerPort }}
12+
protocol: tcp
13+
routes:
14+
- port: {{ .Values.redpanda.listeners.kafka.external.directReplicaRouting.containerPort }}
15+
prefix: /
16+
workloadLink: //gvc/{{ .Values.global.cpln.gvc }}/workload/{{ include "redpanda.clusterName" . }}
17+
tls:
18+
cipherSuites:
19+
- ECDHE-ECDSA-AES256-GCM-SHA384
20+
- ECDHE-ECDSA-CHACHA20-POLY1305
21+
- ECDHE-ECDSA-AES128-GCM-SHA256
22+
- ECDHE-RSA-AES256-GCM-SHA384
23+
- ECDHE-RSA-CHACHA20-POLY1305
24+
- ECDHE-RSA-AES128-GCM-SHA256
25+
- AES256-GCM-SHA384
26+
- AES128-GCM-SHA256
27+
minProtocolVersion: TLSV1_2
28+
workloadLink: //gvc/{{ .Values.global.cpln.gvc }}/workload/{{ include "redpanda.clusterName" . }}
29+
{{- end }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
kind: identity
2+
name: {{ include "redpanda.name" . }}
3+
description: {{ include "redpanda.clusterName" . }} identity
4+
gvc: {{ .Values.global.cpln.gvc }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
kind: policy
2+
name: {{ include "redpanda.name" . }}
3+
origin: default
4+
bindings:
5+
- permissions:
6+
- reveal
7+
principalLinks:
8+
- //gvc/{{ .Values.global.cpln.gvc }}/identity/{{ include "redpanda.name" . }}
9+
targetKind: secret
10+
targetLinks:
11+
- //secret/{{ include "redpanda.name" . }}-init
12+
- //secret/{{ include "redpanda.name" . }}-secrets
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if .Values.redpanda_console.enabled }}
2+
{{- $adminUser := index .Values.redpanda.auth.users 0 }}
3+
kind: secret
4+
name: {{ include "redpanda.name" . }}-console-config
5+
type: opaque
6+
data:
7+
encoding: plain
8+
payload: |
9+
kafka:
10+
brokers:
11+
- {{ include "redpanda.clusterName" . }}:{{ .Values.redpanda.listeners.kafka.internal.port }}
12+
sasl:
13+
enabled: true
14+
mechanism: {{ .Values.redpanda.auth.saslMechanism }}
15+
username: {{ $adminUser.username }}
16+
password: $(REDPANDA_CONSOLE_PASSWORD)
17+
redpanda:
18+
adminApi:
19+
enabled: true
20+
urls:
21+
- http://{{ include "redpanda.clusterName" . }}:{{ .Values.redpanda.listeners.adminApi.port }}
22+
schemaRegistry:
23+
enabled: true
24+
urls:
25+
- http://{{ include "redpanda.clusterName" . }}:{{ .Values.redpanda.listeners.schemaRegistry.port }}
26+
authentication:
27+
method: http_basic
28+
username: {{ $adminUser.username }}
29+
password: $(REDPANDA_CONSOLE_PASSWORD)
30+
{{- end }}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
kind: secret
2+
name: {{ include "redpanda.name" . }}-init
3+
type: opaque
4+
data:
5+
encoding: plain
6+
payload: |
7+
#!/bin/bash
8+
set -euo pipefail
9+
10+
# Derive pod identity from hostname (e.g. myapp-cluster-2 -> ordinal=2, cluster=myapp-cluster)
11+
ORDINAL=$(echo "$HOSTNAME" | awk -F'-' '{print $NF}')
12+
CLUSTER_NAME=$(echo "$HOSTNAME" | sed 's/-[0-9]*$//')
13+
NODE_FQDN="${HOSTNAME}.${CLUSTER_NAME}"
14+
15+
# Build seed_servers so every broker knows the full cluster topology on first boot
16+
SEED_SERVERS=""
17+
for i in $(seq 0 $(( {{ .Values.redpanda.replicas }} - 1 ))); do
18+
SEED_SERVERS="${SEED_SERVERS} - host:
19+
address: ${CLUSTER_NAME}-${i}.${CLUSTER_NAME}
20+
port: 33145
21+
"
22+
done
23+
24+
cat > /etc/redpanda/redpanda.yaml << REDPANDA_CFG
25+
redpanda:
26+
data_directory: /var/lib/redpanda/data
27+
node_id: ${ORDINAL}
28+
enable_sasl: true
29+
superusers:
30+
- {{ (index .Values.redpanda.auth.users 0).username }}
31+
{{- range .Values.redpanda.auth.superusers }}
32+
- {{ . }}
33+
{{- end }}
34+
seed_servers:
35+
${SEED_SERVERS}
36+
rpc_api:
37+
address: 0.0.0.0
38+
port: 33145
39+
advertised_rpc_api:
40+
address: ${NODE_FQDN}
41+
port: 33145
42+
kafka_api:
43+
- address: 0.0.0.0
44+
port: {{ .Values.redpanda.listeners.kafka.internal.port }}
45+
name: internal
46+
authentication_method: sasl
47+
{{- if .Values.redpanda.listeners.kafka.external }}
48+
- address: 0.0.0.0
49+
port: {{ .Values.redpanda.listeners.kafka.external.directReplicaRouting.containerPort }}
50+
name: external
51+
authentication_method: sasl
52+
{{- end }}
53+
advertised_kafka_api:
54+
- address: ${NODE_FQDN}
55+
port: {{ .Values.redpanda.listeners.kafka.internal.port }}
56+
name: internal
57+
{{- if .Values.redpanda.listeners.kafka.external }}
58+
- address: ${ORDINAL}.{{ .Values.redpanda.listeners.kafka.external.directReplicaRouting.publicAddress }}
59+
port: {{ .Values.redpanda.listeners.kafka.external.directReplicaRouting.containerPort }}
60+
name: external
61+
{{- end }}
62+
admin_api:
63+
- address: 0.0.0.0
64+
port: {{ .Values.redpanda.listeners.adminApi.port }}
65+
default_topic_replications: {{ include "redpanda.defaultReplicationFactor" . }}
66+
transaction_coordinator_replication: {{ include "redpanda.defaultReplicationFactor" . }}
67+
id_allocator_replication: {{ include "redpanda.defaultReplicationFactor" . }}
68+
kafka_api_allow_everyone_if_no_acl_is_set_on_client_request: {{ .Values.redpanda.acl.allowEveryoneIfNoAclFound }}
69+
{{- if .Values.redpanda.secrets.cluster_id }}
70+
cluster_id: {{ .Values.redpanda.secrets.cluster_id | quote }}
71+
{{- end }}
72+
{{- range $key, $value := .Values.redpanda.extra_configurations }}
73+
{{ $key }}: {{ $value }}
74+
{{- end }}
75+
76+
schema_registry:
77+
schema_registry_api:
78+
- address: 0.0.0.0
79+
port: {{ .Values.redpanda.listeners.schemaRegistry.port }}
80+
authentication_method: http_basic
81+
{{- if .Values.redpanda.listeners.pandaproxy.enabled }}
82+
83+
pandaproxy:
84+
pandaproxy_api:
85+
- address: 0.0.0.0
86+
port: {{ .Values.redpanda.listeners.pandaproxy.port }}
87+
authentication_method: http_basic
88+
{{- end }}
89+
REDPANDA_CFG
90+
91+
exec redpanda start --config /etc/redpanda/redpanda.yaml
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
kind: secret
2+
name: {{ include "redpanda.name" . }}-secrets
3+
type: dictionary
4+
data:
5+
{{- range .Values.redpanda.auth.users }}
6+
{{ .username }}-password: {{ .password }}
7+
{{- end }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
kind: volumeset
2+
name: {{ include "redpanda.name" . }}-data
3+
description: {{ include "redpanda.clusterName" . }} data
4+
gvc: {{ .Values.global.cpln.gvc }}
5+
spec:
6+
initialCapacity: {{ .Values.redpanda.volume.initialCapacity }}
7+
performanceClass: {{ .Values.redpanda.volume.performanceClass }}
8+
fileSystemType: {{ .Values.redpanda.volume.fileSystemType }}
9+
{{- if and .Values.redpanda.volume.customEncryption .Values.redpanda.volume.customEncryption.enabled }}
10+
customEncryption:
11+
regions:
12+
{{ .Values.redpanda.volume.customEncryption.region }}:
13+
keyId: '{{ .Values.redpanda.volume.customEncryption.keyId }}'
14+
{{- end }}

0 commit comments

Comments
 (0)