diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46ee891..1d61ce7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: check-executables-have-shebangs - id: check-shebang-scripts-are-executable - id: check-yaml - exclude: "^charts/.*/templates/.*\\.ya?ml$" + exclude: "^templates/.*\\.ya?ml$" - id: end-of-file-fixer - id: trailing-whitespace @@ -17,5 +17,5 @@ repos: hooks: - id: helm-docs-container args: - - --chart-search-root=charts + - --chart-search-root=. - --sort-values-order=file diff --git a/Chart.yaml b/Chart.yaml index 7e4bd1b..71d3251 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: base description: Base Helm chart for Kubernetes - fully values-driven. type: application -version: 0.1.0 +version: 0.1.1 maintainers: - name: bonddim sources: diff --git a/README.md b/README.md index 4b056ca..dfaa8ed 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # base -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) Base Helm chart for Kubernetes - fully values-driven. @@ -12,7 +12,7 @@ Base Helm chart for Kubernetes - fully values-driven. ## Source Code -* +* ## Values @@ -38,7 +38,7 @@ Base Helm chart for Kubernetes - fully values-driven. |-----|------|---------|-------------| | annotations | object | `{}` | Additional annotations on the Deployment resource itself. | | labels | object | `{}` | Additional labels on the Deployment resource itself. | -| replicas | int | `nil` | Number of pod replicas. Omit (or set to 0) when autoscaling.enabled=true | +| replicas | int | `nil` | Number of pod replicas. Ignored when autoscaling.enabled=true. Must be >= 0 if specified. null by default, which defaults to 1 and not controlled by Helm. | | strategy | object | `{}` | Deployment update strategy. e.g. { type: RollingUpdate, rollingUpdate: { maxSurge: 1, maxUnavailable: 0 } } | | revisionHistoryLimit | int | `nil` | Number of old ReplicaSets to retain. | | podAnnotations | object | `{}` | Additional annotations on the Pod template. | diff --git a/templates/deployment.yaml b/templates/deployment.yaml index cc11c06..478839d 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -7,10 +7,8 @@ metadata: labels: {{- include "base.labels" (dict "labels" .Values.labels "context" .) | nindent 4 }} name: {{ include "base.fullname" . }} spec: - {{- if not .Values.autoscaling.enabled }} - {{- with .Values.replicas }} - replicas: {{ . }} - {{- end }} + {{- if and (not .Values.autoscaling.enabled) (ge (int .Values.replicas) 0) }} + replicas: {{ .Values.replicas }} {{- end }} {{- with .Values.revisionHistoryLimit }} revisionHistoryLimit: {{ . }} diff --git a/values.yaml b/values.yaml index 52590c2..7fb55db 100644 --- a/values.yaml +++ b/values.yaml @@ -38,7 +38,8 @@ annotations: {} # -- Additional labels on the Deployment resource itself. # @section -- Workload parameters labels: {} -# -- (int) Number of pod replicas. Omit (or set to 0) when autoscaling.enabled=true +# -- (int) Number of pod replicas. Ignored when autoscaling.enabled=true. +# Must be >= 0 if specified. null by default, which defaults to 1 and not controlled by Helm. # @section -- Workload parameters replicas: null # -- Deployment update strategy. e.g. { type: RollingUpdate, rollingUpdate: { maxSurge: 1, maxUnavailable: 0 } }