Skip to content

Commit

Permalink
Redpanda single replica from helm chart using Yolean/unhelm#3
Browse files Browse the repository at this point in the history
  • Loading branch information
solsson committed Jun 26, 2023
1 parent 7af963a commit baadd3b
Show file tree
Hide file tree
Showing 7 changed files with 479 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kafka/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# ./unhelm.sh output that we don't need
helm
redpanda/ystack/kustomization.yaml
redpanda/ystack/redpanda/templates/poddisruptionbudget.yaml
redpanda/ystack/redpanda/templates/tests
50 changes: 50 additions & 0 deletions kafka/redpanda.ystack.values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# yaml-language-server: $schema=https://github.com/redpanda-data/helm-charts/raw/redpanda-4.0.32/charts/redpanda/values.schema.json
# unhelm-template-repo: https://charts.redpanda.com
# unhelm-namespace: kafka

# this is an attempt to disable as much as possible from the chart, except the actual broker
statefulset:
replicas: 1
additionalRedpandaCmdFlags:
- --overprovisioned
sideCars:
configWatcher:
enabled: false
tls:
enabled: false
config:
cluster:
auto_create_topics_enabled: false
tunable: {}
node: {}
external:
enabled: false
rbac:
enabled: false
post_install_job:
enabled: false
post_upgrade_job:
enabled: false
console:
enabled: false
logging:
logLevel: info
usageStats:
enabled: false
tuning:
tune_aio_events: false
# See forwarded ports in ../k3s/ystack.yaml
# See also https://github.com/redpanda-data/helm-charts/issues/285
listeners:
kafka:
port: 9092
external:
default:
advertisedPorts:
- 31712
http:
port: 8082
external:
default:
advertisedPorts:
- 31713
92 changes: 92 additions & 0 deletions kafka/redpanda/ystack/redpanda/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
# Source: redpanda/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: redpanda
namespace: "kafka"
labels:
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-4.0.47
data:
bootstrap.yaml: |
kafka_enable_authorization: false
enable_sasl: false
auto_create_topics_enabled: false
compacted_log_segment_size: 67108864
group_topic_partitions: 16
kafka_batch_max_bytes: 1048576
kafka_connection_rate_limit: 1000
log_segment_size: 134217728
log_segment_size_max: 268435456
log_segment_size_min: 16777216
max_compacted_log_segment_size: 536870912
topic_partitions_per_shard: 1000
storage_min_free_bytes: 1073741824
redpanda.yaml: |
config_file: /etc/redpanda/redpanda.yaml
redpanda:
empty_seed_starts_cluster: false
kafka_enable_authorization: false
enable_sasl: false
auto_create_topics_enabled: false
compacted_log_segment_size: 67108864
group_topic_partitions: 16
kafka_batch_max_bytes: 1048576
kafka_connection_rate_limit: 1000
log_segment_size: 134217728
log_segment_size_max: 268435456
log_segment_size_min: 16777216
max_compacted_log_segment_size: 536870912
topic_partitions_per_shard: 1000
storage_min_free_bytes: 1073741824
admin:
- name: internal
address: 0.0.0.0
port: 9644
- name: default
address: 0.0.0.0
port: 9645
admin_api_tls:
kafka_api:
- name: internal
address: 0.0.0.0
port: 9092
- name: default
address: 0.0.0.0
port: 9094
kafka_api_tls:
rpc_server:
address: 0.0.0.0
port: 33145
seed_servers:
- host:
address: redpanda-0.redpanda.kafka.svc.cluster.local.
port: 33145
schema_registry:
schema_registry_api:
- name: internal
address: 0.0.0.0
port: 8081
- name: default
address: 0.0.0.0
port: 8084
schema_registry_api_tls:
pandaproxy:
pandaproxy_api:
- name: internal
address: 0.0.0.0
port: 8082
- name: default
address: 0.0.0.0
port: 8083
pandaproxy_api_tls:
rpk:
enable_usage_stats: false
overprovisioned: false
enable_memory_locking: false
tune_aio_events: false
45 changes: 45 additions & 0 deletions kafka/redpanda/ystack/redpanda/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
# Source: redpanda/templates/secrets.yaml
apiVersion: v1
kind: Secret
metadata:
name: redpanda-sts-lifecycle
namespace: "kafka"
labels:
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-4.0.47
type: Opaque
stringData:
common.sh: |-
#!/usr/bin/env bash
# the SERVICE_NAME comes from the metadata.name of the pod, essentially the POD_NAME
CURL_URL="http://${SERVICE_NAME}.redpanda.kafka.svc.cluster.local:9644"
# commands used throughout
CURL_NODE_ID_CMD="curl --silent --fail ${CURL_URL}/v1/node_config"
CURL_MAINTENANCE_DELETE_CMD_PREFIX='curl -X DELETE --silent -o /dev/null -w "%{http_code}"'
CURL_MAINTENANCE_PUT_CMD_PREFIX='curl -X PUT --silent -o /dev/null -w "%{http_code}"'
CURL_MAINTENANCE_GET_CMD="curl -X GET --silent ${CURL_URL}/v1/maintenance"
postStart.sh: |-
#!/usr/bin/env bash
# This code should be similar if not exactly the same as that found in the panda-operator, see
# https://github.com/redpanda-data/redpanda/blob/e51d5b7f2ef76d5160ca01b8c7a8cf07593d29b6/src/go/k8s/pkg/resources/secret.go
# path below should match the path defined on the statefulset
source /var/lifecycle/common.sh
preStop.sh: |-
#!/usr/bin/env bash
# This code should be similar if not exactly the same as that found in the panda-operator, see
# https://github.com/redpanda-data/redpanda/blob/e51d5b7f2ef76d5160ca01b8c7a8cf07593d29b6/src/go/k8s/pkg/resources/secret.go
# path below should match the path defined on the statefulset
source /var/lifecycle/common.sh
set -x
29 changes: 29 additions & 0 deletions kafka/redpanda/ystack/redpanda/templates/service.internal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# Source: redpanda/templates/service.internal.yaml
# This service is only used to create the DNS enteries for each pod in
# the stateful set and allow the serviceMonitor to target the pods.
# This service should not be used by any client application
apiVersion: v1
kind: Service
metadata:
name: redpanda
namespace: "kafka"
labels:
monitoring.redpanda.com/enabled: "false"
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-4.0.47
spec:
type: ClusterIP
publishNotReadyAddresses: true
clusterIP: None
selector:
app.kubernetes.io/name: redpanda
app.kubernetes.io/instance: "redpanda"
ports:
- name: admin
protocol: TCP
targetPort: 9644
port: 9644
Loading

0 comments on commit baadd3b

Please sign in to comment.