-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdeployment.yaml
More file actions
113 lines (109 loc) · 4.12 KB
/
deployment.yaml
File metadata and controls
113 lines (109 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "kagent-tools.fullname" . }}
namespace: {{ include "kagent-tools.namespace" . }}
labels:
{{- include "kagent-tools.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "kagent-tools.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "kagent-tools.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
affinity:
{{- with .Values.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- range . }}
- {{ toYaml . | nindent 10 | trim }}
{{- if not (hasKey . "labelSelector") }}
labelSelector:
matchLabels:
{{- include "kagent-tools.selectorLabels" $ | nindent 14 }}
{{- end }}
{{- end }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
serviceAccountName: {{ include "kagent-tools.serviceAccountName" . }}
containers:
- name: tools
command:
- /tool-server
args:
- "--port"
- "{{ .Values.service.ports.tools.targetPort }}"
- "--metrics-port"
- "{{ .Values.tools.metrics.port | default .Values.service.ports.tools.targetPort }}"
{{- if .Values.tools.enabledTools }}
- "--tools={{ join "," .Values.tools.enabledTools }}"
{{- end }}
{{- with .Values.tools.args }}
{{- toYaml . | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.tools.image.registry }}/{{ .Values.tools.image.repository }}:{{ coalesce .Values.global.tag .Values.tools.image.tag .Chart.Version }}"
imagePullPolicy: {{ .Values.tools.image.pullPolicy }}
resources:
{{- toYaml .Values.tools.resources | nindent 12 }}
env:
- name: KAGENT_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: {{ include "kagent-tools.fullname" . }}-openai
key: OPENAI_API_KEY
optional: true # if the secret is not found, the tool will not be available
- name: OTEL_TRACING_ENABLED
value: {{ .Values.otel.tracing.enabled | quote }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ .Values.otel.tracing.exporter.otlp.endpoint | quote }}
- name: OTEL_EXPORTER_OTLP_TRACES_TIMEOUT
value: {{ .Values.otel.tracing.exporter.otlp.timeout | quote }}
- name: OTEL_EXPORTER_OTLP_TRACES_INSECURE
value: {{ .Values.otel.tracing.exporter.otlp.insecure | quote }}
- name: TOKEN_PASSTHROUGH
value: {{ (index .Values.tools "k8s" | default dict).tokenPassthrough | default false | quote }}
{{- with .Values.tools.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http-tools
containerPort: {{ .Values.service.ports.tools.targetPort }}
protocol: TCP
- name: http-metrics
containerPort: {{ .Values.tools.metrics.port | default .Values.service.ports.tools.targetPort }}
protocol: TCP
readinessProbe:
tcpSocket:
port: http-tools
initialDelaySeconds: 15
periodSeconds: 15