-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathdeployment_test.yaml
More file actions
158 lines (146 loc) · 4.29 KB
/
deployment_test.yaml
File metadata and controls
158 lines (146 loc) · 4.29 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
suite: test controller deployment
templates:
- deployment.yaml
tests:
- it: should render deployment with default values
template: deployment.yaml
asserts:
- isKind:
of: Deployment
- equal:
path: metadata.name
value: RELEASE-NAME
- equal:
path: spec.replicas
value: 1
- hasDocuments:
count: 1
- it: should render deployment with custom replica count
template: deployment.yaml
set:
replicaCount: 3
asserts:
- equal:
path: spec.replicas
value: 3
- it: should have correct container image
template: deployment.yaml
asserts:
- equal:
path: spec.template.spec.containers[0].name
value: tools
pattern: "^cr\\.kagent\\.dev/kagent-dev/kagent/tools:.+"
- it: should use global tag when set
template: deployment.yaml
set:
tools:
image:
tag: "v1.0.0"
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: ghcr.io/kagent-dev/kagent/tools:v1.0.0
- it: should have correct resources
template: deployment.yaml
asserts:
- equal:
path: spec.template.spec.containers[0].resources.requests.cpu
value: 100m
- equal:
path: spec.template.spec.containers[0].resources.requests.memory
value: 128Mi
- equal:
path: spec.template.spec.containers[0].resources.limits.cpu
value: 1000m
- equal:
path: spec.template.spec.containers[0].resources.limits.memory
value: 512Mi
- it: should have correct service account name
template: deployment.yaml
asserts:
- equal:
path: spec.template.spec.serviceAccountName
value: RELEASE-NAME
- it: should have correct container port
template: deployment.yaml
asserts:
- equal:
path: spec.template.spec.containers[0].ports[0].containerPort
value: 8084
- it: should set nodeSelector
set:
nodeSelector:
role: AI
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
role: AI
- it: should set tolerations
set:
tolerations:
- key: role
operator: Equal
value: AI
effect: NoSchedule
asserts:
- contains:
any: true
path: spec.template.spec.tolerations
content:
key: role
value: AI
effect: NoSchedule
operator: Equal
- it: should render custom node affinity from values
set:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/e2e-az-name
operator: In
values:
- e2e-az1
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/e2e-az-name
operator: In
values:
- e2e-az1
- it: should render topologySpreadConstraints with labelSelector fallback
set:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: zone
whenUnsatisfiable: ScheduleAnyway
asserts:
- equal:
path: spec.template.spec.topologySpreadConstraints[0].topologyKey
value: zone
- equal:
path: spec.template.spec.topologySpreadConstraints[0].labelSelector.matchLabels
value:
app.kubernetes.io/name: kagent-tools
app.kubernetes.io/instance: RELEASE-NAME
- it: should enable automountServiceAccountToken by default
template: deployment.yaml
asserts:
- equal:
path: spec.template.spec.automountServiceAccountToken
value: true
- it: should disable automountServiceAccountToken when configured
template: deployment.yaml
set:
automountServiceAccountToken: false
asserts:
- equal:
path: spec.template.spec.automountServiceAccountToken
value: false