Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add probes to Streampipes' kubernetes deployment ( #1781 ) #1786

Merged
merged 3 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 22 additions & 0 deletions installer/k8s/templates/core/backend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
22 changes: 22 additions & 0 deletions installer/k8s/templates/core/ui-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
26 changes: 24 additions & 2 deletions installer/k8s/templates/external/consul/consul-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
24 changes: 23 additions & 1 deletion installer/k8s/templates/external/couchdb/couchdb-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
labels:
app: {{ .Values.external.couchdb.appName }}
spec:
restartPolicy: {{ .Values.restartPolicy }}
volumes:
- name: {{ .Values.external.couchdb.persistence.pvName }}
persistentVolumeClaim:
Expand All @@ -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 }}
28 changes: 25 additions & 3 deletions installer/k8s/templates/external/influxdb/influxdb-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
labels:
app: {{ .Values.external.influxdb.appName }}
spec:
restartPolicy: {{ .Values.restartPolicy }}
volumes:
- name: {{ .Values.external.influxdb.persistence.pvNameV1 }}
persistentVolumeClaim:
Expand All @@ -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"
Expand All @@ -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 }}
29 changes: 24 additions & 5 deletions installer/k8s/templates/external/kafka/kafka-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spec:
labels:
app: kafka
spec:
restartPolicy: {{ .Values.restartPolicy }}
initContainers:
- name: init-wait-consul
image: alpine
Expand All @@ -41,21 +42,21 @@ spec:
image: fogsyio/kafka:{{ .Values.external.kafkaVersion }}
imagePullPolicy: {{ .Values.pullPolicy }}
ports:
- containerPort: 9092
- containerPort: {{ .Values.external.kafkaPort }}
volumeMounts:
- mountPath: "/kafka"
name: kafka-pv
env:
# 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
Expand All @@ -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 }}
21 changes: 20 additions & 1 deletion installer/k8s/templates/external/nats/nats-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spec:
labels:
app: {{ .Values.external.nats.appName }}
spec:
restartPolicy: {{ .Values.restartPolicy }}
initContainers:
- name: init-wait-consul
image: alpine
Expand All @@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spec:
labels:
app: zookeeper
spec:
restartPolicy: {{ .Values.restartPolicy }}
volumes:
- name: zookeeper-pv
persistentVolumeClaim:
Expand All @@ -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 }}
Loading