Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/base/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: base
description: Base Helm chart for Kubernetes - fully values-driven.
type: application
version: 0.1.1
version: 0.2.0
maintainers:
- name: bonddim
sources:
Expand Down
10 changes: 8 additions & 2 deletions charts/base/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# base

![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)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-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.

Expand Down Expand Up @@ -36,10 +36,16 @@ Base Helm chart for Kubernetes - fully values-driven.

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| annotations | object | `{}` | Additional annotations on the Deployment resource itself. |
| workload | string | `"deployment"` | Workload type to deploy. One of: deployment, daemonset, statefulset, pod or null |
| annotations | object | `{}` | Additional annotations on the Workload resource itself. |
| labels | object | `{}` | Additional labels on the Deployment resource itself. |
| 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 } } |
| updateStrategy | object | `{}` | DaemonSet/StatefulSet update strategy. e.g. { type: RollingUpdate } or { type: OnDelete } |
| serviceName | string | `""` | StatefulSet service name. Defaults to the fullname when empty. |
| podManagementPolicy | string | `""` | StatefulSet pod management policy: OrderedReady or Parallel. |
| volumeClaimTemplates | list | `[]` | StatefulSet volumeClaimTemplates for persistent storage. |
| persistentVolumeClaimRetentionPolicy | object | `{}` | StatefulSet persistentVolumeClaimRetentionPolicy. |
| revisionHistoryLimit | int | `nil` | Number of old ReplicaSets to retain. |
| podAnnotations | object | `{}` | Additional annotations on the Pod template. |
| podLabels | object | `{}` | Additional labels on the Pod template. |
Expand Down
20 changes: 20 additions & 0 deletions charts/base/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if eq .Values.workload "daemonset" -}}
apiVersion: apps/v1
kind: DaemonSet
metadata:
{{- with include "base.annotations" (dict "annotations" .Values.annotations "context" .) }}
annotations: {{- . | nindent 4 }}
{{- end }}
labels: {{- include "base.labels" (dict "labels" .Values.labels "context" .) | nindent 4 }}
name: {{ include "base.fullname" . }}
spec:
{{- with .Values.revisionHistoryLimit }}
revisionHistoryLimit: {{ . }}
{{- end }}
selector:
matchLabels: {{- include "base.selectorLabels" . | nindent 6 }}
{{- with .Values.updateStrategy }}
updateStrategy: {{- toYaml . | nindent 4 }}
{{- end }}
template: {{- include "base.podTemplate" . | nindent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/base/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.workload "deployment" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -19,3 +20,4 @@ spec:
strategy: {{- toYaml . | nindent 4 }}
{{- end }}
template: {{- include "base.podTemplate" . | nindent 4 }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/base/templates/pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if eq .Values.workload "pod" -}}
{{- $podTemplate := include "base.podTemplate" . | fromYaml -}}
apiVersion: v1
kind: Pod
metadata:
{{- with $podTemplate.metadata.annotations }}
annotations: {{- . | nindent 4 }}
{{- end }}
labels: {{- $podTemplate.metadata.labels | toYaml | nindent 4 }}
name: {{ include "base.fullname" . }}
spec: {{- $podTemplate.spec | toYaml | nindent 2 }}
{{- end }}
33 changes: 33 additions & 0 deletions charts/base/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if eq .Values.workload "statefulset" -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
{{- with include "base.annotations" (dict "annotations" .Values.annotations "context" .) }}
annotations: {{- . | nindent 4 }}
{{- end }}
labels: {{- include "base.labels" (dict "labels" .Values.labels "context" .) | nindent 4 }}
name: {{ include "base.fullname" . }}
spec:
{{- if and (not .Values.autoscaling.enabled) (ge (int .Values.replicas) 0) }}
replicas: {{ .Values.replicas }}
{{- end }}
{{- with .Values.revisionHistoryLimit }}
revisionHistoryLimit: {{ . }}
{{- end }}
selector:
matchLabels: {{- include "base.selectorLabels" . | nindent 6 }}
serviceName: {{ default (include "base.fullname" .) .Values.serviceName }}
{{- with .Values.podManagementPolicy }}
podManagementPolicy: {{ . }}
{{- end }}
{{- with .Values.updateStrategy }}
updateStrategy: {{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.persistentVolumeClaimRetentionPolicy }}
persistentVolumeClaimRetentionPolicy: {{- toYaml . | nindent 4 }}
{{- end }}
template: {{- include "base.podTemplate" . | nindent 4 }}
{{- with .Values.volumeClaimTemplates }}
volumeClaimTemplates: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
20 changes: 19 additions & 1 deletion charts/base/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ commonAnnotations: {}
########################################################################
### Workload ###
########################################################################
# -- Additional annotations on the Deployment resource itself.
# -- Workload type to deploy. One of: deployment, daemonset, statefulset, pod or null
# @section -- Workload parameters
workload: deployment
# -- Additional annotations on the Workload resource itself.
# @section -- Workload parameters
annotations: {}
# -- Additional labels on the Deployment resource itself.
Expand All @@ -45,6 +48,21 @@ replicas: null
# -- Deployment update strategy. e.g. { type: RollingUpdate, rollingUpdate: { maxSurge: 1, maxUnavailable: 0 } }
# @section -- Workload parameters
strategy: {}
# -- DaemonSet/StatefulSet update strategy. e.g. { type: RollingUpdate } or { type: OnDelete }
# @section -- Workload parameters
updateStrategy: {}
# -- (string) StatefulSet service name. Defaults to the fullname when empty.
# @section -- Workload parameters
serviceName: ""
# -- (string) StatefulSet pod management policy: OrderedReady or Parallel.
# @section -- Workload parameters
podManagementPolicy: ""
# -- StatefulSet volumeClaimTemplates for persistent storage.
# @section -- Workload parameters
volumeClaimTemplates: []
# -- StatefulSet persistentVolumeClaimRetentionPolicy.
# @section -- Workload parameters
persistentVolumeClaimRetentionPolicy: {}
# -- (int) Number of old ReplicaSets to retain.
# @section -- Workload parameters
revisionHistoryLimit: null
Expand Down
Loading