This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 8419dd075 add probes to Streampipes' kubernetes deployment ( #1781 )
(#1786)
8419dd075 is described below
commit 8419dd0754442af7d075195833ecef7144633ded
Author: luoluoyuyu <[email protected]>
AuthorDate: Mon Jul 24 13:10:49 2023 +0800
add probes to Streampipes' kubernetes deployment ( #1781 ) (#1786)
* add probes to Streampipes' kubernetes deployment
* add probes to Streampipes' kubernetes deployment
* Fix misspelled words
---
.../k8s/templates/core/backend-deployment.yaml | 22 ++++++++++++++++
installer/k8s/templates/core/ui-deployment.yaml | 22 ++++++++++++++++
.../extensions-all-iiot-deployment.yaml | 21 ++++++++++++++-
.../external/consul/consul-deployment.yaml | 26 +++++++++++++++++--
.../external/couchdb/couchdb-deployment.yaml | 24 ++++++++++++++++-
.../external/influxdb/influxdb-deployment.yaml | 28 +++++++++++++++++---
.../templates/external/kafka/kafka-deployment.yaml | 29 +++++++++++++++++----
.../templates/external/nats/nats-deployment.yaml | 21 ++++++++++++++-
.../external/zookeeper/zookeeper-deployment.yaml | 30 +++++++++++++++++++++-
installer/k8s/values.yaml | 21 +++++++++++++++
10 files changed, 230 insertions(+), 14 deletions(-)
diff --git a/installer/k8s/templates/core/backend-deployment.yaml
b/installer/k8s/templates/core/backend-deployment.yaml
index 52c146fb2..9cfbc7214 100644
--- a/installer/k8s/templates/core/backend-deployment.yaml
+++ b/installer/k8s/templates/core/backend-deployment.yaml
@@ -35,6 +35,7 @@ spec:
- name: {{ .Values.streampipes.core.persistence.pvName }}
persistentVolumeClaim:
claimName: {{ .Values.streampipes.core.persistence.claimName }}
+ restartPolicy: {{ .Values.restartPolicy }}
containers:
- name: {{ .Values.streampipes.core.appName }}
image: {{ .Values.streampipes.registry }}/backend:{{
.Values.streampipes.version }}
@@ -47,3 +48,24 @@ spec:
volumeMounts:
- mountPath: "/root/.streampipes"
name: {{ .Values.streampipes.core.persistence.pvName }}
+ readinessProbe:
+ httpGet:
+ path: /streampipes-backend/api/v2/setup/configured
+ port: {{ .Values.streampipes.core.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ livenessProbe:
+ httpGet:
+ path: /streampipes-backend/api/v2/setup/configured
+ port: {{ .Values.streampipes.core.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ startupProbe:
+ httpGet:
+ path: /streampipes-backend/api/v2/setup/configured
+ port: {{ .Values.streampipes.core.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
diff --git a/installer/k8s/templates/core/ui-deployment.yaml
b/installer/k8s/templates/core/ui-deployment.yaml
index 27396b39b..e6afa24c4 100644
--- a/installer/k8s/templates/core/ui-deployment.yaml
+++ b/installer/k8s/templates/core/ui-deployment.yaml
@@ -31,6 +31,7 @@ spec:
- name: nginx-conf
configMap:
name: nginx-conf
+ restartPolicy: {{ .Values.restartPolicy }}
containers:
- name: {{ .Values.streampipes.ui.appName }}
image: {{ .Values.streampipes.registry }}/ui:{{
.Values.streampipes.version }}
@@ -41,3 +42,24 @@ spec:
- name: nginx-conf
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
+ readinessProbe:
+ httpGet:
+ path: /#/login
+ port: {{ .Values.streampipes.ui.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ livenessProbe:
+ httpGet:
+ path: /#/login
+ port: {{ .Values.streampipes.ui.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ startupProbe:
+ httpGet:
+ path: /#/login
+ port: {{ .Values.streampipes.ui.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
\ No newline at end of file
diff --git
a/installer/k8s/templates/extensions/pipeline-elements/extensions-all-iiot-deployment.yaml
b/installer/k8s/templates/extensions/pipeline-elements/extensions-all-iiot-deployment.yaml
index 318e3be10..f4fb316c0 100644
---
a/installer/k8s/templates/extensions/pipeline-elements/extensions-all-iiot-deployment.yaml
+++
b/installer/k8s/templates/extensions/pipeline-elements/extensions-all-iiot-deployment.yaml
@@ -27,9 +27,28 @@ spec:
labels:
app: extensions-all-iiot
spec:
+ restartPolicy: {{ .Values.restartPolicy }}
containers:
- name: extensions-all-iiot
image: {{ .Values.streampipes.registry }}/extensions-all-iiot:{{
.Values.streampipes.version }}
imagePullPolicy: {{ .Values.pullPolicy }}
ports:
- - containerPort: 8090
+ - containerPort: {{ .Values.extensions.iiot.port }}
+ livenessProbe:
+ tcpSocket:
+ port: {{ .Values.extensions.iiot.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ readinessProbe:
+ tcpSocket:
+ port: {{ .Values.extensions.iiot.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ startupProbe:
+ tcpSocket:
+ port: {{ .Values.extensions.iiot.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
diff --git a/installer/k8s/templates/external/consul/consul-deployment.yaml
b/installer/k8s/templates/external/consul/consul-deployment.yaml
index d494e8d58..699dd7d34 100644
--- a/installer/k8s/templates/external/consul/consul-deployment.yaml
+++ b/installer/k8s/templates/external/consul/consul-deployment.yaml
@@ -31,6 +31,7 @@ spec:
- name: {{ .Values.external.consul.persistence.pvName }}
persistentVolumeClaim:
claimName: {{ .Values.external.consul.persistence.claimName }}
+ restartPolicy: {{ .Values.restartPolicy }}
containers:
- name: {{ .Values.external.consul.appName }}
image: consul:{{ .Values.external.consul.version }}
@@ -56,8 +57,29 @@ spec:
- name: CONSUL_LOCAL_CONFIG
value: "{\"disable_update_check\": true}"
ports:
- - containerPort: 8500
- - containerPort: 8600
+ - containerPort: {{ .Values.external.consul.port1 }}
+ - containerPort: {{ .Values.external.consul.port2 }}
volumeMounts:
- mountPath: "/consul/data"
name: {{ .Values.external.consul.persistence.pvName }}
+ livenessProbe:
+ httpGet:
+ path: /v1/status/leader
+ port: {{ .Values.external.consul.port1 }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ readinessProbe:
+ httpGet:
+ path: /v1/status/leader
+ port: {{ .Values.external.consul.port1 }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ startupProbe:
+ httpGet:
+ path: /v1/status/leader
+ port: {{ .Values.external.consul.port1 }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
diff --git a/installer/k8s/templates/external/couchdb/couchdb-deployment.yaml
b/installer/k8s/templates/external/couchdb/couchdb-deployment.yaml
index 9e3eb670e..828539297 100644
--- a/installer/k8s/templates/external/couchdb/couchdb-deployment.yaml
+++ b/installer/k8s/templates/external/couchdb/couchdb-deployment.yaml
@@ -27,6 +27,7 @@ spec:
labels:
app: {{ .Values.external.couchdb.appName }}
spec:
+ restartPolicy: {{ .Values.restartPolicy }}
volumes:
- name: {{ .Values.external.couchdb.persistence.pvName }}
persistentVolumeClaim:
@@ -41,7 +42,28 @@ spec:
- name: COUCHDB_PASSWORD
value: {{ .Values.external.couchdb.password }}
ports:
- - containerPort: 5984
+ - containerPort: {{ .Values.external.couchdb.port }}
volumeMounts:
- mountPath: "/opt/couchdb/data"
name: {{ .Values.external.couchdb.persistence.pvName }}
+ livenessProbe:
+ httpGet:
+ path: /
+ port: {{ .Values.external.couchdb.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ readinessProbe:
+ httpGet:
+ path: /
+ port: {{ .Values.external.couchdb.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ startupProbe:
+ httpGet:
+ path: /
+ port: {{ .Values.external.couchdb.port }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
diff --git a/installer/k8s/templates/external/influxdb/influxdb-deployment.yaml
b/installer/k8s/templates/external/influxdb/influxdb-deployment.yaml
index e1905c89f..3e6755edb 100644
--- a/installer/k8s/templates/external/influxdb/influxdb-deployment.yaml
+++ b/installer/k8s/templates/external/influxdb/influxdb-deployment.yaml
@@ -27,6 +27,7 @@ spec:
labels:
app: {{ .Values.external.influxdb.appName }}
spec:
+ restartPolicy: {{ .Values.restartPolicy }}
volumes:
- name: {{ .Values.external.influxdb.persistence.pvNameV1 }}
persistentVolumeClaim:
@@ -39,9 +40,9 @@ spec:
image: influxdb:{{ .Values.external.influxdb.version }}
imagePullPolicy: {{ .Values.pullPolicy }}
ports:
- - containerPort: 8083
- - containerPort: 8086
- - containerPort: 8090
+ - containerPort: {{ .Values.external.influxdb.port1 }}
+ - containerPort: {{ .Values.external.influxdb.port2 }}
+ - containerPort: {{ .Values.external.influxdb.port3 }}
env:
- name: INFLUXDB_DATA_ENGINE
value: "tsm1"
@@ -66,3 +67,24 @@ spec:
name: {{ .Values.external.influxdb.persistence.pvNameV1 }}
- mountPath: "/var/lib/influxdb2"
name: {{ .Values.external.influxdb.persistence.pvName }}
+ livenessProbe:
+ httpGet:
+ path: /ping
+ port: {{ .Values.external.influxdb.port2 }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ readinessProbe:
+ httpGet:
+ path: /ping
+ port: {{ .Values.external.influxdb.port2 }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ startupProbe:
+ httpGet:
+ path: /ping
+ port: {{ .Values.external.influxdb.port2 }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
\ No newline at end of file
diff --git a/installer/k8s/templates/external/kafka/kafka-deployment.yaml
b/installer/k8s/templates/external/kafka/kafka-deployment.yaml
index da02d4543..46793d56c 100644
--- a/installer/k8s/templates/external/kafka/kafka-deployment.yaml
+++ b/installer/k8s/templates/external/kafka/kafka-deployment.yaml
@@ -28,6 +28,7 @@ spec:
labels:
app: kafka
spec:
+ restartPolicy: {{ .Values.restartPolicy }}
initContainers:
- name: init-wait-consul
image: alpine
@@ -41,7 +42,7 @@ spec:
image: fogsyio/kafka:{{ .Values.external.kafkaVersion }}
imagePullPolicy: {{ .Values.pullPolicy }}
ports:
- - containerPort: 9092
+ - containerPort: {{ .Values.external.kafkaPort }}
volumeMounts:
- mountPath: "/kafka"
name: kafka-pv
@@ -49,13 +50,13 @@ spec:
# Known issue with kafka running in kubernetes:
# https://github.com/wurstmeister/kafka-docker/issues/122
- name: KAFKA_PORT
- value: "9092"
+ value: "{{ .Values.external.kafkaProt }}"
- name: KAFKA_ZOOKEEPER_CONNECT
- value: "zookeeper:2181"
+ value: "zookeeper:{{ .Values.external.zookeeperPort }}"
- name: KAFKA_LISTENERS
- value: "PLAINTEXT://:9092"
+ value: "PLAINTEXT://:{{ .Values.external.kafkaPort }}"
- name: KAFKA_ADVERTISED_LISTENERS
- value: "PLAINTEXT://kafka:9092"
+ value: "PLAINTEXT://kafka:{{ .Values.external.kafkaProt }}"
- name: KAFKA_INTER_BROKER_LISTENER_NAME
value: "PLAINTEXT"
- name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
@@ -66,4 +67,22 @@ spec:
value: "5000012"
- name: KAFKA_REPLICA_FETCH_MAX_BYTES
value: "10000000"
+ livenessProbe:
+ tcpSocket:
+ port: {{ .Values.external.kafkaPort }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ readinessProbe:
+ tcpSocket:
+ port: {{ .Values.external.kafkaPort }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ startupProbe:
+ tcpSocket:
+ port: {{ .Values.external.kafkaPort }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
{{- end }}
diff --git a/installer/k8s/templates/external/nats/nats-deployment.yaml
b/installer/k8s/templates/external/nats/nats-deployment.yaml
index 4f57e9a03..e9c13df4a 100644
--- a/installer/k8s/templates/external/nats/nats-deployment.yaml
+++ b/installer/k8s/templates/external/nats/nats-deployment.yaml
@@ -28,6 +28,7 @@ spec:
labels:
app: {{ .Values.external.nats.appName }}
spec:
+ restartPolicy: {{ .Values.restartPolicy }}
initContainers:
- name: init-wait-consul
image: alpine
@@ -37,5 +38,23 @@ spec:
image: nats
imagePullPolicy: {{ .Values.pullPolicy }}
ports:
- - containerPort: 4222
+ - containerPort: {{ .Values.external.nats.port}}
+ livenessProbe:
+ tcpSocket:
+ port: {{ .Values.external.nats.port}}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ readinessProbe:
+ tcpSocket:
+ port: {{ .Values.external.nats.port}}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ startupProbe:
+ tcpSocket:
+ port: {{ .Values.external.nats.port}}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
{{- end }}
diff --git
a/installer/k8s/templates/external/zookeeper/zookeeper-deployment.yaml
b/installer/k8s/templates/external/zookeeper/zookeeper-deployment.yaml
index 72ad397a3..72c114366 100644
--- a/installer/k8s/templates/external/zookeeper/zookeeper-deployment.yaml
+++ b/installer/k8s/templates/external/zookeeper/zookeeper-deployment.yaml
@@ -28,6 +28,7 @@ spec:
labels:
app: zookeeper
spec:
+ restartPolicy: {{ .Values.restartPolicy }}
volumes:
- name: zookeeper-pv
persistentVolumeClaim:
@@ -39,8 +40,35 @@ spec:
image: fogsyio/zookeeper:{{ .Values.external.zookeeperVersion }}
imagePullPolicy: {{ .Values.pullPolicy }}
ports:
- - containerPort: 2181
+ - containerPort: {{ .Values.external.zookeeperPort }}
volumeMounts:
- mountPath: "/opt/zookeeper-{{ .Values.external.zookeeperVersion
}}/data"
name: zookeeper-pv
+ livenessProbe:
+ exec:
+ command:
+ - sh
+ - -c
+ - echo ruok | nc localhost {{ .Values.external.zookeeperPort }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ readinessProbe:
+ exec:
+ command:
+ - sh
+ - -c
+ - echo ruok | nc localhost {{ .Values.external.zookeeperPort }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
+ startupProbe:
+ exec:
+ command:
+ - sh
+ - -c
+ - echo ruok | nc localhost {{ .Values.external.zookeeperPort }}
+ initialDelaySeconds: {{ .Values.initialDelaySeconds }}
+ periodSeconds: {{ .Values.periodSeconds }}
+ failureThreshold: {{ .Values.failureThreshold }}
{{- end }}
diff --git a/installer/k8s/values.yaml b/installer/k8s/values.yaml
index 799bac44b..0a17c6601 100644
--- a/installer/k8s/values.yaml
+++ b/installer/k8s/values.yaml
@@ -17,8 +17,12 @@
deployment: lite
preferredBroker: "nats"
pullPolicy: "Always"
+restartPolicy: Always
persistentVolumeReclaimPolicy: "Delete"
persistentVolumeAccessModes: "ReadWriteOnce"
+initialDelaySeconds: 60
+periodSeconds: 30
+failureThreshold: 30
streampipes:
version: "0.93.0-SNAPSHOT"
@@ -61,20 +65,31 @@ streampipes:
certResolverActive: true
certResolver: ""
+extensions:
+ iiot:
+ port: 8090
+
external:
consul:
appName: "consul"
version: 1.14.3
+ port1: 8500
+ port2: 8600
persistence:
storageClassName: "hostpath"
storageSize: "1Gi"
claimName: "consul-pvc"
pvName: "consul-pv"
+ service:
+ name: "consul"
+ port1: 8500
+ port2: 8600
couchdb:
appName: "couchdb"
version: 3.3.1
user: "admin"
password: "admin"
+ port: 5984
persistence:
storageClassName: "hostpath"
storageSize: "1Gi"
@@ -98,14 +113,20 @@ external:
claimNameV1: "influxdb-pvc"
pvName: "influxdb2-pv"
pvNameV1: "influxdb-pv"
+ port1: 8083
+ port2: 8086
+ port3: 8090
nats:
appName: "nats"
+ port: 4222
service:
type: "NodePort"
externalTrafficPolicy: "Local"
version:
kafkaVersion: 2.2.0
+ kafkaPort: 9092
zookeeperVersion: 3.4.13
+ zookeeperPort: 2181