Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
19 changes: 19 additions & 0 deletions .debug/clickhouse/charts/zookeeper/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CHART NAME: zookeeper
CHART VERSION: 0.0.1
APP VERSION: 3.8.1

** Please be patient while the chart is being deployed **

ZooKeeper can be accessed via port 2181 on the following DNS name from within your cluster:

RELEASE-NAME-zookeeper.NAMESPACE.svc.cluster.local

To connect to your ZooKeeper server run the following commands:

export POD_NAME=$(kubectl get pods --namespace NAMESPACE -l "app.kubernetes.io/name=zookeeper,app.kubernetes.io/instance=RELEASE-NAME,app.kubernetes.io/component=zookeeper" -o jsonpath="{.items[0].metadata.name}")
kubectl exec -it $POD_NAME -- zkCli.sh

To connect to your ZooKeeper server from outside the cluster execute the following commands:

kubectl port-forward --namespace NAMESPACE svc/RELEASE-NAME-zookeeper 2181:2181 &
zkCli.sh 127.0.0.1:2181
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

26 changes: 26 additions & 0 deletions .debug/clickhouse/charts/zookeeper/templates/metrics-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

apiVersion: v1
kind: Service
metadata:
name: RELEASE-NAME-zookeeper-metrics
namespace: NAMESPACE
labels:
app.kubernetes.io/name: zookeeper
helm.sh/chart: zookeeper-0.0.1
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: metrics
annotations:
prometheus.io/path: /metrics
prometheus.io/port: '9141'
prometheus.io/scrape: "true"
spec:
type: ClusterIP
ports:
- name: tcp-metrics
port: 9141
targetPort: metrics
Comment on lines +20 to +22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Service targets a non-existent pod port name 'metrics'.

StatefulSet exposes ports named client/follower/election only. targetPort: metrics won’t resolve, so scraping on 9141 will fail. Align one of:

  • Add a metrics endpoint (sidecar or container) and expose a containerPort named metrics: 9141.
  • Or change Service to target an existing port, or drop the metrics Service until an exporter is added.
🤖 Prompt for AI Agents
.debug/clickhouse/charts/zookeeper/templates/metrics-svc.yaml lines 20-22: the
Service is targeting a non-existent container port name "metrics" (StatefulSet
only exposes client/follower/election) so targetPort: metrics will not resolve;
either add a metrics exporter container/sidecar and declare a containerPort:
9141 with name: metrics in the Pod/StatefulSet, or update this Service to use
one of the existing port names (client/follower/election) or remove the metrics
Service entirely until an exporter is added—make the change so targetPort
references a real containerPort name or numeric port.

selector:
app.kubernetes.io/name: zookeeper
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/component: zookeeper
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions .debug/clickhouse/charts/zookeeper/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: RELEASE-NAME-zookeeper-scripts
namespace: NAMESPACE
labels:
app.kubernetes.io/name: zookeeper
helm.sh/chart: zookeeper-0.0.1
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: zookeeper
data:
init-certs.sh: |-
#!/bin/bash
setup.sh: |-
#!/bin/bash

# Execute entrypoint as usual after obtaining ZOO_SERVER_ID
# check ZOO_SERVER_ID in persistent volume via myid
# if not present, set based on POD hostname
if [[ -f "/bitnami/zookeeper/data/myid" ]]; then
export ZOO_SERVER_ID="$(cat /bitnami/zookeeper/data/myid)"
else
HOSTNAME="$(hostname -s)"
if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
ORD=${BASH_REMATCH[2]}
export ZOO_SERVER_ID="$((ORD + 1 ))"
else
echo "Failed to get index from hostname $HOSTNAME"
exit 1
fi
fi
exec /entrypoint.sh /run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

159 changes: 159 additions & 0 deletions .debug/clickhouse/charts/zookeeper/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: RELEASE-NAME-zookeeper
namespace: NAMESPACE
labels:
app.kubernetes.io/name: zookeeper
helm.sh/chart: zookeeper-0.0.1
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: zookeeper
role: zookeeper
spec:
replicas: 1
podManagementPolicy: Parallel
selector:
matchLabels:
app.kubernetes.io/name: zookeeper
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/component: zookeeper
serviceName: RELEASE-NAME-zookeeper-headless
updateStrategy:
rollingUpdate: {}
type: RollingUpdate
template:
metadata:
annotations:
labels:
app.kubernetes.io/name: zookeeper
helm.sh/chart: zookeeper-0.0.1
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: zookeeper
spec:
serviceAccountName: default

affinity:
podAffinity:

podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: zookeeper
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/component: zookeeper
topologyKey: kubernetes.io/hostname
weight: 1
nodeAffinity:

