From 5704dfb35f959ef2e9a1636ef80f3861a7400af6 Mon Sep 17 00:00:00 2001 From: MohamadTahir Date: Sat, 2 Sep 2023 09:29:23 +0300 Subject: [PATCH 1/3] add resource specification to frontend and backend deployment containers --- helm-charts/infisical/CHANGELOG.md | 3 ++ helm-charts/infisical/Chart.yaml | 2 +- helm-charts/infisical/README.md | 34 ++++++++++--------- .../templates/backend-deployment.yaml | 4 ++- .../templates/frontend-deployment.yaml | 4 ++- helm-charts/infisical/values.yaml | 14 ++++++++ 6 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 helm-charts/infisical/CHANGELOG.md diff --git a/helm-charts/infisical/CHANGELOG.md b/helm-charts/infisical/CHANGELOG.md new file mode 100644 index 000000000..131fbda94 --- /dev/null +++ b/helm-charts/infisical/CHANGELOG.md @@ -0,0 +1,3 @@ +# 0.3.3 +### Changes since 0.3.2 [#933](https://github.com/Infisical/infisical/pull/933) +- added resource specs to both the frontend and backend diff --git a/helm-charts/infisical/Chart.yaml b/helm-charts/infisical/Chart.yaml index 5f3684346..5964553df 100644 --- a/helm-charts/infisical/Chart.yaml +++ b/helm-charts/infisical/Chart.yaml @@ -7,7 +7,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.2 +version: 0.3.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm-charts/infisical/README.md b/helm-charts/infisical/README.md index de001d4f7..f09330ea5 100644 --- a/helm-charts/infisical/README.md +++ b/helm-charts/infisical/README.md @@ -61,22 +61,23 @@ kubectl get secrets -n \ ### Infisical frontend parameters -| Name | Description | Value | -| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -| `frontend.enabled` | Enable frontend | `true` | -| `frontend.name` | Backend name | `frontend` | -| `frontend.fullnameOverride` | Backend fullnameOverride | `""` | -| `frontend.podAnnotations` | Backend pod annotations | `{}` | -| `frontend.deploymentAnnotations` | Backend deployment annotations | `{}` | -| `frontend.replicaCount` | Backend replica count | `2` | -| `frontend.image.repository` | Backend image repository | `infisical/frontend` | -| `frontend.image.tag` | Backend image tag | `latest` | -| `frontend.image.pullPolicy` | Backend image pullPolicy | `IfNotPresent` | -| `frontend.kubeSecretRef` | Backend secret resource reference name (containing required [frontend configuration variables](https://infisical.com/docs/self-hosting/configuration/envars)) | `""` | -| `frontend.service.annotations` | Backend service annotations | `{}` | -| `frontend.service.type` | Backend service type | `ClusterIP` | -| `frontend.service.nodePort` | Backend service nodePort (used if above type is `NodePort`) | `""` | -| `frontendEnvironmentVariables.SITE_URL` | Absolute URL including the protocol (e.g. https://app.infisical.com) | `infisical.local` | +| Name | Description | Value | +| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | +| `frontend.enabled` | Enable frontend | `true` | +| `frontend.name` | Backend name | `frontend` | +| `frontend.fullnameOverride` | Backend fullnameOverride | `""` | +| `frontend.podAnnotations` | Backend pod annotations | `{}` | +| `frontend.deploymentAnnotations` | Backend deployment annotations | `{}` | +| `frontend.replicaCount` | Backend replica count | `2` | +| `frontend.image.repository` | Backend image repository | `infisical/frontend` | +| `frontend.image.tag` | Backend image tag | `latest` | +| `frontend.image.pullPolicy` | Backend image pullPolicy | `IfNotPresent` | +| `frontend.kubeSecretRef` | Backend secret resource reference name (containing required [frontend configuration variables](https://infisical.com/docs/self-hosting/configuration/envars)) | `""` | +| `frontend.service.annotations` | Backend service annotations | `{}` | +| `frontend.service.type` | Backend service type | `ClusterIP` | +| `frontend.service.nodePort` | Backend service nodePort (used if above type is `NodePort`) | `""` | +| `frontend.resources` | Frontend container resource spesification, check the offical [kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `` | +| `frontendEnvironmentVariables.SITE_URL` | Absolute URL including the protocol (e.g. https://app.infisical.com) | `infisical.local` | ### Infisical backend parameters @@ -91,6 +92,7 @@ kubectl get secrets -n \ | `backend.image.repository` | Backend image repository | `infisical/backend` | | `backend.image.tag` | Backend image tag | `latest` | | `backend.image.pullPolicy` | Backend image pullPolicy | `IfNotPresent` | +| `backend.resources` | Backend container resource spesification, check the offical [kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `` | | `backend.kubeSecretRef` | Backend secret resource reference name (containing required [backend configuration variables](https://infisical.com/docs/self-hosting/configuration/envars)) | `""` | | `backend.service.annotations` | Backend service annotations | `{}` | | `backend.service.type` | Backend service type | `ClusterIP` | diff --git a/helm-charts/infisical/templates/backend-deployment.yaml b/helm-charts/infisical/templates/backend-deployment.yaml index 5646d368b..95fb11744 100644 --- a/helm-charts/infisical/templates/backend-deployment.yaml +++ b/helm-charts/infisical/templates/backend-deployment.yaml @@ -40,7 +40,9 @@ spec: envFrom: - secretRef: name: {{ $backend.kubeSecretRef | default (include "infisical.backend.fullname" .) }} - + {{- if $backend.resources }} + resources: {{- toYaml $backend.resources | nindent 12 }} + {{- end }} --- apiVersion: v1 diff --git a/helm-charts/infisical/templates/frontend-deployment.yaml b/helm-charts/infisical/templates/frontend-deployment.yaml index 9c5cd1560..162f7154e 100644 --- a/helm-charts/infisical/templates/frontend-deployment.yaml +++ b/helm-charts/infisical/templates/frontend-deployment.yaml @@ -40,7 +40,9 @@ spec: name: {{ $frontend.kubeSecretRef | default (include "infisical.frontend.fullname" .) }} ports: - containerPort: 3000 - + {{- if $frontend.resources }} + resources: {{- toYaml $frontend.resources | nindent 12 }} + {{- end }} --- apiVersion: v1 diff --git a/helm-charts/infisical/values.yaml b/helm-charts/infisical/values.yaml index 1ffbc318f..1dafd8995 100644 --- a/helm-charts/infisical/values.yaml +++ b/helm-charts/infisical/values.yaml @@ -43,6 +43,13 @@ frontend: ## @param frontend.image.pullPolicy Backend image pullPolicy ## pullPolicy: IfNotPresent + ## container resource specifications [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) + ## + resources: + limits: + memory: 100Mi + requests: + cpu: 10m ## @param frontend.kubeSecretRef Backend secret resource reference name (containing required [frontend configuration variables](https://infisical.com/docs/self-hosting/configuration/envars)) ## kubeSecretRef: "" @@ -102,6 +109,13 @@ backend: ## @param backend.image.pullPolicy Backend image pullPolicy ## pullPolicy: IfNotPresent + ## container resource specifications [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) + ## + resources: + limits: + memory: 200Mi + requests: + cpu: 150m ## @param backend.kubeSecretRef Backend secret resource reference name (containing required [backend configuration variables](https://infisical.com/docs/self-hosting/configuration/envars)) ## kubeSecretRef: "" From 86b2b95d11b35c3bca5fb5c9e6eaa944d36a3601 Mon Sep 17 00:00:00 2001 From: MohamadTahir Date: Mon, 11 Sep 2023 22:10:47 +0300 Subject: [PATCH 2/3] update readme file and values.yaml documentations --- helm-charts/infisical/README.md | 40 ++++++++++++++++--------------- helm-charts/infisical/values.yaml | 6 +++-- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/helm-charts/infisical/README.md b/helm-charts/infisical/README.md index f09330ea5..5bc23b73a 100644 --- a/helm-charts/infisical/README.md +++ b/helm-charts/infisical/README.md @@ -61,23 +61,24 @@ kubectl get secrets -n \ ### Infisical frontend parameters -| Name | Description | Value | -| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | -| `frontend.enabled` | Enable frontend | `true` | -| `frontend.name` | Backend name | `frontend` | -| `frontend.fullnameOverride` | Backend fullnameOverride | `""` | -| `frontend.podAnnotations` | Backend pod annotations | `{}` | -| `frontend.deploymentAnnotations` | Backend deployment annotations | `{}` | -| `frontend.replicaCount` | Backend replica count | `2` | -| `frontend.image.repository` | Backend image repository | `infisical/frontend` | -| `frontend.image.tag` | Backend image tag | `latest` | -| `frontend.image.pullPolicy` | Backend image pullPolicy | `IfNotPresent` | -| `frontend.kubeSecretRef` | Backend secret resource reference name (containing required [frontend configuration variables](https://infisical.com/docs/self-hosting/configuration/envars)) | `""` | -| `frontend.service.annotations` | Backend service annotations | `{}` | -| `frontend.service.type` | Backend service type | `ClusterIP` | -| `frontend.service.nodePort` | Backend service nodePort (used if above type is `NodePort`) | `""` | -| `frontend.resources` | Frontend container resource spesification, check the offical [kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `` | -| `frontendEnvironmentVariables.SITE_URL` | Absolute URL including the protocol (e.g. https://app.infisical.com) | `infisical.local` | +| Name | Description | Value | +| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | +| `frontend.enabled` | Enable frontend | `true` | +| `frontend.name` | Backend name | `frontend` | +| `frontend.fullnameOverride` | Backend fullnameOverride | `""` | +| `frontend.podAnnotations` | Backend pod annotations | `{}` | +| `frontend.deploymentAnnotations` | Backend deployment annotations | `{}` | +| `frontend.replicaCount` | Backend replica count | `2` | +| `frontend.image.repository` | Backend image repository | `infisical/frontend` | +| `frontend.image.tag` | Backend image tag | `latest` | +| `frontend.image.pullPolicy` | Backend image pullPolicy | `IfNotPresent` | +| `frontend.resources.limits.memory` | container memory limit [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `100Mi` | +| `frontend.resources.requests.cpu` | container CPU request [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `10m` | +| `frontend.kubeSecretRef` | Backend secret resource reference name (containing required [frontend configuration variables](https://infisical.com/docs/self-hosting/configuration/envars)) | `""` | +| `frontend.service.annotations` | Backend service annotations | `{}` | +| `frontend.service.type` | Backend service type | `ClusterIP` | +| `frontend.service.nodePort` | Backend service nodePort (used if above type is `NodePort`) | `""` | +| `frontendEnvironmentVariables.SITE_URL` | Absolute URL including the protocol (e.g. https://app.infisical.com) | `infisical.local` | ### Infisical backend parameters @@ -92,7 +93,8 @@ kubectl get secrets -n \ | `backend.image.repository` | Backend image repository | `infisical/backend` | | `backend.image.tag` | Backend image tag | `latest` | | `backend.image.pullPolicy` | Backend image pullPolicy | `IfNotPresent` | -| `backend.resources` | Backend container resource spesification, check the offical [kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `` | +| `backend.resources.limits.memory` | container memory limit [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `200Mi` | +| `backend.resources.requests.cpu` | container CPU request [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) | `150m` | | `backend.kubeSecretRef` | Backend secret resource reference name (containing required [backend configuration variables](https://infisical.com/docs/self-hosting/configuration/envars)) | `""` | | `backend.service.annotations` | Backend service annotations | `{}` | | `backend.service.type` | Backend service type | `ClusterIP` | @@ -343,4 +345,4 @@ for component in $components; do -o jsonpath='{.spec.template.spec.containers[0].env[*]}' | \ jq -r '.name + ":" + .value' > infisical-$component-conf.bak done -``` \ No newline at end of file +``` diff --git a/helm-charts/infisical/values.yaml b/helm-charts/infisical/values.yaml index 1dafd8995..99d39e4d8 100644 --- a/helm-charts/infisical/values.yaml +++ b/helm-charts/infisical/values.yaml @@ -43,7 +43,8 @@ frontend: ## @param frontend.image.pullPolicy Backend image pullPolicy ## pullPolicy: IfNotPresent - ## container resource specifications [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) + ## @param frontend.resources.limits.memory container memory limit [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) + ## @param frontend.resources.requests.cpu container CPU request [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) ## resources: limits: @@ -109,7 +110,8 @@ backend: ## @param backend.image.pullPolicy Backend image pullPolicy ## pullPolicy: IfNotPresent - ## container resource specifications [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) + ## @param backend.resources.limits.memory container memory limit [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) + ## @param backend.resources.requests.cpu container CPU request [check the offical kubernetes documentations](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) ## resources: limits: From 36b5ba285585b8a3c5d42ea20d2073b5dfde2364 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Thu, 14 Sep 2023 16:35:13 -0400 Subject: [PATCH 3/3] remove change log bc will get replaced by auto generated one soon --- helm-charts/infisical/CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 helm-charts/infisical/CHANGELOG.md diff --git a/helm-charts/infisical/CHANGELOG.md b/helm-charts/infisical/CHANGELOG.md deleted file mode 100644 index 131fbda94..000000000 --- a/helm-charts/infisical/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -# 0.3.3 -### Changes since 0.3.2 [#933](https://github.com/Infisical/infisical/pull/933) -- added resource specs to both the frontend and backend