From 3c572c53b72c5bdc6947dd0350c199db7ca8d956 Mon Sep 17 00:00:00 2001 From: Plamen Panev Date: Tue, 28 May 2024 15:58:52 +0300 Subject: [PATCH 1/2] - add node selector option - add descriptions - use properties only - fix description - add description - fix description --- README.helm.md | 2 ++ helm/korifi/api/deployment.yaml | 8 ++++++++ helm/korifi/controllers/deployment.yaml | 8 ++++++++ helm/korifi/values.schema.json | 19 +++++++++++++++++++ helm/korifi/values.yaml | 2 ++ 5 files changed, 39 insertions(+) diff --git a/README.helm.md b/README.helm.md index 0b03ae1c1..f98209f72 100644 --- a/README.helm.md +++ b/README.helm.md @@ -104,6 +104,7 @@ Here are all the values that can be set for the chart: - `logLevel` (_String_): Sets level of logging for api and controllers components. Can be 'info' or 'debug'. - `networking`: Networking configuration - `gatewayClass` (_String_): The name of the GatewayClass Korifi Gateway references +- `nodeSelector`: Node labels for korifi-api and korifi-controllers pod assignment. - `reconcilers`: - `app` (_String_): ID of the workload runner to set on all `AppWorkload` objects. Defaults to `statefulset-runner`. - `build` (_String_): ID of the image builder to set on all `BuildWorkload` objects. Defaults to `kpack-image-builder`. @@ -124,3 +125,4 @@ Here are all the values that can be set for the chart: - `memory` (_String_): Memory request. - `temporarySetPodSeccompProfile` (_Boolean_): Sets the pod .spec.securityContext.seccompProfile to RuntimeDefault. Setting this flag to true will cause a restart of all previously running pods. - `systemImagePullSecrets` (_Array_): List of `Secret` names to be used when pulling Korifi system images from private registries +- `tolerations` (_Array_): Pod tolerations for taints. diff --git a/helm/korifi/api/deployment.yaml b/helm/korifi/api/deployment.yaml index b5e855764..18fee367d 100644 --- a/helm/korifi/api/deployment.yaml +++ b/helm/korifi/api/deployment.yaml @@ -57,6 +57,14 @@ spec: {{- end }} {{- include "korifi.podSecurityContext" . | indent 6 }} serviceAccountName: korifi-api-system-serviceaccount +{{- if .Values.nodeSelector }} + nodeSelector: + {{ toYaml .Values.nodeSelector | indent 8 }} +{{- end }} +{{- if .Values.tolerations }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} +{{- end }} volumes: - configMap: name: korifi-api-config diff --git a/helm/korifi/controllers/deployment.yaml b/helm/korifi/controllers/deployment.yaml index 05c7dfb16..fc78f4777 100644 --- a/helm/korifi/controllers/deployment.yaml +++ b/helm/korifi/controllers/deployment.yaml @@ -76,6 +76,14 @@ spec: readOnly: true {{- include "korifi.podSecurityContext" . | indent 6 }} serviceAccountName: korifi-controllers-controller-manager +{{- if .Values.nodeSelector }} + nodeSelector: + {{ toYaml .Values.nodeSelector | indent 8 }} +{{- end }} +{{- if .Values.tolerations }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} +{{- end }} terminationGracePeriodSeconds: 10 volumes: - name: cert diff --git a/helm/korifi/values.schema.json b/helm/korifi/values.schema.json index 2bca83943..6431c6204 100644 --- a/helm/korifi/values.schema.json +++ b/helm/korifi/values.schema.json @@ -86,6 +86,25 @@ }, "required": ["memoryMB", "diskMB", "buildCacheMB"] }, + "nodeSelector": { + "description": "Node labels for korifi-api and korifi-controllers pod assignment.", + "type": "object", + "properties": {} + }, + "tolerations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { "type": "string" }, + "operator": { "type": "string" }, + "value": { "type": "string" }, + "effect": { "type": "string" } + }, + "required": ["key", "operator", "effect"] + }, + "description": "Pod tolerations for taints." + }, "api": { "properties": { "include": { diff --git a/helm/korifi/values.yaml b/helm/korifi/values.yaml index ae3648416..7af5d0ebf 100644 --- a/helm/korifi/values.yaml +++ b/helm/korifi/values.yaml @@ -9,6 +9,8 @@ containerRegistrySecrets: eksContainerRegistryRoleARN: "" containerRegistryCACertSecret: systemImagePullSecrets: [] +tolerations: [] +nodeSelector: {} reconcilers: build: kpack-image-builder From c77d8ec7631a63698c6e3f6b6befae4010bc30fe Mon Sep 17 00:00:00 2001 From: Plamen Panev Date: Thu, 30 May 2024 12:28:37 +0300 Subject: [PATCH 2/2] move under api and controllers --- README.helm.md | 6 ++- helm/korifi/api/deployment.yaml | 8 ++-- helm/korifi/controllers/deployment.yaml | 8 ++-- helm/korifi/values.schema.json | 57 ++++++++++++++++--------- helm/korifi/values.yaml | 10 +++-- 5 files changed, 56 insertions(+), 33 deletions(-) diff --git a/README.helm.md b/README.helm.md index f98209f72..620e970d6 100644 --- a/README.helm.md +++ b/README.helm.md @@ -36,6 +36,7 @@ Here are all the values that can be set for the chart: - `lifecycle`: Default lifecycle for apps. - `stack` (_String_): Stack. - `type` (_String_): Lifecycle type (only `buildpack` accepted currently). + - `nodeSelector`: Node labels for korifi-api pod assignment. - `replicas` (_Integer_): Number of replicas. - `resources`: [`ResourceRequirements`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#resourcerequirements-v1-core) for the API. - `limits`: Resource limits. @@ -44,6 +45,7 @@ Here are all the values that can be set for the chart: - `requests`: Resource requests. - `cpu` (_String_): CPU request. - `memory` (_String_): Memory request. + - `tolerations` (_Array_): Korifi-api pod tolerations for taints. - `userCertificateExpirationWarningDuration` (_String_): Issue a warning if the user certificate provided for login has a long expiry. See [`time.ParseDuration`](https://pkg.go.dev/time#ParseDuration) for details on the format. - `containerRegistrySecret` (_String_): Deprecated in favor of containerRegistrySecrets. - `containerRegistrySecrets` (_Array_): List of `Secret` names to use when pushing or pulling from package, droplet and kpack builder repositories. Required if eksContainerRegistryRoleARN not set. Ignored if eksContainerRegistryRoleARN is set. @@ -54,6 +56,7 @@ Here are all the values that can be set for the chart: - `maxRetainedBuildsPerApp` (_Integer_): How many staged builds to keep, excluding the app's current droplet. Older staged builds will be deleted, along with their corresponding container images. - `maxRetainedPackagesPerApp` (_Integer_): How many 'ready' packages to keep, excluding the package associated with the app's current droplet. Older 'ready' packages will be deleted, along with their corresponding container images. - `namespaceLabels`: Key-value pairs that are going to be set as labels on the namespaces created by Korifi. + - `nodeSelector`: Node labels for korifi-controllers pod assignment. - `processDefaults`: - `diskQuotaMB` (_Integer_): Default disk quota for the `web` process. - `memoryMB` (_Integer_): Default memory limit for the `web` process. @@ -66,6 +69,7 @@ Here are all the values that can be set for the chart: - `cpu` (_String_): CPU request. - `memory` (_String_): Memory request. - `taskTTL` (_String_): How long before the `CFTask` object is deleted after the task has completed. See [`time.ParseDuration`](https://pkg.go.dev/time#ParseDuration) for details on the format, an additional `d` suffix for days is supported. + - `tolerations` (_Array_): Korifi-controllers pod tolerations for taints. - `workloadsTLSSecret` (_String_): TLS secret used when setting up an app routes. - `debug` (_Boolean_): Enables remote debugging with [Delve](https://github.com/go-delve/delve). - `defaultAppDomainName` (_String_): Base domain name for application URLs. @@ -104,7 +108,6 @@ Here are all the values that can be set for the chart: - `logLevel` (_String_): Sets level of logging for api and controllers components. Can be 'info' or 'debug'. - `networking`: Networking configuration - `gatewayClass` (_String_): The name of the GatewayClass Korifi Gateway references -- `nodeSelector`: Node labels for korifi-api and korifi-controllers pod assignment. - `reconcilers`: - `app` (_String_): ID of the workload runner to set on all `AppWorkload` objects. Defaults to `statefulset-runner`. - `build` (_String_): ID of the image builder to set on all `BuildWorkload` objects. Defaults to `kpack-image-builder`. @@ -125,4 +128,3 @@ Here are all the values that can be set for the chart: - `memory` (_String_): Memory request. - `temporarySetPodSeccompProfile` (_Boolean_): Sets the pod .spec.securityContext.seccompProfile to RuntimeDefault. Setting this flag to true will cause a restart of all previously running pods. - `systemImagePullSecrets` (_Array_): List of `Secret` names to be used when pulling Korifi system images from private registries -- `tolerations` (_Array_): Pod tolerations for taints. diff --git a/helm/korifi/api/deployment.yaml b/helm/korifi/api/deployment.yaml index 18fee367d..914ff3a28 100644 --- a/helm/korifi/api/deployment.yaml +++ b/helm/korifi/api/deployment.yaml @@ -57,13 +57,13 @@ spec: {{- end }} {{- include "korifi.podSecurityContext" . | indent 6 }} serviceAccountName: korifi-api-system-serviceaccount -{{- if .Values.nodeSelector }} +{{- if .Values.api.nodeSelector }} nodeSelector: - {{ toYaml .Values.nodeSelector | indent 8 }} + {{ toYaml .Values.api.nodeSelector | indent 8 }} {{- end }} -{{- if .Values.tolerations }} +{{- if .Values.api.tolerations }} tolerations: - {{- toYaml .Values.tolerations | nindent 8 }} + {{- toYaml .Values.api.tolerations | nindent 8 }} {{- end }} volumes: - configMap: diff --git a/helm/korifi/controllers/deployment.yaml b/helm/korifi/controllers/deployment.yaml index fc78f4777..82eaff4ff 100644 --- a/helm/korifi/controllers/deployment.yaml +++ b/helm/korifi/controllers/deployment.yaml @@ -76,13 +76,13 @@ spec: readOnly: true {{- include "korifi.podSecurityContext" . | indent 6 }} serviceAccountName: korifi-controllers-controller-manager -{{- if .Values.nodeSelector }} +{{- if .Values.controllers.nodeSelector }} nodeSelector: - {{ toYaml .Values.nodeSelector | indent 8 }} + {{ toYaml .Values.controllers.nodeSelector | indent 8 }} {{- end }} -{{- if .Values.tolerations }} +{{- if .Values.controllers.tolerations }} tolerations: - {{- toYaml .Values.tolerations | nindent 8 }} + {{- toYaml .Values.controllers.tolerations | nindent 8 }} {{- end }} terminationGracePeriodSeconds: 10 volumes: diff --git a/helm/korifi/values.schema.json b/helm/korifi/values.schema.json index 6431c6204..591b0b623 100644 --- a/helm/korifi/values.schema.json +++ b/helm/korifi/values.schema.json @@ -86,31 +86,31 @@ }, "required": ["memoryMB", "diskMB", "buildCacheMB"] }, - "nodeSelector": { - "description": "Node labels for korifi-api and korifi-controllers pod assignment.", - "type": "object", - "properties": {} - }, - "tolerations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { "type": "string" }, - "operator": { "type": "string" }, - "value": { "type": "string" }, - "effect": { "type": "string" } - }, - "required": ["key", "operator", "effect"] - }, - "description": "Pod tolerations for taints." - }, "api": { "properties": { "include": { "description": "Deploy the API component.", "type": "boolean" }, + "nodeSelector": { + "description": "Node labels for korifi-api pod assignment.", + "type": "object", + "properties": {} + }, + "tolerations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { "type": "string" }, + "operator": { "type": "string" }, + "value": { "type": "string" }, + "effect": { "type": "string" } + }, + "required": ["key", "operator", "effect"] + }, + "description": "Korifi-api pod tolerations for taints." + }, "replicas": { "description": "Number of replicas.", "type": "integer" @@ -276,6 +276,25 @@ "description": "Number of replicas.", "type": "integer" }, + "nodeSelector": { + "description": "Node labels for korifi-controllers pod assignment.", + "type": "object", + "properties": {} + }, + "tolerations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { "type": "string" }, + "operator": { "type": "string" }, + "value": { "type": "string" }, + "effect": { "type": "string" } + }, + "required": ["key", "operator", "effect"] + }, + "description": "Korifi-controllers pod tolerations for taints." + }, "resources": { "description": "[`ResourceRequirements`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#resourcerequirements-v1-core) for the API.", "type": "object", diff --git a/helm/korifi/values.yaml b/helm/korifi/values.yaml index 7af5d0ebf..29dba140a 100644 --- a/helm/korifi/values.yaml +++ b/helm/korifi/values.yaml @@ -9,8 +9,6 @@ containerRegistrySecrets: eksContainerRegistryRoleARN: "" containerRegistryCACertSecret: systemImagePullSecrets: [] -tolerations: [] -nodeSelector: {} reconcilers: build: kpack-image-builder @@ -25,7 +23,9 @@ api: include: true image: cloudfoundry/korifi-api:latest - + + nodeSelector: {} + tolerations: [] replicas: 1 resources: requests: @@ -66,7 +66,9 @@ api: controllers: image: cloudfoundry/korifi-controllers:latest - + + nodeSelector: {} + tolerations: [] replicas: 1 resources: limits: