-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fffdbf9
commit 01d33fe
Showing
8 changed files
with
257 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
apiVersion: v2 | ||
name: stella-agent-ce | ||
version: 0.1.0 |
41 changes: 41 additions & 0 deletions
41
charts/deepflow/charts/stella-agent-ce/templates/_affinity.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{{- define "nodeaffinity" }} | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
{{- include "nodeAffinityRequiredDuringScheduling" . }} | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
{{- include "nodeAffinityPreferredDuringScheduling" . }} | ||
{{- end }} | ||
|
||
{{- define "nodeAffinityRequiredDuringScheduling" }} | ||
{{- if or .Values.nodeAffinityLabelSelector .Values.global.nodeAffinityLabelSelector }} | ||
nodeSelectorTerms: | ||
{{- range $matchExpressionsIndex, $matchExpressionsItem := .Values.nodeAffinityLabelSelector }} | ||
- matchExpressions: | ||
{{- range $Index, $item := $matchExpressionsItem.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 $matchExpressionsIndex, $matchExpressionsItem := .Values.global.nodeAffinityLabelSelector }} | ||
- matchExpressions: | ||
{{- range $Index, $item := $matchExpressionsItem.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 }} | ||
{{- end }} |
24 changes: 24 additions & 0 deletions
24
charts/deepflow/charts/stella-agent-ce/templates/_volumeClaimTemplates.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{- /* 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 }} |
8 changes: 8 additions & 0 deletions
8
charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: df-llm-agent | ||
namespace: deepflow | ||
data: | ||
df-llm-agent.yaml: |- | ||
{{- toYaml .Values.configMapData | nindent 6 }} |
15 changes: 15 additions & 0 deletions
15
charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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 |
60 changes: 60 additions & 0 deletions
60
charts/deepflow/charts/stella-agent-ce/templates/stella-agent-ce-statefulset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{- 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
global: | ||
allInOneLocalStorage: false | ||
storageClass: "" | ||
|
||
replicas: 1 | ||
image: | ||
repository: "{{ .Values.global.image.repository }}/df-llm-agent" | ||
pullPolicy: Always | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters