[bitnami/influxdb] feat: 🔒 Add resource preset support (#23462)

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>
This commit is contained in:
Javier J. Salmerón-García
2024-02-16 14:17:39 +01:00
committed by GitHub
parent c23f6a6d76
commit 7322226d2f
6 changed files with 29 additions and 36 deletions

View File

@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.14.1
digest: sha256:5ccbe5f1fe4459864a8c9d7329c400b678666b6cfb1450818a830bda81995bc3
generated: "2024-01-05T19:35:04.742275817Z"
version: 2.15.3
digest: sha256:d80293db4b59902571fcfcbeabb6b81aebb1c05e8a6d25510053e7c329d73002
generated: "2024-02-14T15:03:26.866059518+01:00"

View File

@@ -37,4 +37,4 @@ maintainers:
name: influxdb
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/influxdb
version: 5.14.2
version: 5.15.0

View File

@@ -142,8 +142,8 @@ The command removes all the Kubernetes components associated with the chart and
| `influxdb.containerSecurityContext.allowPrivilegeEscalation` | Set container's Security Context allowPrivilegeEscalation | `false` |
| `influxdb.containerSecurityContext.capabilities.drop` | List of capabilities to be dropped | `["ALL"]` |
| `influxdb.containerSecurityContext.seccompProfile.type` | Set container's Security Context seccomp profile | `RuntimeDefault` |
| `influxdb.resources.limits` | The resources limits for the container | `{}` |
| `influxdb.resources.requests` | The requested resources for the container | `{}` |
| `influxdb.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, small, medium, large, xlarge, 2xlarge). This is ignored if influxdb.resources is set (influxdb.resources is recommended for production). | `none` |
| `influxdb.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
| `influxdb.command` | Override default container command (useful when using custom images) | `[]` |
| `influxdb.args` | Override default container args (useful when using custom images) | `[]` |
| `influxdb.lifecycleHooks` | for the InfluxDB&trade; container(s) to automate configuration before or after startup | `{}` |
@@ -381,6 +381,12 @@ helm install my-release -f values.yaml oci://REGISTRY_NAME/REPOSITORY_NAME/influ
## Configuration and installation details
### Resource requests and limits
Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the `resources` value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case.
To make this process easier, the chart contains the `resourcesPreset` values, which automatically sets the `resources` section according to different presets. Check these presets in [the bitnami/common chart](https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15). However, in production workloads using `resourcePreset` is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/).
### [Rolling VS Immutable tags](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers)
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.

View File

@@ -140,3 +140,4 @@ To connect to your database from outside the cluster execute the following comma
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $) -}}
{{- end }}
{{- include "common.warnings.resources" (dict "sections" (list "influxdb") "context" $) }}

View File

@@ -291,6 +291,8 @@ spec:
{{- end }}
{{- if .Values.influxdb.resources }}
resources: {{- toYaml .Values.influxdb.resources | nindent 12 }}
{{- else if ne .Values.influxdb.resourcesPreset "none" }}
resources: {{- include "common.resources.preset" (dict "type" .Values.influxdb.resourcesPreset) | nindent 12 }}
{{- end }}
volumeMounts:
{{- if or .Values.influxdb.configuration .Values.influxdb.existingConfiguration }}

View File

@@ -18,7 +18,6 @@ global:
##
imagePullSecrets: []
storageClass: ""
## @section Common parameters
## @param kubeVersion Force target Kubernetes version (using Helm capabilities if not set)
@@ -42,7 +41,6 @@ commonLabels: {}
## @param extraDeploy Array of extra objects to deploy with the release
##
extraDeploy: []
## Enable diagnostic mode in the deployment
##
diagnosticMode:
@@ -57,7 +55,6 @@ diagnosticMode:
##
args:
- infinity
## @section InfluxDB&trade; parameters
## Bitnami InfluxDB&trade; image
@@ -314,20 +311,21 @@ influxdb:
## choice for the user. This also increases chances charts run on environments with little
## resources, such as Minikube. If you do want to specify resources, uncomment the following
## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
## @param influxdb.resources.limits The resources limits for the container
## @param influxdb.resources.requests The requested resources for the container
## @param influxdb.resourcesPreset Set container resources according to one common preset (allowed values: none, nano, small, medium, large, xlarge, 2xlarge). This is ignored if influxdb.resources is set (influxdb.resources is recommended for production).
## More information: https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
##
resources:
## Example:
## limits:
## cpu: 100m
## memory: 128Mi
limits: {}
## Examples:
## requests:
## cpu: 100m
## memory: 128Mi
requests: {}
resourcesPreset: "none"
## @param influxdb.resources Set container requests and limits for different resources like CPU or memory (essential for production workloads)
## Example:
## resources:
## requests:
## cpu: 2
## memory: 512Mi
## limits:
## cpu: 3
## memory: 1024Mi
##
resources: {}
## @param influxdb.command Override default container command (useful when using custom images)
##
command: []
@@ -362,7 +360,6 @@ influxdb:
containerPorts:
http: 8086
rpc: 8088
## Configure extra options for InfluxDB&trade; containers' liveness, readiness and startup probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
## @param influxdb.startupProbe.enabled Enable startupProbe
@@ -437,7 +434,6 @@ influxdb:
## command: ['sh', '-c', 'echo "hello world"']
##
initContainers: []
## Service parameters
##
service:
@@ -492,9 +488,7 @@ influxdb:
## clientIP:
## timeoutSeconds: 300
sessionAffinityConfig: {}
## @section InfluxDB Collectd&trade; parameters
collectd:
## @param collectd.enabled InfluxDB Collectd&trade; service enable
##
@@ -550,7 +544,6 @@ collectd:
## timeoutSeconds: 300
##
sessionAffinityConfig: {}
## @section Exposing parameters
## Configure the ingress resource that allows you to access the
@@ -652,7 +645,6 @@ ingress:
## name: http
##
extraRules: []
## @section Metrics parameters
## Prometheus metrics
@@ -713,7 +705,6 @@ metrics:
## timeoutSeconds: 300
##
sessionAffinityConfig: {}
## Prometheus Operator ServiceMonitor configuration
##
serviceMonitor:
@@ -838,7 +829,6 @@ persistence:
## @param persistence.annotations Persistent Volume Claim annotations
##
annotations: {}
## Pod Service Account
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
## @param serviceAccount.create Specifies whether a ServiceAccount should be created
@@ -854,21 +844,18 @@ serviceAccount:
name: ""
automountServiceAccountToken: false
annotations: {}
## Pod Security Policy
## ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
## @param psp.create Whether to create a PodSecurityPolicy. WARNING: PodSecurityPolicy is deprecated in Kubernetes v1.21 or later, unavailable in v1.25 or later
##
psp:
create: false
## Role Based Access
## Ref: https://kubernetes.io/docs/admin/authorization/rbac/
## @param rbac.create Create Role and RoleBinding (required for PSP to work)
##
rbac:
create: false
## @section Volume permissions parameters
## Init Container parameters
@@ -917,9 +904,7 @@ volumePermissions:
securityContext:
seLinuxOptions: null
runAsUser: 0
## @section InfluxDB&trade; backup parameters
backup:
## @param backup.enabled Enable InfluxDB&trade; backup
##
@@ -959,7 +944,6 @@ backup:
sysctls: []
supplementalGroups: []
fsGroup: 1001
## K8s Security Context for Backup Cronjob containers
## https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
## @param backup.cronjob.containerSecurityContext.enabled Enabled containers' Security Context