From 49266cab3225736b6a66e1e24547f4a38da093a0 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 23 Feb 2024 23:28:57 +0000 Subject: [PATCH] feat: helm chart affinities & resource reqs/limits --- helm/templates/service.yaml | 9 +++++++++ helm/values.yaml | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml index fb91404..a010a86 100644 --- a/helm/templates/service.yaml +++ b/helm/templates/service.yaml @@ -53,6 +53,14 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -63,6 +71,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} command: - /coder-logstream-kube + resources: {{ toYaml .Values.resources | nindent 12 }} env: - name: CODER_URL value: {{ .Values.url }} diff --git a/helm/values.yaml b/helm/values.yaml index 6a548b6..b6c7a1e 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -46,9 +46,44 @@ serviceAccount: # coder.serviceAccount.name -- The service account name name: coder-logstream-kube +# resources -- The resources to request for the Deployment. These are optional +# and are not set by default. +resources: + {} + # limits: + # cpu: 500m + # memory: 500Mi + # requests: + # cpu: 2000m + # memory: 2000Mi + # nodeSelector -- Node labels for constraining the coder-logstream pod to specific nodes. nodeSelector: {} +# affinity -- Allows specifying an affinity rule for the Deployment. +# The default rule prefers to schedule coder pods on different +# nodes, which is only applicable if coder.replicaCount is greater than 1. +affinity: {} + # podAntiAffinity: + # preferredDuringSchedulingIgnoredDuringExecution: + # - podAffinityTerm: + # labelSelector: + # matchExpressions: + # - key: app.kubernetes.io/instance: coder-logstream-kube + # operator: In + # values: + # - "true" + # topologyKey: kubernetes.io/hostname + # weight: 1 + +# tolerations -- Tolerations for tainted nodes. +# See: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +tolerations: {} + # - key: "key" + # operator: "Equal" + # value: "value" + # effect: "NoSchedule" + # labels -- The pod labels for coder-logstream-kube. See: # https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -labels: {} +labels: {} \ No newline at end of file