From b8a710561f609fc0993b0b93bbc1d0bf9386b4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=20=E5=BB=BA=E6=98=8C?= Date: Tue, 9 Aug 2022 16:51:47 +0800 Subject: [PATCH] move probe to values and restore default values **Phenomenon and reproduction steps** move probe to values and restore default values https://github.com/deepflowys/deepflow/issues/544 **Root cause and solution** move probe to values and restore default values **Impactions** **Test method** **Affected branch(es)** * main **Checklist** - [ ] Dependencies update required - [ ] Common bug (similar problem in other repo) --- charts/deepflow-agent/Chart.yaml | 2 +- .../deepflow-agent/templates/daemonset.yaml | 18 ++++++++++ charts/deepflow-agent/values.yaml | 2 +- charts/deepflow/Chart.yaml | 2 +- charts/deepflow/templates/app-deployment.yaml | 17 ++-------- .../templates/server-statefulset.yaml | 19 ++--------- charts/deepflow/values.yaml | 33 +++++++++++++++++++ 7 files changed, 60 insertions(+), 33 deletions(-) diff --git a/charts/deepflow-agent/Chart.yaml b/charts/deepflow-agent/Chart.yaml index f9993b6..99bb90a 100644 --- a/charts/deepflow-agent/Chart.yaml +++ b/charts/deepflow-agent/Chart.yaml @@ -3,7 +3,7 @@ description: An automated observability platform for cloud-native developers. name: deepflow-agent engine: gotpl type: application -version: 0.1.007 +version: 0.1.008 appVersion: "6.1.1" kubeVersion: ">=1.16.0-0" sources: diff --git a/charts/deepflow-agent/templates/daemonset.yaml b/charts/deepflow-agent/templates/daemonset.yaml index 1c1ab38..204d8d9 100644 --- a/charts/deepflow-agent/templates/daemonset.yaml +++ b/charts/deepflow-agent/templates/daemonset.yaml @@ -65,6 +65,12 @@ spec: readOnly: false ## attach/detach ebpf kprobe/uprobe to kernel - name: deepflow-agent-conf mountPath: /etc/deepflow-agent + {{- range .Values.extraVolumeMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath | default "" }} + readOnly: {{ .readOnly }} + {{- end }} volumes: - name: sys-kernel-debug hostPath: @@ -72,6 +78,18 @@ spec: - name: deepflow-agent-conf configMap: name: {{ include "deepflow-agent.fullname" . }} + {{- range .Values.extraVolumeMounts }} + - name: {{ .name }} + {{- if .existingClaim }} + persistentVolumeClaim: + claimName: {{ .existingClaim }} + {{- else if .hostPath }} + hostPath: + path: {{ .hostPath }} + {{- else }} + emptyDir: {} + {{- end }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/deepflow-agent/values.yaml b/charts/deepflow-agent/values.yaml index 038d90e..dd04e98 100644 --- a/charts/deepflow-agent/values.yaml +++ b/charts/deepflow-agent/values.yaml @@ -35,7 +35,7 @@ securityContext: # runAsUser: 1000 nodeIPInjection: false - +extraVolumeMounts: [] service: ## Configuration for Clickhouse service ## diff --git a/charts/deepflow/Chart.yaml b/charts/deepflow/Chart.yaml index e5eabbd..0b2e851 100644 --- a/charts/deepflow/Chart.yaml +++ b/charts/deepflow/Chart.yaml @@ -3,7 +3,7 @@ description: An automated observability platform for cloud-native developers. name: deepflow engine: gotpl type: application -version: 0.1.007 +version: 0.1.008 appVersion: "6.1.1" kubeVersion: ">=1.16.0-0" sources: diff --git a/charts/deepflow/templates/app-deployment.yaml b/charts/deepflow/templates/app-deployment.yaml index 4ab0667..62d10a9 100644 --- a/charts/deepflow/templates/app-deployment.yaml +++ b/charts/deepflow/templates/app-deployment.yaml @@ -36,21 +36,10 @@ spec: - name: app containerPort: 20418 protocol: TCP - readinessProbe: - tcpSocket: - port: app - failureThreshold: 3 - initialDelaySeconds: 15 - periodSeconds: 10 - successThreshold: 1 livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 15 - periodSeconds: 20 - successThreshold: 1 - tcpSocket: - port: app - timeoutSeconds: 1 + {{ toYaml .Values.app.livenessProbe | nindent 12 }} + readinessProbe: + {{ toYaml .Values.app.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.app.resources | nindent 12 }} volumeMounts: diff --git a/charts/deepflow/templates/server-statefulset.yaml b/charts/deepflow/templates/server-statefulset.yaml index d48f6f7..e32ee94 100644 --- a/charts/deepflow/templates/server-statefulset.yaml +++ b/charts/deepflow/templates/server-statefulset.yaml @@ -54,23 +54,10 @@ spec: - containerPort: 20416 name: querier protocol: TCP - readinessProbe: - httpGet: - path: /v1/health/ - port: server - failureThreshold: 12 - initialDelaySeconds: 15 - periodSeconds: 10 - successThreshold: 1 livenessProbe: - failureThreshold: 7 - initialDelaySeconds: 15 - periodSeconds: 20 - successThreshold: 1 - httpGet: - path: /v1/health/ - port: server - timeoutSeconds: 1 + {{ toYaml .Values.server.livenessProbe | nindent 12 }} + readinessProbe: + {{ toYaml .Values.server.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.server.resources | nindent 12 }} volumeMounts: diff --git a/charts/deepflow/values.yaml b/charts/deepflow/values.yaml index 270b138..9606010 100644 --- a/charts/deepflow/values.yaml +++ b/charts/deepflow/values.yaml @@ -70,6 +70,23 @@ server: hostNetwork: "{{ .Values.global.hostNetwork }}" dnsPolicy: "{{ .Values.global.dnsPolicy }}" podManagementPolicy: "{{ .Values.global.podManagementPolicy }}" + readinessProbe: + httpGet: + path: /v1/health/ + port: server + failureThreshold: 3 + initialDelaySeconds: 15 + periodSeconds: 10 + successThreshold: 1 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 15 + periodSeconds: 20 + successThreshold: 1 + httpGet: + path: /v1/health/ + port: server + timeoutSeconds: 1 service: ## Configuration for deepflow-server service ## @@ -187,6 +204,21 @@ app: replicas: "1" hostNetwork: "{{ .Values.global.hostNetwork }}" dnsPolicy: "{{ .Values.global.dnsPolicy }}" + readinessProbe: + tcpSocket: + port: app + failureThreshold: 3 + initialDelaySeconds: 15 + periodSeconds: 10 + successThreshold: 1 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 15 + periodSeconds: 20 + successThreshold: 1 + tcpSocket: + port: app + timeoutSeconds: 1 service: ## Configuration for deepflow querier service ## @@ -632,6 +664,7 @@ deepflow-agent: podSecurityContext: {} # fsGroup: 2000 hostNetwork: "true" + extraVolumeMounts: [] securityContext: privileged: true # capabilities: