Skip to content

Commit

Permalink
Example diff for running with custom namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
solsson committed Jun 26, 2023
1 parent a3addef commit a120f3f
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 179 deletions.
2 changes: 2 additions & 0 deletions redpanda.minimal.values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 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

image:
repository: docker.redpanda.com/redpandadata/redpanda
# sha256 is disallowed here by the json schema
Expand Down
8 changes: 4 additions & 4 deletions redpanda/minimal/redpanda/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: redpanda
namespace: "unhelm-namespace-placeholder"
namespace: "kafka"
labels:
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
Expand Down Expand Up @@ -64,13 +64,13 @@ data:
port: 33145
seed_servers:
- host:
address: redpanda-0.redpanda.unhelm-namespace-placeholder.svc.cluster.local.
address: redpanda-0.redpanda.kafka.svc.cluster.local.
port: 33145
- host:
address: redpanda-1.redpanda.unhelm-namespace-placeholder.svc.cluster.local.
address: redpanda-1.redpanda.kafka.svc.cluster.local.
port: 33145
- host:
address: redpanda-2.redpanda.unhelm-namespace-placeholder.svc.cluster.local.
address: redpanda-2.redpanda.kafka.svc.cluster.local.
port: 33145
schema_registry:
schema_registry_api:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: redpanda
namespace: unhelm-namespace-placeholder
namespace: kafka
labels:
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
Expand Down
4 changes: 2 additions & 2 deletions redpanda/minimal/redpanda/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Secret
metadata:
name: redpanda-sts-lifecycle
namespace: "unhelm-namespace-placeholder"
namespace: "kafka"
labels:
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
Expand All @@ -17,7 +17,7 @@ stringData:
#!/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.unhelm-namespace-placeholder.svc.cluster.local:9644"
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"
Expand Down
2 changes: 1 addition & 1 deletion redpanda/minimal/redpanda/templates/service.internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apiVersion: v1
kind: Service
metadata:
name: redpanda
namespace: "unhelm-namespace-placeholder"
namespace: "kafka"
labels:
monitoring.redpanda.com/enabled: "false"
app.kubernetes.io/component: redpanda
Expand Down
16 changes: 8 additions & 8 deletions redpanda/minimal/redpanda/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
app.kubernetes.io/component: redpanda-statefulset
redpanda.com/poddisruptionbudget: redpanda
annotations:
checksum/config: 3d72e1348bc6b82ebfb04ace04181c2f1e0b6105339fc4b9cdb9e02fd494c817
checksum/config: 1ea38287095928598ef2a1a2ee5d4cfc96ddc3a21b5d1e62e047bb6a0818777a
spec:
terminationGracePeriodSeconds: 90
securityContext:
Expand All @@ -52,9 +52,9 @@ spec:
fieldRef:
fieldPath: metadata.name
- name: ADVERTISED_KAFKA_ADDRESSES
value: '{"address":"$(SERVICE_NAME).redpanda.unhelm-namespace-placeholder.svc.cluster.local.","name":"internal","port":9093};{"address":"$(SERVICE_NAME)","name":"default","port":31092} {"address":"$(SERVICE_NAME).redpanda.unhelm-namespace-placeholder.svc.cluster.local.","name":"internal","port":9093};{"address":"$(SERVICE_NAME)","name":"default","port":31092} {"address":"$(SERVICE_NAME).redpanda.unhelm-namespace-placeholder.svc.cluster.local.","name":"internal","port":9093};{"address":"$(SERVICE_NAME)","name":"default","port":31092}'
value: '{"address":"$(SERVICE_NAME).redpanda.kafka.svc.cluster.local.","name":"internal","port":9093};{"address":"$(SERVICE_NAME)","name":"default","port":31092} {"address":"$(SERVICE_NAME).redpanda.kafka.svc.cluster.local.","name":"internal","port":9093};{"address":"$(SERVICE_NAME)","name":"default","port":31092} {"address":"$(SERVICE_NAME).redpanda.kafka.svc.cluster.local.","name":"internal","port":9093};{"address":"$(SERVICE_NAME)","name":"default","port":31092}'
- name: ADVERTISED_HTTP_ADDRESSES
value: '{"address":"$(SERVICE_NAME).redpanda.unhelm-namespace-placeholder.svc.cluster.local.","name":"internal","port":8082};{"address":"$(SERVICE_NAME)","name":"default","port":30082} {"address":"$(SERVICE_NAME).redpanda.unhelm-namespace-placeholder.svc.cluster.local.","name":"internal","port":8082};{"address":"$(SERVICE_NAME)","name":"default","port":30082} {"address":"$(SERVICE_NAME).redpanda.unhelm-namespace-placeholder.svc.cluster.local.","name":"internal","port":8082};{"address":"$(SERVICE_NAME)","name":"default","port":30082}'
value: '{"address":"$(SERVICE_NAME).redpanda.kafka.svc.cluster.local.","name":"internal","port":8082};{"address":"$(SERVICE_NAME)","name":"default","port":30082} {"address":"$(SERVICE_NAME).redpanda.kafka.svc.cluster.local.","name":"internal","port":8082};{"address":"$(SERVICE_NAME)","name":"default","port":30082} {"address":"$(SERVICE_NAME).redpanda.kafka.svc.cluster.local.","name":"internal","port":8082};{"address":"$(SERVICE_NAME)","name":"default","port":30082}'
- name: KUBERNETES_NODE_NAME
valueFrom:
fieldRef:
Expand Down Expand Up @@ -126,7 +126,7 @@ spec:
- -c
- |
set -e
RESULT=$(curl --silent --fail -k "http://${SERVICE_NAME}.redpanda.unhelm-namespace-placeholder.svc.cluster.local.:9644/v1/status/ready")
RESULT=$(curl --silent --fail -k "http://${SERVICE_NAME}.redpanda.kafka.svc.cluster.local.:9644/v1/status/ready")
echo $RESULT
echo $RESULT | grep ready
initialDelaySeconds: 1
Expand All @@ -138,7 +138,7 @@ spec:
command:
- /bin/sh
- -c
- curl --silent --fail -k "http://${SERVICE_NAME}.redpanda.unhelm-namespace-placeholder.svc.cluster.local.:9644/v1/status/ready"
- curl --silent --fail -k "http://${SERVICE_NAME}.redpanda.kafka.svc.cluster.local.:9644/v1/status/ready"
initialDelaySeconds: 10
failureThreshold: 3
periodSeconds: 10
Expand All @@ -153,8 +153,8 @@ spec:
- -c
- |
set -x
rpk cluster health --api-urls ${SERVICE_NAME}.redpanda.unhelm-namespace-placeholder.svc.cluster.local.:9644
rpk cluster health --api-urls ${SERVICE_NAME}.redpanda.unhelm-namespace-placeholder.svc.cluster.local.:9644 | grep 'Healthy:.*true'
rpk cluster health --api-urls ${SERVICE_NAME}.redpanda.kafka.svc.cluster.local.:9644
rpk cluster health --api-urls ${SERVICE_NAME}.redpanda.kafka.svc.cluster.local.:9644 | grep 'Healthy:.*true'
initialDelaySeconds: 1
failureThreshold: 3
periodSeconds: 10
Expand All @@ -167,7 +167,7 @@ spec:
- --memory=2048M
- --reserve-memory=205M
- --default-log-level=info
- --advertise-rpc-addr=$(SERVICE_NAME).redpanda.unhelm-namespace-placeholder.svc.cluster.local.:33145
- --advertise-rpc-addr=$(SERVICE_NAME).redpanda.kafka.svc.cluster.local.:33145
- --overprovisioned
ports:
- name: admin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Pod
metadata:
name: "redpanda-test-api-status"
namespace: "unhelm-namespace-placeholder"
namespace: "kafka"
labels:
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
Expand All @@ -29,7 +29,7 @@ spec:
- -c
- |
until rpk cluster info \
--brokers redpanda-0.redpanda.unhelm-namespace-placeholder.svc.cluster.local.:9093
--brokers redpanda-0.redpanda.kafka.svc.cluster.local.:9093
do sleep 2
done
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Pod
metadata:
name: redpanda-test-kafka-produce-consume
namespace: "unhelm-namespace-placeholder"
namespace: "kafka"
labels:
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
Expand All @@ -24,7 +24,7 @@ spec:
image: docker.redpanda.com/redpandadata/redpanda:v23.1.13
env:
- name: REDPANDA_BROKERS
value: "redpanda.unhelm-namespace-placeholder.svc.cluster.local:9093"
value: "redpanda.kafka.svc.cluster.local:9093"
- name: POD_NAME
valueFrom:
fieldRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Pod
metadata:
name: "redpanda-test-pandaproxy-status"
namespace: "unhelm-namespace-placeholder"
namespace: "kafka"
labels:
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Pod
metadata:
name: "redpanda-test-schemaregistry-status"
namespace: "unhelm-namespace-placeholder"
namespace: "kafka"
labels:
app.kubernetes.io/component: redpanda
app.kubernetes.io/instance: redpanda
Expand All @@ -31,21 +31,21 @@ spec:
$*
}
schemaCurl http://redpanda.unhelm-namespace-placeholder.svc.cluster.local.:8081/schemas/types
schemaCurl http://redpanda.kafka.svc.cluster.local.:8081/schemas/types
curl -svm3 --fail --retry "120" --retry-max-time "120" --retry-all-errors \
-X POST -H 'Content-Type:application/vnd.schemaregistry.v1+json' \
-d '{"schema":"{\"type\":\"record\",\"name\":\"sensor_sample\",\"fields\":[{\"name\":\"timestamp\",\"type\":\"long\",\"logicalType\":\"timestamp-millis\"},{\"name\":\"identifier\",\"type\":\"string\",\"logicalType\":\"uuid\"},{\"name\":\"value\",\"type\":\"long\"}]}"}' \
http://redpanda.unhelm-namespace-placeholder.svc.cluster.local.:8081/subjects/sensor-value/versions
http://redpanda.kafka.svc.cluster.local.:8081/subjects/sensor-value/versions
schemaCurl http://redpanda.unhelm-namespace-placeholder.svc.cluster.local.:8081/schemas/ids/1
schemaCurl http://redpanda.kafka.svc.cluster.local.:8081/schemas/ids/1
schemaCurl http://redpanda.unhelm-namespace-placeholder.svc.cluster.local.:8081/subjects
schemaCurl http://redpanda.kafka.svc.cluster.local.:8081/subjects
schemaCurl -X DELETE \
http://redpanda.unhelm-namespace-placeholder.svc.cluster.local.:8081/subjects/sensor-value/versions/1
http://redpanda.kafka.svc.cluster.local.:8081/subjects/sensor-value/versions/1
schemaCurl -X DELETE \
http://redpanda.unhelm-namespace-placeholder.svc.cluster.local.:8081/subjects/sensor-value/versions/1?permanent=true
http://redpanda.kafka.svc.cluster.local.:8081/subjects/sensor-value/versions/1?permanent=true
volumeMounts:
volumes:
151 changes: 0 additions & 151 deletions redpanda/minimal/unhelm-namespace-placeholder.txt

This file was deleted.

0 comments on commit a120f3f

Please sign in to comment.