From cfbcf65e8097ed689ca52788f23540eedfed05d4 Mon Sep 17 00:00:00 2001 From: Mitanshu Dodia Date: Thu, 5 Dec 2024 16:15:28 +0530 Subject: [PATCH 1/4] Added node selector for amd in buildkit service helm chart --- charts/tfy-buildkitd-service/Chart.yaml | 2 +- charts/tfy-buildkitd-service/templates/_helpers.tpl | 9 +++++++++ charts/tfy-buildkitd-service/templates/statefulset.yaml | 4 +--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/charts/tfy-buildkitd-service/Chart.yaml b/charts/tfy-buildkitd-service/Chart.yaml index 424dcf487..486bb6f5c 100644 --- a/charts/tfy-buildkitd-service/Chart.yaml +++ b/charts/tfy-buildkitd-service/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: tfy-buildkitd-service description: Buildkitd service chart type: application -version: 0.2.2-rc.1 +version: 0.2.2-rc.2 appVersion: "0.16.0" maintainers: - name: truefoundry diff --git a/charts/tfy-buildkitd-service/templates/_helpers.tpl b/charts/tfy-buildkitd-service/templates/_helpers.tpl index 59bba161c..698ed7160 100644 --- a/charts/tfy-buildkitd-service/templates/_helpers.tpl +++ b/charts/tfy-buildkitd-service/templates/_helpers.tpl @@ -60,3 +60,12 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* + Merge nodeSelector + */}} +{{- define "buildkitd-service.nodeSelector" -}} +{{- $defaultNodeSelector := dict "kubernetes.io/arch" "amd64" }} +{{- $mergedNodeSelector := merge $defaultNodeSelector .Values.nodeSelector }} +{{- toYaml $mergedNodeSelector }} +{{- end }} diff --git a/charts/tfy-buildkitd-service/templates/statefulset.yaml b/charts/tfy-buildkitd-service/templates/statefulset.yaml index fe14e46e4..cceb7ddd1 100644 --- a/charts/tfy-buildkitd-service/templates/statefulset.yaml +++ b/charts/tfy-buildkitd-service/templates/statefulset.yaml @@ -131,10 +131,8 @@ spec: {{- with .Values.extraVolumes }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.nodeSelector }} nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} + {{- include "buildkitd-service.nodeSelector" . | nindent 8 }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} From 67473c538ec94e57170cfd14ee3f84d5e6f5a581 Mon Sep 17 00:00:00 2001 From: mitanshudodia Date: Thu, 5 Dec 2024 10:46:09 +0000 Subject: [PATCH 2/4] Update README.md with readme-generator-for-helm Signed-off-by: mitanshudodia --- charts/tfy-buildkitd-service/README.md | 39 +++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/charts/tfy-buildkitd-service/README.md b/charts/tfy-buildkitd-service/README.md index 354549e80..4eb78c653 100644 --- a/charts/tfy-buildkitd-service/README.md +++ b/charts/tfy-buildkitd-service/README.md @@ -3,7 +3,44 @@ Tfy-buildkitd-service is a Helm chart provided by TrueFoundry that facilitates t ## Parameters -########## Parameters for tfyBuildkitdService +########### Parameters for tfyBuildkitdService + +| Name | Description | Value | +| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------- | +| `replicaCount` | Number of replicas of Value kept for future use, kept 1 | `1` | +| `image.repository` | tfyBuildkitdService repository | `moby/buildkit` | +| `image.pullPolicy` | Pull policy for tfyBuildkitdService | `IfNotPresent` | +| `image.tag` | Image tag whose default is the chart appVersion. | `v0.16.0` | +| `storage.enabled` | Bool to enable storage for tfyBuildkitdService | `true` | +| `storage.accessModes` | Access mode for tfyBuildkitdService | `["ReadWriteOnce"]` | +| `storage.storageClassName` | Storage class name for tfyBuildkitdService | `""` | +| `storage.size` | Size of the storage for tfyBuildkitdService | `200Gi` | +| `imagePullSecrets` | Secrets to pull images | `[]` | +| `nameOverride` | String to override partial name passed in helm install command | `""` | +| `fullnameOverride` | String to override full name passed in helm install command | `""` | +| `serviceAccount.create` | Bool to enable serviceAccount creation | `true` | +| `serviceAccount.annotations` | Annotations to add to the serviceAccount | `{}` | +| `serviceAccount.name` | Name of the serviceAccount to use. If not set and create is true, a name is generated using the fullname template | `""` | +| `podAnnotations` | Annotations to be added to the pod | `{}` | +| `podSecurityContext` | Security context for the pod | `{}` | +| `securityContext.privileged` | Security Context for the tfyBuildkitdServiceProxy container | `true` | +| `service.type` | Type for tfyBuildkitdService Service | `ClusterIP` | +| `service.port` | Port for tfyBuildkitdService service | `1234` | +| `resources.limits.cpu` | CPU resource limits for tfyBuildkitdService container. | `2500m` | +| `resources.limits.memory` | Memory Resource limits for tfyBuildkitdService container. | `8Gi` | +| `resources.limits.ephemeral-storage` | Ephemeral Storage limits for tfyBuildkitdService container. | `100Mi` | +| `resources.requests.cpu` | CPU resource requests for tfyBuildkitdService container. | `2500m` | +| `resources.requests.memory` | Memory Resource requests for tfyBuildkitdService container. | `8Gi` | +| `resources.requests.ephemeral-storage` | Ephemeral Storage requests for tfyBuildkitdService container. | `100Mi` | +| `extraVolumes` | List of Volumes to attach to tfyBuildkitdService container | `[]` | +| `extraVolumeMounts` | List of Volume Mounts to attach to tfyBuildkitdService container | `[]` | +| `extraEnvs` | List of Environment Variables to attach to tfyBuildkitdService container | `[]` | +| `nodeSelector` | Parameters to select for scheduling of pod on a node | `{}` | +| `tolerations` | Taints that pod can tolerate | `[]` | +| `affinity` | Affinity rules for pod scheduling on a node | `{}` | +| `tls.buildkitDaemonCertsSecretName` | Name of secret containing the buildkit daemon certs | `tfy-buildkit-daemon-certs` | +| `tls.buildkitClientCertsSecretName` | Name of secret containing the buildkit client certs | `tfy-buildkit-client-certs` | +| `tls.enabled` | Enable TLS for buildkitd | `false` | | Name | Description | Value | | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------- | From 67d1f2605d4914bfe5dbc78f698d5b28cc31f7af Mon Sep 17 00:00:00 2001 From: mitanshudodia <80592354+mitanshudodia@users.noreply.github.com> Date: Fri, 6 Dec 2024 19:29:01 +0530 Subject: [PATCH 3/4] addressed comments --- charts/tfy-buildkitd-service/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/tfy-buildkitd-service/templates/_helpers.tpl b/charts/tfy-buildkitd-service/templates/_helpers.tpl index 698ed7160..ca529810b 100644 --- a/charts/tfy-buildkitd-service/templates/_helpers.tpl +++ b/charts/tfy-buildkitd-service/templates/_helpers.tpl @@ -66,6 +66,6 @@ Create the name of the service account to use */}} {{- define "buildkitd-service.nodeSelector" -}} {{- $defaultNodeSelector := dict "kubernetes.io/arch" "amd64" }} -{{- $mergedNodeSelector := merge $defaultNodeSelector .Values.nodeSelector }} +{{- $mergedNodeSelector := merge .Values.nodeSelector $defaultNodeSelector }} {{- toYaml $mergedNodeSelector }} {{- end }} From ab385d22f5d31c4eb24863e3e92c32970b7784ad Mon Sep 17 00:00:00 2001 From: mitanshudodia Date: Fri, 6 Dec 2024 14:06:43 +0000 Subject: [PATCH 4/4] Update README.md with readme-generator-for-helm Signed-off-by: mitanshudodia --- charts/tfy-buildkitd-service/README.md | 39 +++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/charts/tfy-buildkitd-service/README.md b/charts/tfy-buildkitd-service/README.md index 83072e881..3d81cffa3 100644 --- a/charts/tfy-buildkitd-service/README.md +++ b/charts/tfy-buildkitd-service/README.md @@ -3,7 +3,44 @@ Tfy-buildkitd-service is a Helm chart provided by TrueFoundry that facilitates t ## Parameters -############ Parameters for tfyBuildkitdService +############# Parameters for tfyBuildkitdService + +| Name | Description | Value | +| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------- | +| `replicaCount` | Number of replicas of Value kept for future use, kept 1 | `1` | +| `image.repository` | tfyBuildkitdService repository | `moby/buildkit` | +| `image.pullPolicy` | Pull policy for tfyBuildkitdService | `IfNotPresent` | +| `image.tag` | Image tag whose default is the chart appVersion. | `v0.17.0` | +| `storage.enabled` | Bool to enable storage for tfyBuildkitdService | `true` | +| `storage.accessModes` | Access mode for tfyBuildkitdService | `["ReadWriteOnce"]` | +| `storage.storageClassName` | Storage class name for tfyBuildkitdService | `""` | +| `storage.size` | Size of the storage for tfyBuildkitdService | `200Gi` | +| `imagePullSecrets` | Secrets to pull images | `[]` | +| `nameOverride` | String to override partial name passed in helm install command | `""` | +| `fullnameOverride` | String to override full name passed in helm install command | `""` | +| `serviceAccount.create` | Bool to enable serviceAccount creation | `true` | +| `serviceAccount.annotations` | Annotations to add to the serviceAccount | `{}` | +| `serviceAccount.name` | Name of the serviceAccount to use. If not set and create is true, a name is generated using the fullname template | `""` | +| `podAnnotations` | Annotations to be added to the pod | `{}` | +| `podSecurityContext` | Security context for the pod | `{}` | +| `securityContext.privileged` | Security Context for the tfyBuildkitdServiceProxy container | `true` | +| `service.type` | Type for tfyBuildkitdService Service | `ClusterIP` | +| `service.port` | Port for tfyBuildkitdService service | `1234` | +| `resources.limits.cpu` | CPU resource limits for tfyBuildkitdService container. | `2500m` | +| `resources.limits.memory` | Memory Resource limits for tfyBuildkitdService container. | `8Gi` | +| `resources.limits.ephemeral-storage` | Ephemeral Storage limits for tfyBuildkitdService container. | `100Mi` | +| `resources.requests.cpu` | CPU resource requests for tfyBuildkitdService container. | `2500m` | +| `resources.requests.memory` | Memory Resource requests for tfyBuildkitdService container. | `8Gi` | +| `resources.requests.ephemeral-storage` | Ephemeral Storage requests for tfyBuildkitdService container. | `100Mi` | +| `extraVolumes` | List of Volumes to attach to tfyBuildkitdService container | `[]` | +| `extraVolumeMounts` | List of Volume Mounts to attach to tfyBuildkitdService container | `[]` | +| `extraEnvs` | List of Environment Variables to attach to tfyBuildkitdService container | `[]` | +| `nodeSelector` | Parameters to select for scheduling of pod on a node | `{}` | +| `tolerations` | Taints that pod can tolerate | `[]` | +| `affinity` | Affinity rules for pod scheduling on a node | `{}` | +| `tls.buildkitDaemonCertsSecretName` | Name of secret containing the buildkit daemon certs | `tfy-buildkit-daemon-certs` | +| `tls.buildkitClientCertsSecretName` | Name of secret containing the buildkit client certs | `tfy-buildkit-client-certs` | +| `tls.enabled` | Enable TLS for buildkitd | `false` | | Name | Description | Value | | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------- |