From 18019837b1a7aa69a79da3c1b152b9911e93324f Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 10 Apr 2024 17:17:32 +0800 Subject: [PATCH] add stalle --- charts/deepflow-agent/Chart.yaml | 4 +- charts/deepflow/Chart.yaml | 10 +- .../charts/stella-agent-ce/Chart.yaml | 16 +- .../stella-agent-ce/templates/_affinity.tpl | 214 ++++++++++++++++++ .../stella-agent-ce/templates/_helpers.tpl | 64 ++++++ .../templates/_volumeClaimTemplates.tpl | 24 -- .../stella-agent-ce/templates/configmap.yaml | 141 ++++++++++++ .../stella-agent-ce/templates/deployment.yaml | 79 +++++++ .../stella-agent-ce/templates/service.yaml | 47 ++++ .../templates/stella-agent-ce-configmap.yaml | 8 - .../templates/stella-agent-ce-service.yaml | 15 -- .../stella-agent-ce-statefulset.yaml | 60 ----- .../charts/stella-agent-ce/values.yaml | 160 +++++++++---- charts/deepflow/values.yaml | 141 +++++++++--- 14 files changed, 787 insertions(+), 196 deletions(-) create mode 100644 charts/deepflow/charts/stella-agent-ce/templates/_helpers.tpl delete mode 100644 charts/deepflow/charts/stella-agent-ce/templates/_volumeClaimTemplates.tpl create mode 100644 charts/deepflow/charts/stella-agent-ce/templates/configmap.yaml create mode 100644 charts/deepflow/charts/stella-agent-ce/templates/deployment.yaml create mode 100644 charts/deepflow/charts/stella-agent-ce/templates/service.yaml delete mode 100644 charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-configmap.yaml delete mode 100644 charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-service.yaml delete mode 100644 charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-statefulset.yaml diff --git a/charts/deepflow-agent/Chart.yaml b/charts/deepflow-agent/Chart.yaml index 1ee7b53..77e3e8d 100644 --- a/charts/deepflow-agent/Chart.yaml +++ b/charts/deepflow-agent/Chart.yaml @@ -3,8 +3,8 @@ description: An automated observability platform for cloud-native developers. name: deepflow-agent engine: gotpl type: application -version: 6.4.013 -appVersion: "6.4.9" +version: 6.5.003 +appVersion: "6.5.4" kubeVersion: ">=1.16.0-0" sources: - https://github.com/deepflowio/deepflow diff --git a/charts/deepflow/Chart.yaml b/charts/deepflow/Chart.yaml index 78abd20..56dd812 100644 --- a/charts/deepflow/Chart.yaml +++ b/charts/deepflow/Chart.yaml @@ -3,8 +3,8 @@ description: An automated observability platform for cloud-native developers. name: deepflow engine: gotpl type: application -version: 6.4.013 -appVersion: "6.4.9" +version: 6.5.003 +appVersion: "6.5.4" kubeVersion: ">=1.16.0-0" sources: - https://github.com/deepflowio/deepflow @@ -31,4 +31,8 @@ dependencies: - name: grafana version: "7.*.*" repository: https://grafana.github.io/helm-charts - condition: grafana.enabled \ No newline at end of file + condition: grafana.enabled +- name: stella-agent-ce + repository: "" + version: '*.*.*' + condition: stella-agent-ce.enabled \ No newline at end of file diff --git a/charts/deepflow/charts/stella-agent-ce/Chart.yaml b/charts/deepflow/charts/stella-agent-ce/Chart.yaml index 2ec66c6..788553b 100644 --- a/charts/deepflow/charts/stella-agent-ce/Chart.yaml +++ b/charts/deepflow/charts/stella-agent-ce/Chart.yaml @@ -1,3 +1,17 @@ apiVersion: v2 +description: An automated observability platform for cloud-native developers. name: stella-agent-ce -version: 0.1.0 +engine: gotpl +type: application +version: 6.5.001 +appVersion: "6.5.0" +kubeVersion: ">=1.16.0-0" +sources: + - https://github.com/deepflowio/deepflow +home: https://github.com/deepflowio/deepflow +keywords: + - deepflow +icon: https://raw.githubusercontent.com/deepflowio/deepflow-charts/main/deepflow.svg +maintainers: + - name: deepflow + url: https://github.com/deepflowio/deepflow diff --git a/charts/deepflow/charts/stella-agent-ce/templates/_affinity.tpl b/charts/deepflow/charts/stella-agent-ce/templates/_affinity.tpl index 76d97c3..9c3d0df 100644 --- a/charts/deepflow/charts/stella-agent-ce/templates/_affinity.tpl +++ b/charts/deepflow/charts/stella-agent-ce/templates/_affinity.tpl @@ -1,3 +1,5 @@ +{{/* affinity - https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ */}} + {{- define "nodeaffinity" }} nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: @@ -38,4 +40,216 @@ {{- end }} {{- end }} {{- end }} +{{- end }} + +{{- define "nodeAffinityPreferredDuringScheduling" }} + {{- range $weightIndex, $weightItem := .Values.nodeAffinityTermLabelSelector }} + - weight: {{ $weightItem.weight }} + preference: + matchExpressions: + {{- range $Index, $item := $weightItem.matchExpressions }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- range $weightIndex, $weightItem := .Values.global.nodeAffinityTermLabelSelector }} + - weight: {{ $weightItem.weight }} + preference: + matchExpressions: + {{- range $Index, $item := $weightItem.matchExpressions }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} + + +{{- define "podAffinity" }} +{{- if or .Values.podAffinityLabelSelector .Values.podAffinityTermLabelSelector}} + podAffinity: + {{- if .Values.podAffinityLabelSelector }} + requiredDuringSchedulingIgnoredDuringExecution: + {{- include "podAffinityRequiredDuringScheduling" . }} + {{- end }} + {{- if or .Values.podAffinityTermLabelSelector}} + preferredDuringSchedulingIgnoredDuringExecution: + {{- include "podAffinityPreferredDuringScheduling" . }} + {{- end }} +{{- end }} +{{- end }} + +{{- define "podAffinityRequiredDuringScheduling" }} + {{- range $labelSelector, $labelSelectorItem := .Values.podAffinityLabelSelector }} + - labelSelector: + matchExpressions: + {{- range $index, $item := $labelSelectorItem.labelSelector }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + topologyKey: {{ $labelSelectorItem.topologyKey }} + {{- end }} + {{- range $labelSelector, $labelSelectorItem := .Values.global.podAffinityLabelSelector }} + - labelSelector: + matchExpressions: + {{- range $index, $item := $labelSelectorItem.labelSelector }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + topologyKey: {{ $labelSelectorItem.topologyKey }} + {{- end }} +{{- end }} + +{{- define "podAffinityPreferredDuringScheduling" }} + {{- range $labelSelector, $labelSelectorItem := .Values.podAffinityTermLabelSelector }} + - podAffinityTerm: + labelSelector: + matchExpressions: + {{- range $index, $item := $labelSelectorItem.labelSelector }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + topologyKey: {{ $labelSelectorItem.topologyKey }} + weight: {{ $labelSelectorItem.weight }} + {{- end }} + {{- range $labelSelector, $labelSelectorItem := .Values.global.podAffinityTermLabelSelector }} + - podAffinityTerm: + labelSelector: + matchExpressions: + {{- range $index, $item := $labelSelectorItem.labelSelector }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + topologyKey: {{ $labelSelectorItem.topologyKey }} + weight: {{ $labelSelectorItem.weight }} + {{- end }} +{{- end }} + +{{- define "podAntiAffinity" }} +{{- if or .Values.podAntiAffinityLabelSelector .Values.podAntiAffinityTermLabelSelector}} + podAntiAffinity: + {{- if .Values.podAntiAffinityLabelSelector }} + requiredDuringSchedulingIgnoredDuringExecution: + {{- include "podAntiAffinityRequiredDuringScheduling" . }} + {{- end }} + {{- if or .Values.podAntiAffinityTermLabelSelector}} + preferredDuringSchedulingIgnoredDuringExecution: + {{- include "podAntiAffinityPreferredDuringScheduling" . }} + {{- end }} +{{- end }} +{{- end }} + +{{- define "podAntiAffinityRequiredDuringScheduling" }} + {{- range $labelSelectorIndex, $labelSelectorItem := .Values.podAntiAffinityLabelSelector }} + - labelSelector: + matchExpressions: + {{- range $index, $item := $labelSelectorItem.labelSelector }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + topologyKey: {{ $labelSelectorItem.topologyKey }} + {{- end }} + {{- range $labelSelectorIndex, $labelSelectorItem := .Values.global.podAntiAffinityLabelSelector }} + - labelSelector: + matchExpressions: + {{- range $index, $item := $labelSelectorItem.labelSelector }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + topologyKey: {{ $labelSelectorItem.topologyKey }} + {{- end }} +{{- end }} + +{{- define "podAntiAffinityPreferredDuringScheduling" }} + {{- range $labelSelectorIndex, $labelSelectorItem := .Values.podAntiAffinityTermLabelSelector }} + - podAffinityTerm: + labelSelector: + matchExpressions: + {{- range $index, $item := $labelSelectorItem.labelSelector }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + topologyKey: {{ $labelSelectorItem.topologyKey }} + weight: {{ $labelSelectorItem.weight }} + {{- end }} + {{- range $labelSelectorIndex, $labelSelectorItem := .Values.global.podAntiAffinityTermLabelSelector }} + - podAffinityTerm: + labelSelector: + matchExpressions: + {{- range $index, $item := $labelSelectorItem.labelSelector }} + - key: {{ $item.key }} + operator: {{ $item.operator }} + {{- if $item.values }} + values: + {{- $vals := split "," $item.values }} + {{- range $i, $v := $vals }} + - {{ $v | quote }} + {{- end }} + {{- end }} + {{- end }} + topologyKey: {{ $labelSelectorItem.topologyKey }} + weight: {{ $labelSelectorItem.weight }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/deepflow/charts/stella-agent-ce/templates/_helpers.tpl b/charts/deepflow/charts/stella-agent-ce/templates/_helpers.tpl new file mode 100644 index 0000000..dbf3b05 --- /dev/null +++ b/charts/deepflow/charts/stella-agent-ce/templates/_helpers.tpl @@ -0,0 +1,64 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "stella-agent-ce.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "stella-agent-ce.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "stella-agent-ce.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "stella-agent-ce.labels" -}} +helm.sh/chart: {{ include "stella-agent-ce.chart" . }} +{{ include "stella-agent-ce.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "stella-agent-ce.selectorLabels" -}} +app: deepflow +component: stella-agent-ce +app.kubernetes.io/name: {{ include "stella-agent-ce.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "stella-agent-ce.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "stella-agent-ce.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/deepflow/charts/stella-agent-ce/templates/_volumeClaimTemplates.tpl b/charts/deepflow/charts/stella-agent-ce/templates/_volumeClaimTemplates.tpl deleted file mode 100644 index 82c21a9..0000000 --- a/charts/deepflow/charts/stella-agent-ce/templates/_volumeClaimTemplates.tpl +++ /dev/null @@ -1,24 +0,0 @@ -{{- /* PVC templates */ -}} -{{- define "persistentVolumeClaim" -}} -{{- range $index, $volume := .Values.storageConfig.persistence }} -- kind: PersistentVolumeClaim - apiVersion: v1 - metadata: - name: {{ $volume.name }} - annotations: - {{- toYaml $volume.annotations | nindent 8 }} - spec: - accessModes: - {{- toYaml $volume.accessModes | nindent 8 }} - resources: - requests: - storage: {{ $volume.size | quote }} - {{- if (tpl $volume.storageClass $) }} - storageClassName: {{ tpl $volume.storageClass $ | quote }} - {{- end }} - {{- if $volume.selector }} - selector: - {{- toYaml $volume.selector | nindent 8 }} - {{- end }} -{{- end }} -{{- end }} diff --git a/charts/deepflow/charts/stella-agent-ce/templates/configmap.yaml b/charts/deepflow/charts/stella-agent-ce/templates/configmap.yaml new file mode 100644 index 0000000..6c7887a --- /dev/null +++ b/charts/deepflow/charts/stella-agent-ce/templates/configmap.yaml @@ -0,0 +1,141 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: {{ include "stella-agent-ce.fullname" . }} + labels: + {{- include "stella-agent-ce.labels" . | nindent 4 }} +data: + df-llm-agent.yaml: | + {{- range $elem, $elemVal := index .Values "configmap" "df-llm-agent.yaml" -}} + {{- if not (kindIs "map" $elemVal) -}} + {{- if kindIs "invalid" $elemVal -}} + {{- nindent 4 $elem -}}: + {{- else if kindIs "string" $elemVal -}} + {{- if (tpl $elemVal $ ) -}} + {{- nindent 4 $elem }}: {{ tpl $elemVal $ -}} + {{- else -}} + {{- nindent 4 $elem }}: + {{- end -}} + {{- else if kindIs "float64" $elemVal -}} + {{- nindent 4 $elem }}: {{ int $elemVal -}} + {{- else if kindIs "slice" $elemVal -}} + {{- nindent 4 $elem -}}: + {{- tpl (toYaml $elemVal ) $| nindent 4 -}} + {{- else -}} + {{- if $elemVal -}} + {{- nindent 4 $elem }}: {{ toYaml $elemVal -}} + {{- else -}} + {{- nindent 4 $elem }}: + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- range $key, $value := index .Values "configmap" "server.yaml" -}} + {{- if kindIs "map" $value -}} + {{- nindent 4 $key -}}: + {{- range $elem, $elemVal := $value -}} + {{- if not (kindIs "map" $elemVal) -}} + {{- if kindIs "invalid" $elemVal -}} + {{- nindent 6 $elem -}}: + {{- else if kindIs "string" $elemVal -}} + {{- nindent 6 $elem }}: {{ tpl $elemVal $ -}} + {{- else if kindIs "float64" $elemVal -}} + {{- nindent 6 $elem }}: {{ int $elemVal -}} + {{- else if kindIs "slice" $elemVal -}} + {{- nindent 6 $elem -}}: + {{- tpl (toYaml $elemVal ) $| nindent 6 -}} + {{- else -}} + {{- nindent 6 $elem }}: {{ $elemVal -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- range $elem, $elemVal := $value -}} + {{- if kindIs "map" $elemVal -}} + {{- nindent 6 $elem -}}: + {{- range $therrKey, $therrVal := $elemVal -}} + {{- if not (kindIs "map" $therrVal) -}} + {{- if kindIs "invalid" $therrVal -}} + {{- nindent 8 $therrKey -}}: + {{- else if kindIs "string" $therrVal -}} + {{- if (tpl $therrVal $ ) -}} + {{- nindent 8 $therrKey }}: {{ tpl $therrVal $ -}} + {{- else -}} + {{- nindent 8 $therrKey }}: + {{- end -}} + {{- else if kindIs "float64" $therrVal -}} + {{- nindent 8 $therrKey }}: {{ int $therrVal -}} + {{- else if kindIs "slice" $therrVal -}} + {{- nindent 8 $therrKey -}}: + {{- tpl (toYaml $therrVal ) $| nindent 8 -}} + {{- else -}} + {{- if $therrVal -}} + {{- nindent 8 $therrKey }}: {{ toYaml $therrVal -}} + {{- else -}} + {{- nindent 8 $therrKey }}: + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- range $therrKey, $therrVal := $elemVal -}} + {{- if kindIs "map" $therrVal -}} + {{- nindent 8 $therrKey -}}: + {{- range $fourKey, $fourVal := $therrVal -}} + {{- if not (kindIs "map" $fourVal) -}} + {{- if kindIs "invalid" $fourVal -}} + {{- nindent 10 $fourKey -}}: + {{- else if kindIs "string" $fourVal -}} + {{- if (tpl $fourVal $ ) -}} + {{- nindent 10 $fourKey }}: {{ tpl $fourVal $ -}} + {{- else -}} + {{- nindent 10 $fourKey }}: + {{- end -}} + {{- else if kindIs "float64" $fourVal -}} + {{- nindent 10 $fourKey }}: {{ int $fourVal -}} + {{- else if kindIs "slice" $fourVal -}} + {{- nindent 10 $fourKey -}}: + {{- tpl (toYaml $fourVal ) $| nindent 10 -}} + {{- else -}} + {{- if $fourVal -}} + {{- nindent 10 $fourKey }}: {{ toYaml $fourVal -}} + {{- else -}} + {{- nindent 10 $fourKey }}: + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- range $fourKey, $fourVal := $therrVal -}} + {{- if kindIs "map" $fourVal -}} + {{- nindent 10 $fourKey -}}: + {{- range $fiveKey, $fiveVal := $fourVal -}} + {{- if not (kindIs "map" $fiveVal) -}} + {{- if kindIs "invalid" $fiveVal -}} + {{- nindent 12 $fiveKey -}}: + {{- else if kindIs "string" $fiveVal -}} + {{- if $fiveVal -}} + {{- nindent 12 $fiveKey }}: {{ tpl $fiveVal $ -}} + {{- else -}} + {{- nindent 12 $fiveKey }}: + {{- end -}} + {{- else if kindIs "float64" $fiveVal -}} + {{- nindent 12 $fiveKey }}: {{ int $fiveVal -}} + {{- else if kindIs "slice" $fiveVal -}} + {{- nindent 12 $fiveKey -}}: + {{- tpl (toYaml $fiveVal ) $| nindent 12 -}} + {{- else -}} + {{- if $fiveVal -}} + {{- nindent 12 $fiveKey }}: {{ $fiveVal -}} + {{- else -}} + {{- nindent 12 $fiveKey }}: + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end }} + diff --git a/charts/deepflow/charts/stella-agent-ce/templates/deployment.yaml b/charts/deepflow/charts/stella-agent-ce/templates/deployment.yaml new file mode 100644 index 0000000..5c3b097 --- /dev/null +++ b/charts/deepflow/charts/stella-agent-ce/templates/deployment.yaml @@ -0,0 +1,79 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "stella-agent-ce.fullname" . }} + labels: + {{- include "stella-agent-ce.labels" . | nindent 4 }} +spec: + replicas: {{ tpl (toString .Values.replicas) . }} + selector: + matchLabels: + {{- include "stella-agent-ce.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "stella-agent-ce.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + hostNetwork: {{ tpl (toString .Values.hostNetwork) . }} + dnsPolicy: {{ tpl .Values.dnsPolicy . }} + imagePullSecrets: + {{- with .Values.global.imagePullSecrets }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.imagePullSecrets }} + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: stella-agent-ce + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ tpl .Values.image.repository . }}:{{ tpl (toString .Values.image.tag) . }}" + imagePullPolicy: {{ tpl .Values.image.pullPolicy . }} + ports: + - name: http + containerPort: 20831 + protocol: TCP + livenessProbe: + {{ toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{ toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: config + mountPath: /etc/web/df-llm-agent.yaml + subPath: df-llm-agent.yaml + volumes: + - name: config + configMap: + name: {{ include "stella-agent-ce.fullname" . }} + items: + - key: df-llm-agent.yaml + path: df-llm-agent.yaml + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + {{- include "nodeaffinity" . | indent 6 }} + {{- include "podAffinity" . | indent 6 }} + {{- include "podAntiAffinity" . | indent 6 }} + {{- if or .Values.global.tolerations .Values.tolerations }} + tolerations: + {{- if .Values.global.tolerations }} + {{- toYaml .Values.global.tolerations | nindent 8 }} + {{- end }} + {{- if .Values.tolerations }} + {{- toYaml .Values.tolerations | nindent 8 }} + {{- end }} + {{- end }} diff --git a/charts/deepflow/charts/stella-agent-ce/templates/service.yaml b/charts/deepflow/charts/stella-agent-ce/templates/service.yaml new file mode 100644 index 0000000..4b49f7f --- /dev/null +++ b/charts/deepflow/charts/stella-agent-ce/templates/service.yaml @@ -0,0 +1,47 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "stella-agent-ce.fullname" . }} + labels: + {{- include "stella-agent-ce.labels" . | nindent 4 }} +{{- if .Values.service.annotations }} + annotations: +{{ toYaml .Values.service.annotations | indent 4 }} +{{- end }} +spec: +{{- if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} +{{- end }} +{{- if .Values.service.externalIPs }} + externalIPs: +{{ toYaml .Values.service.externalIPs | indent 4 }} +{{- end }} +{{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end }} +{{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := .Values.service.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} +{{- end }} +{{- if ne .Values.service.type "ClusterIP" }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} +{{- end }} + ports: + {{- $serviceType := .Values.service.type -}} + {{- range .Values.service.ports }} + - name: {{ tpl .name $ }} + port: {{ tpl (toString .port) $ }} + targetPort: {{ tpl (toString .targetPort) $ }} + {{- if and (eq $serviceType "NodePort") (.nodePort) }} + nodePort: {{ tpl (toString .nodePort) $ }} + {{- end }} + protocol: {{ tpl .protocol $ }} + {{- end }} +{{- if .Values.service.additionalPorts }} +{{ toYaml .Values.service.additionalPorts | indent 2 }} +{{- end }} + selector: + {{- include "stella-agent-ce.selectorLabels" . | nindent 4 }} + type: "{{ .Values.service.type }}" \ No newline at end of file diff --git a/charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-configmap.yaml b/charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-configmap.yaml deleted file mode 100644 index d39a0ab..0000000 --- a/charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-configmap.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: df-llm-agent - namespace: deepflow -data: - df-llm-agent.yaml: |- - {{- toYaml .Values.configMapData | nindent 6 }} diff --git a/charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-service.yaml b/charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-service.yaml deleted file mode 100644 index 5f0e358..0000000 --- a/charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: df-llm-agent - namespace: deepflow -spec: - ports: - - port: 20831 - nodePort: 30831 - targetPort: 20831 - protocol: TCP - name: http - selector: - component: df-llm-agent - type: NodePort diff --git a/charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-statefulset.yaml b/charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-statefulset.yaml deleted file mode 100644 index 7a5af28..0000000 --- a/charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-statefulset.yaml +++ /dev/null @@ -1,60 +0,0 @@ -{{- if and (not $.Values.global.allInOneLocalStorage ) (eq ( tpl $.Values.storageConfig.generateType . ) "hostPath") (not $.Values.nodeAffinityLabelSelector) }} -{{- fail "You must set nodeAffinityLabelSelector" -}} -{{- end}} -kind: StatefulSet -apiVersion: apps/v1 -metadata: - name: df-llm-agent-deployment - namespace: deepflow - labels: - component: df-llm-agent -spec: - replicas: {{ .Values.replicas }} - serviceName: df-llm-agent - selector: - matchLabels: - component: df-llm-agent - template: - metadata: - labels: - component: df-llm-agent - spec: - hostNetwork: true - dnsPolicy: ClusterFirstWithHostNet - containers: - - name: df-llm-agent - image: "{{ tpl .Values.image.repository . }}:{{ tpl (toString .Values.image.tag) . }}" - imagePullPolicy: {{ tpl .Values.image.pullPolicy . }} - volumeMounts: - - name: debug-path - mountPath: /root/debug - - name: web-volumes-df-llm-agent - mountPath: /etc/web/df-llm-agent.yaml - subPath: df-llm-agent.yaml - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - affinity: - {{- include "nodeaffinity" . | indent 6 }} - {{- include "podAffinity" . | indent 6 }} - {{- include "podAntiAffinity" . | indent 6 }} - {{- if or .Values.global.tolerations .Values.tolerations }} - {{- end }} - volumes: - - name: web-volumes-df-llm-agent - configMap: - name: df-llm-agent - items: - - key: df-llm-agent.yaml - path: df-llm-agent.yaml - {{- if eq ( tpl .Values.storageConfig.generateType . ) "hostPath" }} - - name: debug-path - hostPath: - path: {{ tpl .Values.storageConfig.hostPath . }}/stella-agent-ce/debug/ - type: DirectoryOrCreate - {{- end }} - {{- if eq ( tpl $.Values.storageConfig.generateType . ) "persistentVolumeClaim" }} - volumeClaimTemplates: - {{- include "persistentVolumeClaim" . | indent 2 }} - {{- end }} diff --git a/charts/deepflow/charts/stella-agent-ce/values.yaml b/charts/deepflow/charts/stella-agent-ce/values.yaml index 52fcd0a..7e272cc 100644 --- a/charts/deepflow/charts/stella-agent-ce/values.yaml +++ b/charts/deepflow/charts/stella-agent-ce/values.yaml @@ -1,52 +1,120 @@ global: - allInOneLocalStorage: false - storageClass: "" + podAntiAffinityLabelSelector: [] + podAntiAffinityTermLabelSelector: [] + podAffinityLabelSelector: [] + podAffinityTermLabelSelector: [] + nodeAffinityLabelSelector: [] + nodeAffinityTermLabelSelector: [] replicas: 1 + +hostNetwork: "false" +dnsPolicy: ClusterFirst +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" +podAnnotations: {} + image: - repository: "{{ .Values.global.image.repository }}/df-llm-agent" + repository: deepflowce/deepflowio-stella-agent-ce pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. tag: latest -storageConfig: - ## persistentVolumeClaim/hostPath - ## If you use hostPath, you must configure nodeAffinityLabelSelector, otherwise your data will be lost when Pod drifts - ## 如果使用hostPath存储mysql数据,则必须配置nodeAffinityLabelSelector,避免pod漂移导致数据丢失 - type: persistentVolumeClaim - generateType: "{{ if $.Values.global.allInOneLocalStorage }}hostPath{{ else }}{{$.Values.storageConfig.type}}{{end}}" #Please ignore this - hostPath: "/opt/stella-agent-ce/debug/" - persistence: - - name: debug-path - storageClass: "{{ .Values.global.storageClass }}" - annotations: - "helm.sh/resource-policy": keep - # existingClaim: your-claim-pvc-name - accessModes: - - ReadWriteOnce - size: 50Gi -configMapData: - daemon: true - api_timeout: 500 - sql_show: false - log_file: "/var/log/df-llm-agent.log" - log_level: "info" - instance_path: "/root/df-llm-agent" - redis: - host: - - "redis" - cluster_enabled: false - port: 6379 - db: 6 - password: "password123" - mysql: - user_name: "root" - user_password: "deepflow" - host: "{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.ip}}{{ else }}{{ $.Release.Name }}-mysql{{end}}" - port: 30130 - database: "deepflow_llm" -nodeAffinityLabelSelector: - ## If you use hostPath, you must configure nodeAffinityLabelSelector, otherwise your data will be lost when Pod drifts - ## 如果使用hostPath存储stella-agent-ce数据,则必须配置nodeAffinityLabelSelector,避免pod漂移导致数据丢失 - #- matchExpressions: - # - key: kubernetes.io/hostname - # operator: In - ## values: k8s-master \ No newline at end of file + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: + # privileged: true + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: false + # runAsNonRoot: false + # runAsUser: 0 + +service: + ## Configuration for ClickHouse service + ## + annotations: {} + labels: {} + clusterIP: "" + + ## Port for ClickHouse Service to listen on + ## + + ports: + - name: tcp + port: 20831 + targetPort: 20831 + nodePort: + protocol: TCP + ## Additional ports to open for server service + additionalPorts: [] + + externalIPs: [] + loadBalancerIP: "" + loadBalancerSourceRanges: [] + + ## Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints + + externalTrafficPolicy: Cluster + + ## Service type + ## + type: ClusterIP + +readinessProbe: + httpGet: + path: /v1/health/ + port: http + failureThreshold: 10 + initialDelaySeconds: 15 + periodSeconds: 10 + successThreshold: 1 +livenessProbe: + failureThreshold: 6 + initialDelaySeconds: 15 + periodSeconds: 20 + successThreshold: 1 + httpGet: + path: /v1/health/ + port: http + timeoutSeconds: 1 + +configmap: + df-llm-agent.yaml: + daemon: true + api_timeout: 500 + sql_show: false + log_file: "/var/log/df-llm-agent.log" + log_level: "info" + instance_path: "/root/df-llm-agent" + mysql: + host: "{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.ip}}{{ else }}{{ $.Release.Name }}-mysql{{end}}:{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.port}}{{ else }}30130{{end}}" + user_name: "{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.username}}{{ else }}root{{end}}" + user_password: "{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.password}}{{ else }}{{ .Values.global.password.mysql }}{{end}}" + database: "deepflow_llm" + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +podAntiAffinityLabelSelector: [] +podAntiAffinityTermLabelSelector: [] +podAffinityLabelSelector: [] +podAffinityTermLabelSelector: [] +nodeAffinityLabelSelector: [] +nodeAffinityTermLabelSelector: [] \ No newline at end of file diff --git a/charts/deepflow/values.yaml b/charts/deepflow/values.yaml index b1707c8..28125fe 100644 --- a/charts/deepflow/values.yaml +++ b/charts/deepflow/values.yaml @@ -862,6 +862,7 @@ grafana: CLICKHOUSE_SERVER: "{{ if $.Values.global.externalClickHouse.enabled }}{{ $.Release.Name }}-external-clickhouse{{ else }}{{ $.Release.Name }}-clickhouse{{end}}" CLICKHOUSE_USER: "{{ if $.Values.global.externalClickHouse.enabled }}{{ $.Values.global.externalClickHouse.username }}{{ else }}default{{end}}" CLICKHOUSE_PASSWORD: "{{ if $.Values.global.externalClickHouse.enabled }}{{ $.Values.global.externalClickHouse.password }}{{ else }}{{ .Values.global.password.clickhouse }}{{end}}" + DEEPFLOW_AI_URL: 'http://{{ include "deepflow.fullname" . }}-stella-agent-ce:20831' ingress: enabled: false @@ -904,53 +905,119 @@ grafana: stella-agent-ce: - replicas: 1 + enabled: true + hostNetwork: "false" + dnsPolicy: ClusterFirst + imagePullSecrets: [] + nameOverride: "" + fullnameOverride: "" + podAnnotations: {} + image: - repository: "{{ .Values.global.image.repository }}/df-llm-agent" + repository: "{{ .Values.global.image.repository }}/deepflowio-stella-agent-ce" pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. tag: latest - storageConfig: - ## persistentVolumeClaim/hostPath - ## If you use hostPath, you must configure nodeAffinityLabelSelector, otherwise your data will be lost when Pod drifts - ## 如果使用hostPath存储mysql数据,则必须配置nodeAffinityLabelSelector,避免pod漂移导致数据丢失 - type: persistentVolumeClaim - generateType: "{{ if $.Values.global.allInOneLocalStorage }}hostPath{{ else }}{{$.Values.storageConfig.type}}{{end}}" #Please ignore this - hostPath: "/opt/stella-agent-ce/debug/" - persistence: - - name: debug-path - storageClass: "{{ .Values.global.storageClass }}" - annotations: - "helm.sh/resource-policy": keep - # existingClaim: your-claim-pvc-name - accessModes: - - ReadWriteOnce - size: 50Gi - configMapData: + podSecurityContext: {} + # fsGroup: 2000 + + securityContext: + # privileged: true + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: false + # runAsNonRoot: false + # runAsUser: 0 + + service: + ## Configuration for ClickHouse service + ## + annotations: {} + labels: {} + clusterIP: "" + + ## Port for ClickHouse Service to listen on + ## + + ports: + - name: tcp + port: 20831 + targetPort: 20831 + nodePort: + protocol: TCP + ## Additional ports to open for server service + additionalPorts: [] + + externalIPs: [] + loadBalancerIP: "" + loadBalancerSourceRanges: [] + + ## Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints + + externalTrafficPolicy: Cluster + + ## Service type + ## + type: ClusterIP + + readinessProbe: + httpGet: + path: /v1/health/ + port: http + failureThreshold: 10 + initialDelaySeconds: 15 + periodSeconds: 10 + successThreshold: 1 + livenessProbe: + failureThreshold: 6 + initialDelaySeconds: 15 + periodSeconds: 20 + successThreshold: 1 + httpGet: + path: /v1/health/ + port: http + timeoutSeconds: 1 + +configmap: + df-llm-agent.yaml: daemon: true api_timeout: 500 sql_show: false log_file: "/var/log/df-llm-agent.log" log_level: "info" instance_path: "/root/df-llm-agent" - redis: - host: - - "redis" - cluster_enabled: false - port: 6379 - db: 6 - password: "password123" mysql: - user_name: "root" - user_password: "deepflow" - host: "{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.ip}}{{ else }}{{ $.Release.Name }}-mysql{{end}}" - port: 30130 + host: "{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.ip}}{{ else }}{{ $.Release.Name }}-mysql{{end}}:{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.port}}{{ else }}30130{{end}}" + user_name: "{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.username}}{{ else }}root{{end}}" + user_password: "{{ if $.Values.global.externalMySQL.enabled }}{{$.Values.global.externalMySQL.password}}{{ else }}{{ .Values.global.password.mysql }}{{end}}" database: "deepflow_llm" - nodeAffinityLabelSelector: - ## If you use hostPath, you must configure nodeAffinityLabelSelector, otherwise your data will be lost when Pod drifts - ## 如果使用hostPath存储stella-agent-ce数据,则必须配置nodeAffinityLabelSelector,避免pod漂移导致数据丢失 - #- matchExpressions: - # - key: kubernetes.io/hostname - # operator: In - ## values: k8s-master + + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + nodeSelector: {} + + tolerations: [] + + podAntiAffinityLabelSelector: [] + podAntiAffinityTermLabelSelector: [] + podAffinityLabelSelector: [] + podAffinityTermLabelSelector: [] + nodeAffinityLabelSelector: [] + # - matchExpressions: + # - key: kubernetes.io/hostname + # operator: In + # values: controller + nodeAffinityTermLabelSelector: []