mirror of
https://github.com/bitnami/charts.git
synced 2026-04-02 15:27:08 +08:00
[bitnami/nats] feat: ✨ 🔒 Add resource preset support (#23496)
Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>
This commit is contained in:
committed by
GitHub
parent
323e57cfc4
commit
945f059ec6
@@ -1,6 +1,6 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: oci://registry-1.docker.io/bitnamicharts
|
repository: oci://registry-1.docker.io/bitnamicharts
|
||||||
version: 2.14.1
|
version: 2.15.3
|
||||||
digest: sha256:5ccbe5f1fe4459864a8c9d7329c400b678666b6cfb1450818a830bda81995bc3
|
digest: sha256:d80293db4b59902571fcfcbeabb6b81aebb1c05e8a6d25510053e7c329d73002
|
||||||
generated: "2024-01-10T22:07:41.140621333Z"
|
generated: "2024-02-14T15:37:55.941706159+01:00"
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ maintainers:
|
|||||||
name: nats
|
name: nats
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/bitnami/charts/tree/main/bitnami/nats
|
- https://github.com/bitnami/charts/tree/main/bitnami/nats
|
||||||
version: 7.13.0
|
version: 7.14.0
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ The command removes all the Kubernetes components associated with the chart and
|
|||||||
### NATS deployment/statefulset parameters
|
### NATS deployment/statefulset parameters
|
||||||
|
|
||||||
| Name | Description | Value |
|
| Name | Description | Value |
|
||||||
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------- |
|
| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
|
||||||
| `resourceType` | NATS cluster resource type under Kubernetes. Allowed values: `statefulset` (default) or `deployment` | `statefulset` |
|
| `resourceType` | NATS cluster resource type under Kubernetes. Allowed values: `statefulset` (default) or `deployment` | `statefulset` |
|
||||||
| `replicaCount` | Number of NATS nodes | `1` |
|
| `replicaCount` | Number of NATS nodes | `1` |
|
||||||
| `schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` |
|
| `schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` |
|
||||||
@@ -141,8 +141,8 @@ The command removes all the Kubernetes components associated with the chart and
|
|||||||
| `containerSecurityContext.allowPrivilegeEscalation` | Set container's Security Context allowPrivilegeEscalation | `false` |
|
| `containerSecurityContext.allowPrivilegeEscalation` | Set container's Security Context allowPrivilegeEscalation | `false` |
|
||||||
| `containerSecurityContext.capabilities.drop` | List of capabilities to be dropped | `["ALL"]` |
|
| `containerSecurityContext.capabilities.drop` | List of capabilities to be dropped | `["ALL"]` |
|
||||||
| `containerSecurityContext.seccompProfile.type` | Set container's Security Context seccomp profile | `RuntimeDefault` |
|
| `containerSecurityContext.seccompProfile.type` | Set container's Security Context seccomp profile | `RuntimeDefault` |
|
||||||
| `resources.limits` | The resources limits for the NATS containers | `{}` |
|
| `resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `none` |
|
||||||
| `resources.requests` | The requested resources for the NATS containers | `{}` |
|
| `resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
|
||||||
| `livenessProbe.enabled` | Enable livenessProbe | `true` |
|
| `livenessProbe.enabled` | Enable livenessProbe | `true` |
|
||||||
| `livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `30` |
|
| `livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `30` |
|
||||||
| `livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` |
|
| `livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` |
|
||||||
@@ -232,14 +232,15 @@ The command removes all the Kubernetes components associated with the chart and
|
|||||||
### Metrics parameters
|
### Metrics parameters
|
||||||
|
|
||||||
| Name | Description | Value |
|
| Name | Description | Value |
|
||||||
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ------------------------------- |
|
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
|
||||||
| `metrics.enabled` | Enable Prometheus metrics via exporter side-car | `false` |
|
| `metrics.enabled` | Enable Prometheus metrics via exporter side-car | `false` |
|
||||||
| `metrics.image.registry` | Prometheus metrics exporter image registry | `REGISTRY_NAME` |
|
| `metrics.image.registry` | Prometheus metrics exporter image registry | `REGISTRY_NAME` |
|
||||||
| `metrics.image.repository` | Prometheus metrics exporter image repository | `REPOSITORY_NAME/nats-exporter` |
|
| `metrics.image.repository` | Prometheus metrics exporter image repository | `REPOSITORY_NAME/nats-exporter` |
|
||||||
| `metrics.image.digest` | NATS Exporter image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | `""` |
|
| `metrics.image.digest` | NATS Exporter image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | `""` |
|
||||||
| `metrics.image.pullPolicy` | Prometheus metrics image pull policy | `IfNotPresent` |
|
| `metrics.image.pullPolicy` | Prometheus metrics image pull policy | `IfNotPresent` |
|
||||||
| `metrics.image.pullSecrets` | Prometheus metrics image pull secrets | `[]` |
|
| `metrics.image.pullSecrets` | Prometheus metrics image pull secrets | `[]` |
|
||||||
| `metrics.resources` | Metrics exporter resource requests and limits | `{}` |
|
| `metrics.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, small, medium, large, xlarge, 2xlarge). This is ignored if metrics.resources is set (metrics.resources is recommended for production). | `none` |
|
||||||
|
| `metrics.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
|
||||||
| `metrics.containerPorts.http` | Prometheus metrics exporter port | `7777` |
|
| `metrics.containerPorts.http` | Prometheus metrics exporter port | `7777` |
|
||||||
| `metrics.flags` | Flags to be passed to Prometheus metrics | `[]` |
|
| `metrics.flags` | Flags to be passed to Prometheus metrics | `[]` |
|
||||||
| `metrics.service.type` | Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) | `ClusterIP` |
|
| `metrics.service.type` | Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) | `ClusterIP` |
|
||||||
@@ -301,6 +302,12 @@ helm install my-release -f values.yaml oci://REGISTRY_NAME/REPOSITORY_NAME/nats
|
|||||||
|
|
||||||
## Configuration and installation details
|
## 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)
|
### [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.
|
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.
|
||||||
|
|||||||
@@ -128,3 +128,4 @@ To access the Monitoring svc from outside the cluster, follow the steps below:
|
|||||||
{{- include "common.warnings.rollingTag" .Values.image }}
|
{{- include "common.warnings.rollingTag" .Values.image }}
|
||||||
{{- include "common.warnings.rollingTag" .Values.metrics.image }}
|
{{- include "common.warnings.rollingTag" .Values.metrics.image }}
|
||||||
{{- include "nats.validateValues" . -}}
|
{{- include "nats.validateValues" . -}}
|
||||||
|
{{- include "common.warnings.resources" (dict "sections" (list "metrics" "") "context" $) }}
|
||||||
|
|||||||
@@ -140,6 +140,8 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.resources }}
|
{{- if .Values.resources }}
|
||||||
resources: {{- toYaml .Values.resources | nindent 12 }}
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.resourcesPreset) | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: config
|
- name: config
|
||||||
@@ -178,6 +180,8 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.metrics.resources }}
|
{{- if .Values.metrics.resources }}
|
||||||
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.metrics.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.metrics.resourcesPreset) | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.sidecars }}
|
{{- if .Values.sidecars }}
|
||||||
|
|||||||
@@ -145,6 +145,8 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.resources }}
|
{{- if .Values.resources }}
|
||||||
resources: {{- toYaml .Values.resources | nindent 12 }}
|
resources: {{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.resourcesPreset) | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: config
|
- name: config
|
||||||
@@ -187,6 +189,8 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.metrics.resources }}
|
{{- if .Values.metrics.resources }}
|
||||||
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
|
||||||
|
{{- else if ne .Values.metrics.resourcesPreset "none" }}
|
||||||
|
resources: {{- include "common.resources.preset" (dict "type" .Values.metrics.resourcesPreset) | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.sidecars }}
|
{{- if .Values.sidecars }}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ global:
|
|||||||
## - myRegistryKeySecretName
|
## - myRegistryKeySecretName
|
||||||
##
|
##
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
## @section Common parameters
|
## @section Common parameters
|
||||||
|
|
||||||
## @param kubeVersion Force target Kubernetes version (using Helm capabilities if not set)
|
## @param kubeVersion Force target Kubernetes version (using Helm capabilities if not set)
|
||||||
@@ -51,7 +50,6 @@ diagnosticMode:
|
|||||||
- sleep
|
- sleep
|
||||||
args:
|
args:
|
||||||
- infinity
|
- infinity
|
||||||
|
|
||||||
## @section NATS parameters
|
## @section NATS parameters
|
||||||
|
|
||||||
## Bitnami NATS image version
|
## Bitnami NATS image version
|
||||||
@@ -263,7 +261,6 @@ configuration: |-
|
|||||||
max_file_store: {{ .Values.persistence.size }}
|
max_file_store: {{ .Values.persistence.size }}
|
||||||
}
|
}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
## @param existingSecret The name of an existing Secret with your custom configuration for NATS
|
## @param existingSecret The name of an existing Secret with your custom configuration for NATS
|
||||||
## NOTE: When it's set the configuration parameter is ignored
|
## NOTE: When it's set the configuration parameter is ignored
|
||||||
##
|
##
|
||||||
@@ -287,7 +284,6 @@ extraEnvVarsCM: ""
|
|||||||
## @param extraEnvVarsSecret Secret with extra environment variables
|
## @param extraEnvVarsSecret Secret with extra environment variables
|
||||||
##
|
##
|
||||||
extraEnvVarsSecret: ""
|
extraEnvVarsSecret: ""
|
||||||
|
|
||||||
## @section NATS deployment/statefulset parameters
|
## @section NATS deployment/statefulset parameters
|
||||||
|
|
||||||
## @param resourceType NATS cluster resource type under Kubernetes. Allowed values: `statefulset` (default) or `deployment`
|
## @param resourceType NATS cluster resource type under Kubernetes. Allowed values: `statefulset` (default) or `deployment`
|
||||||
@@ -361,12 +357,21 @@ containerSecurityContext:
|
|||||||
type: "RuntimeDefault"
|
type: "RuntimeDefault"
|
||||||
## NATS resource requests and limits
|
## NATS resource requests and limits
|
||||||
## ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
## ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
||||||
## @param resources.limits The resources limits for the NATS containers
|
## @param resourcesPreset Set container resources according to one common preset (allowed values: none, nano, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).
|
||||||
## @param resources.requests The requested resources for the NATS containers
|
## More information: https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
|
||||||
##
|
##
|
||||||
resources:
|
resourcesPreset: "none"
|
||||||
limits: {}
|
## @param resources Set container requests and limits for different resources like CPU or memory (essential for production workloads)
|
||||||
requests: {}
|
## Example:
|
||||||
|
## resources:
|
||||||
|
## requests:
|
||||||
|
## cpu: 2
|
||||||
|
## memory: 512Mi
|
||||||
|
## limits:
|
||||||
|
## cpu: 3
|
||||||
|
## memory: 1024Mi
|
||||||
|
##
|
||||||
|
resources: {}
|
||||||
## NATS containers' liveness probe.
|
## NATS containers' liveness probe.
|
||||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
|
||||||
## @param livenessProbe.enabled Enable livenessProbe
|
## @param livenessProbe.enabled Enable livenessProbe
|
||||||
@@ -512,7 +517,6 @@ initContainers: []
|
|||||||
## containerPort: 1234
|
## containerPort: 1234
|
||||||
##
|
##
|
||||||
sidecars: []
|
sidecars: []
|
||||||
|
|
||||||
## Service Account
|
## Service Account
|
||||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||||
##
|
##
|
||||||
@@ -531,7 +535,6 @@ serviceAccount:
|
|||||||
## @param serviceAccount.annotations Additional custom annotations for the ServiceAccount
|
## @param serviceAccount.annotations Additional custom annotations for the ServiceAccount
|
||||||
##
|
##
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|
||||||
## @section Traffic Exposure parameters
|
## @section Traffic Exposure parameters
|
||||||
|
|
||||||
## NATS service parameters
|
## NATS service parameters
|
||||||
@@ -752,8 +755,6 @@ networkPolicy:
|
|||||||
##
|
##
|
||||||
ingressNSMatchLabels: {}
|
ingressNSMatchLabels: {}
|
||||||
ingressNSPodMatchLabels: {}
|
ingressNSPodMatchLabels: {}
|
||||||
|
|
||||||
|
|
||||||
## @section Metrics parameters
|
## @section Metrics parameters
|
||||||
|
|
||||||
## Metrics / Prometheus NATS Exporter
|
## Metrics / Prometheus NATS Exporter
|
||||||
@@ -784,7 +785,19 @@ metrics:
|
|||||||
## - myRegistryKeySecretName
|
## - myRegistryKeySecretName
|
||||||
##
|
##
|
||||||
pullSecrets: []
|
pullSecrets: []
|
||||||
## @param metrics.resources Metrics exporter resource requests and limits
|
## @param metrics.resourcesPreset Set container resources according to one common preset (allowed values: none, nano, small, medium, large, xlarge, 2xlarge). This is ignored if metrics.resources is set (metrics.resources is recommended for production).
|
||||||
|
## More information: https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
|
||||||
|
##
|
||||||
|
resourcesPreset: "none"
|
||||||
|
## @param metrics.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
|
||||||
## ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
## ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
||||||
##
|
##
|
||||||
resources: {}
|
resources: {}
|
||||||
@@ -854,7 +867,6 @@ metrics:
|
|||||||
## ref: https://github.com/bitnami/charts/tree/main/bitnami/prometheus-operator#prometheus-configuration
|
## ref: https://github.com/bitnami/charts/tree/main/bitnami/prometheus-operator#prometheus-configuration
|
||||||
##
|
##
|
||||||
selector: {}
|
selector: {}
|
||||||
|
|
||||||
## @section Persistence parameters
|
## @section Persistence parameters
|
||||||
|
|
||||||
## Enable persistence using Persistent Volume Claims
|
## Enable persistence using Persistent Volume Claims
|
||||||
@@ -889,7 +901,6 @@ persistence:
|
|||||||
## app: my-app
|
## app: my-app
|
||||||
##
|
##
|
||||||
selector: {}
|
selector: {}
|
||||||
|
|
||||||
## @section Other parameters
|
## @section Other parameters
|
||||||
|
|
||||||
## NATS Pod Disruption Budget configuration
|
## NATS Pod Disruption Budget configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user