|
58 | 58 | "kind" ($k8sProviderConfigRef.kind | default "ProviderConfig") |
59 | 59 | }} |
60 | 60 |
|
| 61 | +# ============================================================================== |
| 62 | +# NodePool configuration |
| 63 | +# ============================================================================== |
| 64 | +{{- $nodePoolSpec := $spec.nodePool | default dict }} |
| 65 | +{{- $nodePoolEnabled := false }} |
| 66 | +{{- if hasKey $nodePoolSpec "enabled" }} |
| 67 | + {{- $nodePoolEnabled = $nodePoolSpec.enabled }} |
| 68 | +{{- end }} |
| 69 | +{{- $nodePoolName := $nodePoolSpec.name | default "hops-knative" }} |
| 70 | +{{- $nodePoolNodeClassName := $nodePoolSpec.nodeClassName | default "hops-default" }} |
| 71 | +{{- $nodePoolLimits := $nodePoolSpec.limits | default (dict "nodes" 10) }} |
| 72 | +{{- $nodePoolRequirements := $nodePoolSpec.requirements | default (list |
| 73 | + (dict "key" "karpenter.sh/capacity-type" "operator" "In" "values" (list "spot" "on-demand")) |
| 74 | + (dict "key" "eks.amazonaws.com/instance-category" "operator" "In" "values" (list "c" "m" "r")) |
| 75 | + (dict "key" "eks.amazonaws.com/instance-generation" "operator" "Gt" "values" (list "4")) |
| 76 | + (dict "key" "eks.amazonaws.com/instance-memory" "operator" "Gt" "values" (list "7999")) |
| 77 | + (dict "key" "eks.amazonaws.com/instance-cpu" "operator" "Gt" "values" (list "1")) |
| 78 | + (dict "key" "kubernetes.io/arch" "operator" "In" "values" (list "amd64")) |
| 79 | + (dict "key" "kubernetes.io/os" "operator" "In" "values" (list "linux")) |
| 80 | +) }} |
| 81 | +{{- $nodePoolDisruption := $nodePoolSpec.disruption | default (dict "consolidationPolicy" "WhenEmptyOrUnderutilized" "consolidateAfter" "60s") }} |
| 82 | +{{- $nodePoolTaintKey := "knative" }} |
| 83 | +{{- $nodePoolTaintValue := "true" }} |
| 84 | +{{- $nodePoolNodeSelector := dict }} |
| 85 | +{{- $nodePoolTolerations := list }} |
| 86 | +{{- $nodePoolAffinity := dict }} |
| 87 | +{{- if $nodePoolEnabled }} |
| 88 | + {{- $nodePoolNodeSelector = dict "workload-type" "knative" }} |
| 89 | + {{- $nodePoolTolerations = list (dict "key" $nodePoolTaintKey "operator" "Equal" "value" $nodePoolTaintValue "effect" "NoSchedule") }} |
| 90 | + {{- $nodePoolAffinity = dict "nodeAffinity" (dict "requiredDuringSchedulingIgnoredDuringExecution" (dict "nodeSelectorTerms" (list (dict "matchExpressions" (list (dict "key" "workload-type" "operator" "In" "values" (list "knative"))))))) }} |
| 91 | +{{- end }} |
| 92 | + |
61 | 93 | # ============================================================================== |
62 | 94 | # Per-component defaults |
63 | 95 | # ============================================================================== |
|
149 | 181 | (dict "URL" "https://github.com/knative-extensions/net-gateway-api/releases/download/knative-v1.21.0/release.yaml") |
150 | 182 | ) |
151 | 183 | }} |
| 184 | +{{- $servingDeployments := list }} |
| 185 | +{{- range $deploymentDefaults := list |
| 186 | + (dict "name" "activator" "container" "activator" "cpu" "15m" "memory" "100Mi") |
| 187 | + (dict "name" "autoscaler" "container" "autoscaler" "cpu" "15m" "memory" "100Mi") |
| 188 | + (dict "name" "autoscaler-hpa" "container" "autoscaler-hpa" "cpu" "15m" "memory" "100Mi") |
| 189 | + (dict "name" "controller" "container" "controller" "cpu" "15m" "memory" "100Mi") |
| 190 | + (dict "name" "webhook" "container" "webhook" "cpu" "15m" "memory" "100Mi") |
| 191 | + (dict "name" "net-gateway-api-controller" "container" "controller" "cpu" "15m" "memory" "100Mi") |
| 192 | + (dict "name" "net-gateway-api-webhook" "container" "webhook" "cpu" "15m" "memory" "100Mi") |
| 193 | + (dict "name" "net-istio-controller" "container" "controller" "cpu" "15m" "memory" "100Mi") |
| 194 | + (dict "name" "net-istio-webhook" "container" "webhook" "cpu" "15m" "memory" "100Mi") |
| 195 | +}} |
| 196 | + {{- $deployment := dict |
| 197 | + "name" $deploymentDefaults.name |
| 198 | + "resources" (list |
| 199 | + (dict |
| 200 | + "container" $deploymentDefaults.container |
| 201 | + "requests" (dict "cpu" $deploymentDefaults.cpu "memory" $deploymentDefaults.memory) |
| 202 | + "limits" (dict "memory" "256Mi") |
| 203 | + ) |
| 204 | + ) |
| 205 | + }} |
| 206 | + {{- if $nodePoolEnabled }} |
| 207 | + {{- $_ := set $deployment "nodeSelector" $nodePoolNodeSelector }} |
| 208 | + {{- $_ := set $deployment "tolerations" $nodePoolTolerations }} |
| 209 | + {{- end }} |
| 210 | + {{- $servingDeployments = append $servingDeployments $deployment }} |
| 211 | +{{- end }} |
| 212 | +{{- $_ := set $natsKnServingDefaults "deployments" $servingDeployments }} |
152 | 213 | {{- $servingSpec := merge ($knServing.spec | default dict) $natsKnServingDefaults }} |
153 | 214 |
|
154 | 215 | # ============================================================================== |
|
193 | 254 | "container" (dict |
194 | 255 | "merge" (dict |
195 | 256 | "resources" (dict |
196 | | - "requests" (dict "cpu" "100m" "memory" "256Mi") |
| 257 | + "requests" (dict "cpu" "11m" "memory" "50Mi") |
197 | 258 | "limits" (dict "cpu" "500m" "memory" "512Mi") |
198 | 259 | ) |
199 | 260 | ) |
200 | 261 | ) |
201 | 262 | "reloader" (dict |
202 | 263 | "merge" (dict |
203 | 264 | "resources" (dict |
204 | | - "requests" (dict "cpu" "10m" "memory" "32Mi") |
| 265 | + "requests" (dict "cpu" "11m" "memory" "50Mi") |
205 | 266 | "limits" (dict "cpu" "50m" "memory" "64Mi") |
206 | 267 | ) |
207 | 268 | ) |
208 | 269 | ) |
| 270 | + "natsBox" (dict |
| 271 | + "container" (dict |
| 272 | + "merge" (dict |
| 273 | + "resources" (dict |
| 274 | + "requests" (dict "cpu" "15m" "memory" "100Mi") |
| 275 | + "limits" (dict "cpu" "100m" "memory" "256Mi") |
| 276 | + ) |
| 277 | + ) |
| 278 | + ) |
| 279 | + ) |
209 | 280 | }} |
| 281 | +{{- if $nodePoolEnabled }} |
| 282 | + {{- $_ := set $natsDefaultValues "podTemplate" (dict |
| 283 | + "merge" (dict |
| 284 | + "spec" (dict |
| 285 | + "nodeSelector" $nodePoolNodeSelector |
| 286 | + "tolerations" $nodePoolTolerations |
| 287 | + ) |
| 288 | + ) |
| 289 | + ) }} |
| 290 | +{{- end }} |
210 | 291 | {{- $natsValues := mergeOverwrite (deepCopy $natsDefaultValues) ($nats.values | default dict) }} |
211 | 292 |
|
212 | 293 | # ============================================================================== |
|
216 | 297 | # mTLS at the node level — eventing doesn't need to know about the mesh. |
217 | 298 | {{- /* eventing-webhook ships with a 200Mi limit that OOMKills under modest |
218 | 299 | ApiServerSource / Trigger reconcile load. Bump to 512Mi so it stays up. */}} |
219 | | -{{- $eventingDefaults := dict |
220 | | - "config" dict |
221 | | - "deployments" (list |
222 | | - (dict |
223 | | - "name" "eventing-webhook" |
224 | | - "resources" (list |
225 | | - (dict |
226 | | - "container" "eventing-webhook" |
227 | | - "requests" (dict "memory" "100Mi") |
228 | | - "limits" (dict "memory" "512Mi") |
229 | | - ) |
| 300 | +{{- $eventingDeployments := list }} |
| 301 | +{{- range $deployment := list |
| 302 | + (dict "name" "eventing-controller" "container" "eventing-controller" "cpu" "15m" "memory" "284Mi" "limitMemory" "512Mi") |
| 303 | + (dict "name" "eventing-webhook" "container" "eventing-webhook" "cpu" "15m" "memory" "309Mi" "limitMemory" "512Mi") |
| 304 | + (dict "name" "imc-controller" "container" "controller" "cpu" "23m" "memory" "100Mi" "limitMemory" "256Mi") |
| 305 | + (dict "name" "imc-dispatcher" "container" "dispatcher" "cpu" "15m" "memory" "100Mi" "limitMemory" "256Mi") |
| 306 | + (dict "name" "job-sink" "container" "job-sink" "cpu" "15m" "memory" "100Mi" "limitMemory" "256Mi") |
| 307 | + (dict "name" "mt-broker-controller" "container" "mt-broker-controller" "cpu" "15m" "memory" "100Mi" "limitMemory" "256Mi") |
| 308 | + (dict "name" "mt-broker-filter" "container" "filter" "cpu" "15m" "memory" "100Mi" "limitMemory" "256Mi") |
| 309 | + (dict "name" "mt-broker-ingress" "container" "ingress" "cpu" "15m" "memory" "100Mi" "limitMemory" "256Mi") |
| 310 | + (dict "name" "request-reply" "container" "request-reply" "cpu" "15m" "memory" "100Mi" "limitMemory" "256Mi") |
| 311 | +}} |
| 312 | + {{- $eventingDeployment := dict |
| 313 | + "name" $deployment.name |
| 314 | + "resources" (list |
| 315 | + (dict |
| 316 | + "container" $deployment.container |
| 317 | + "requests" (dict "cpu" $deployment.cpu "memory" $deployment.memory) |
| 318 | + "limits" (dict "memory" $deployment.limitMemory) |
230 | 319 | ) |
231 | 320 | ) |
232 | | - ) |
| 321 | + }} |
| 322 | + {{- if $nodePoolEnabled }} |
| 323 | + {{- $_ := set $eventingDeployment "nodeSelector" $nodePoolNodeSelector }} |
| 324 | + {{- $_ := set $eventingDeployment "tolerations" $nodePoolTolerations }} |
| 325 | + {{- end }} |
| 326 | + {{- $eventingDeployments = append $eventingDeployments $eventingDeployment }} |
| 327 | +{{- end }} |
| 328 | +{{- $eventingDefaults := dict |
| 329 | + "config" dict |
| 330 | + "deployments" $eventingDeployments |
233 | 331 | }} |
234 | 332 | {{- if $natsEnabled }} |
235 | 333 | {{- $natsNs := $nats.namespace | default "nats" }} |
|
257 | 355 | "autoTls" (dict "enabled" $autoTlsEnabled "namespaceSelector" $autoTlsSelector) |
258 | 356 | "helmProviderConfigRef" $helmProviderConfigRef |
259 | 357 | "kubernetesProviderConfigRef" $k8sProviderConfigRef |
| 358 | + "nodePool" (dict |
| 359 | + "enabled" $nodePoolEnabled |
| 360 | + "name" $nodePoolName |
| 361 | + "nodeClassName" $nodePoolNodeClassName |
| 362 | + "limits" $nodePoolLimits |
| 363 | + "requirements" $nodePoolRequirements |
| 364 | + "disruption" $nodePoolDisruption |
| 365 | + "taintKey" $nodePoolTaintKey |
| 366 | + "taintValue" $nodePoolTaintValue |
| 367 | + "nodeSelector" $nodePoolNodeSelector |
| 368 | + "tolerations" $nodePoolTolerations |
| 369 | + "affinity" $nodePoolAffinity |
| 370 | + ) |
260 | 371 | "knativeOperator" (dict |
261 | 372 | "name" ($knOp.name | default "knative-operator") |
262 | 373 | "namespace" ($knOp.namespace | default "knative-operator") |
|
0 commit comments