securityContext:
fsGroup: 1001
initContainers:
containers:
- name: zookeeper
image: signoz/zookeeper:3.7.1
imagePullPolicy: "IfNotPresent"
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1001
command:
- /scripts/setup.sh
resources:
limits: {}
requests:
cpu: 100m
memory: 256Mi
env:
- name: BITNAMI_DEBUG
value: "false"
- name: ZOO_DATA_LOG_DIR
value: ""
- name: ZOO_PORT_NUMBER
value: "2181"
- name: ZOO_TICK_TIME
value: "2000"
- name: ZOO_INIT_LIMIT
value: "10"
- name: ZOO_SYNC_LIMIT
value: "5"
- name: ZOO_PRE_ALLOC_SIZE
value: "65536"
- name: ZOO_SNAPCOUNT
value: "100000"
- name: ZOO_MAX_CLIENT_CNXNS
value: "60"
- name: ZOO_4LW_COMMANDS_WHITELIST
value: "srvr, mntr, ruok"
- name: ZOO_LISTEN_ALLIPS_ENABLED
value: "no"
- name: ZOO_AUTOPURGE_INTERVAL
value: "1"
- name: ZOO_AUTOPURGE_RETAIN_COUNT
value: "3"
- name: ZOO_MAX_SESSION_TIMEOUT
value: "40000"
- name: ZOO_SERVERS
value: RELEASE-NAME-zookeeper-0.RELEASE-NAME-zookeeper-headless.NAMESPACE.svc.cluster.local:2888:3888::1
- name: ZOO_ENABLE_AUTH
value: "no"
- name: ZOO_ENABLE_QUORUM_AUTH
value: "no"
- name: ZOO_HEAP_SIZE
value: "1024"
- name: ZOO_LOG_LEVEL
value: "ERROR"
- name: ALLOW_ANONYMOUS_LOGIN
value: "yes"
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
ports:
- name: client
containerPort: 2181
- name: follower
containerPort: 2888
- name: election
containerPort: 3888
Comment on lines +116 to +122
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Expose a 'metrics' port or adjust/remove the metrics Service.

Pods don’t declare a containerPort named metrics, while metrics-svc targets it. Add the port (and an actual metrics endpoint/exporter), or update/remove the Service to avoid a dead endpoint.

           ports:
             - name: client
               containerPort: 2181
             - name: follower
               containerPort: 2888
             - name: election
               containerPort: 3888
+            # If a metrics exporter is present and listens on 9141:
+            # - name: metrics
+            #   containerPort: 9141
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ports:
- name: client
containerPort: 2181
- name: follower
containerPort: 2888
- name: election
containerPort: 3888
ports:
- name: client
containerPort: 2181
- name: follower
containerPort: 2888
- name: election
containerPort: 3888
# If a metrics exporter is present and listens on 9141:
# - name: metrics
# containerPort: 9141
🤖 Prompt for AI Agents
In .debug/clickhouse/charts/zookeeper/templates/statefulset.yaml around lines
116-122 the Pod spec does not expose a containerPort named "metrics" while the
metrics Service targets that port; add a container port entry named "metrics"
(e.g., containerPort: <port-number>) and ensure the container includes a metrics
exporter or endpoint bound to that port, or alternatively remove or update the
metrics Service to point to an existing port/name; make the change so Service
targetPort/name matches an actual containerPort and verify the exporter is
configured and listening.

livenessProbe:
failureThreshold: 6
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
exec:
command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok']
readinessProbe:
failureThreshold: 6
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
exec:
command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok']
volumeMounts:
- name: scripts
mountPath: /scripts/setup.sh
subPath: setup.sh
- name: data
mountPath: /bitnami/zookeeper
volumes:
- name: scripts
configMap:
name: RELEASE-NAME-zookeeper-scripts
defaultMode: 0755
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "8Gi"

29 changes: 29 additions & 0 deletions .debug/clickhouse/charts/zookeeper/templates/svc-headless.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Service
metadata:
name: RELEASE-NAME-zookeeper-headless
namespace: NAMESPACE
labels:
app.kubernetes.io/name: zookeeper
helm.sh/chart: zookeeper-0.0.1
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: zookeeper
spec:
type: ClusterIP
clusterIP: None
publishNotReadyAddresses: true
ports:
- name: tcp-client
port: 2181
targetPort: client
- name: tcp-follower
port: 2888
targetPort: follower
- name: tcp-election
port: 3888
targetPort: election
selector:
app.kubernetes.io/name: zookeeper
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/component: zookeeper
29 changes: 29 additions & 0 deletions .debug/clickhouse/charts/zookeeper/templates/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Service
metadata:
name: RELEASE-NAME-zookeeper
namespace: NAMESPACE
labels:
app.kubernetes.io/name: zookeeper
helm.sh/chart: zookeeper-0.0.1
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: zookeeper
spec:
type: ClusterIP
sessionAffinity: None
ports:
- name: tcp-client
port: 2181
targetPort: client
nodePort: null
- name: tcp-follower
port: 2888
targetPort: follower
- name: tcp-election
port: 3888
targetPort: election
selector:
app.kubernetes.io/name: zookeeper
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/component: zookeeper
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading