diff --git a/templates/operations/container-collector.yaml b/templates/operations/container-collector.yaml new file mode 100644 index 0000000..7926c0f --- /dev/null +++ b/templates/operations/container-collector.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: container-collector + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/containerCollector + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/containerd-goroutine-collector.yaml b/templates/operations/containerd-goroutine-collector.yaml new file mode 100644 index 0000000..6c2ba1f --- /dev/null +++ b/templates/operations/containerd-goroutine-collector.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: containerd-goroutine-collector + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/containerdGoroutineCollector + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/core-file-profiler.yaml b/templates/operations/core-file-profiler.yaml new file mode 100644 index 0000000..64ec1c1 --- /dev/null +++ b/templates/operations/core-file-profiler.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: core-file-profiler + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/coreFileProfiler + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/docker-info-collector.yaml b/templates/operations/docker-info-collector.yaml new file mode 100644 index 0000000..a19e99b --- /dev/null +++ b/templates/operations/docker-info-collector.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: docker-info-collector + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/dockerInfoCollector + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/dockerd-goroutine-collector.yaml b/templates/operations/dockerd-goroutine-collector.yaml new file mode 100644 index 0000000..d3c8d0f --- /dev/null +++ b/templates/operations/dockerd-goroutine-collector.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: dockerd-goroutine-collector + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/dockerdGoroutineCollector + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/elasticsearch-collector.yaml b/templates/operations/elasticsearch-collector.yaml new file mode 100644 index 0000000..b5b9875 --- /dev/null +++ b/templates/operations/elasticsearch-collector.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: elasticsearch-collector + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/elasticsearchCollector + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/go-profiler.yaml b/templates/operations/go-profiler.yaml new file mode 100644 index 0000000..51248ce --- /dev/null +++ b/templates/operations/go-profiler.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: go-profiler + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/goProfiler + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/mountinfo-collector.yaml b/templates/operations/mountinfo-collector.yaml new file mode 100644 index 0000000..74d14cd --- /dev/null +++ b/templates/operations/mountinfo-collector.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: mount-info-collector + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/mountInfoCollector + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/node-cordon.yaml b/templates/operations/node-cordon.yaml new file mode 100644 index 0000000..84fe4d1 --- /dev/null +++ b/templates/operations/node-cordon.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: node-cordon + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/nodeCordon + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/pod-detail-collector.yaml b/templates/operations/pod-detail-collector.yaml new file mode 100644 index 0000000..e4394eb --- /dev/null +++ b/templates/operations/pod-detail-collector.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: pod-detail-collector + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/podDetailCollector + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/pod-list-collector.yaml b/templates/operations/pod-list-collector.yaml new file mode 100644 index 0000000..a12e66d --- /dev/null +++ b/templates/operations/pod-list-collector.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: pod-list-collector + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/podListCollector + scheme: http + timeoutSeconds: 60 +{{- end }} diff --git a/templates/operations/process-collector.yaml b/templates/operations/process-collector.yaml new file mode 100644 index 0000000..8966068 --- /dev/null +++ b/templates/operations/process-collector.yaml @@ -0,0 +1,16 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: process-collector + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + httpServer: + path: /processor/processCollector + scheme: http + timeoutSeconds: 120 +{{- end }} diff --git a/templates/operations/python-function.yaml b/templates/operations/python-function.yaml new file mode 100644 index 0000000..969fb9d --- /dev/null +++ b/templates/operations/python-function.yaml @@ -0,0 +1,33 @@ +{{- if .Values.operations.enabled }} +apiVersion: diagnosis.kubediag.org/v1 +kind: Operation +metadata: + name: python-function + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "5" + "helm.sh/resource-policy": keep +spec: + processor: + function: + codeSource: + function.py: | + from hello import hello + + + def handler(context): + hello() + + result = dict() + for key in context: + result[key] = context[key] + result["a"] = "1" + result["b"] = "2" + + return result + hello.py: | + def hello(): + print("Hello World") + runtime: Python3 + timeoutSeconds: 120 +{{- end }} diff --git a/values.yaml b/values.yaml index 350e138..9555dcb 100644 --- a/values.yaml +++ b/values.yaml @@ -126,6 +126,9 @@ tolerations: [] affinity: {} +operations: + enabled: true + prometheus: enabled: true annotations: {}