Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
* License changed to Apache2
* Extended maintainers list
* Renamed values examples
* Added `envs` and `envsFrom` parameters to workloads generals
* Added `volumeClaimTemplates` to StatefulSet template
* Updated doc
  • Loading branch information
randreev1321 committed Feb 17, 2023
1 parent 3c34798 commit 1ad588a
Show file tree
Hide file tree
Showing 10 changed files with 293 additions and 695 deletions.
4 changes: 3 additions & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: Nixys universal Helm chart for deploy your apps to Kubernetes
name: universal-chart
version: 2.1.4
version: 2.2.0
maintainers:
- name: Roman Andreev
email: r.andreev@nixys.ru
Expand All @@ -13,3 +13,5 @@ maintainers:
email: s@lavr.me
- name: Viktor Sokhan
email: v.sokhan@nixys.ru
- name: Ruslan Gainanov
email: gromrx1@gmail.com
864 changes: 190 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ The command removes all the Kubernetes components associated with the chart and
|----------------------------------------|-----------------------------------------------------|-------|
| `deploymentsGeneral.labels` | Labels to add to all deployments | `{}` |
| `deploymentsGeneral.annotations` | Annotations to add to all deployments | `{}` |
| `deploymentsGeneral.envsFromConfigmap` | Map of ConfigMaps and envs from it | `{}` |
| `deploymentsGeneral.envsFromSecret` | Map of Secrets and envs from it | `{}` |
| `deploymentsGeneral.env` | Array of extra environment variables | `[]` |
| `deploymentsGeneral.envConfigmaps` | Array of Configmaps names with extra envs | `[]` |
| `deploymentsGeneral.envSecrets` | Array of Secrets names with extra envs | `[]` |
| `deploymentsGeneral.envFrom` | Array of extra envFrom objects | `[]` |
| `deploymentsGeneral.extraVolumes` | Array of k8s Volumes to add to all deployments | `[]` |
| `deploymentsGeneral.extraVolumeMounts` | Array of k8s VolumeMounts to add to all deployments | `[]` |

Expand Down Expand Up @@ -144,6 +150,51 @@ The command removes all the Kubernetes components associated with the chart and
| `resources` | The resources requests and limits for container | `{}` |
| `volumeMounts` | Array of the [k8s Volume mounts](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volumemount-v1-core) | `[]` |

### StatefulSets parameters

`statefulsetsGeneral` is a map of the StatefulSets parameters, which uses for all StatefulSets.

| Name | Description | Value |
|-----------------------------------------|------------------------------------------------------|-------|
| `statefulsetsGeneral.labels` | Labels to add to all statefulsets | `{}` |
| `statefulsetsGeneral.annotations` | Annotations to add to all statefulsets | `{}` |
| `statefulsetsGeneral.envsFromConfigmap` | Map of ConfigMaps and envs from it | `{}` |
| `statefulsetsGeneral.envsFromSecret` | Map of Secrets and envs from it | `{}` |
| `statefulsetsGeneral.env` | Array of extra environment variables | `[]` |
| `statefulsetsGeneral.envConfigmaps` | Array of Configmaps names with extra envs | `[]` |
| `statefulsetsGeneral.envSecrets` | Array of Secrets names with extra envs | `[]` |
| `statefulsetsGeneral.envFrom` | Array of extra envFrom objects | `[]` |
| `statefulsetsGeneral.extraVolumes` | Array of k8s Volumes to add to all statefulsets | `[]` |
| `statefulsetsGeneral.extraVolumeMounts` | Array of k8s VolumeMounts to add to all statefulsets | `[]` |

`statefulsets` is a map of the StatefulSets parameters, where key is a name of the StatefulSets.

| Name | Description | Value |
|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|
| `labels` | Extra labels for statefulset | `{}` |
| `annotations` | Extra annotations for statefulset | `{}` |
| `replicas` | Statefulset replicas count | `1` |
| `minReadySeconds` | Statefulset minReadySeconds | `` |
| `strategy` | Statefulset strategy | `{}` |
| `extraSelectorLabels` | Extra selectorLabels for statefulset | `{}` |
| `podLabels` | Extra pod labels for statefulset | `{}` |
| `podAnnotations` | Extra pod annotations for statefulset | `{}` |
| `serviceAccountName` | The name of the ServiceAccount to use by statefulset | `""` |
| `hostAliases` | Pods host aliases | `[]` |
| `affinity` | Affinity for statefulset; replicas pods assignment | `{}` |
| `securityContext` | Security Context for statefulset pods | `{}` |
| `dnsPolicy` | DnsPolicy for statefulset pods | `""` |
| `nodeSelector` | Node labels for statefulset; pods assignment | `{}` |
| `tolerations` | Tolerations for statefulset; replicas pods assignment | `[]` |
| `imagePullSecrets` | DEPRECATED. Array of existing pull secrets | `[]` |
| `extraImagePullSecrets` | Array of existing pull secrets | `[]` |
| `terminationGracePeriodSeconds` | Integer setting the termination grace period for the pods | `30` |
| `initContainers` | Array of the statefulset initContainers ([container](#container-object-parameters) objects) | `[]` |
| `containers` | Array of the statefulset Containers ([container](#container-object-parameters) objects) | `[]` |
| `volumes` | Array of the statefulset typed [volume](#typed-volumes-parameters) objects | `[]` |
| `extraVolumes` | Array of [k8s Volumes](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volume-v1-core) to add to statefulsets | `[]` |
| `volumeClaimTemplates` | Array of [k8s volumeClaimTemplates](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#persistentvolumeclaimtemplate-v1-core) to add to statefulsets | `[]` |

### Services parameters

`services` is a map of the Service parameters, where key is a name of Service.
Expand Down Expand Up @@ -248,6 +299,12 @@ Secret `data` object is a map where value can be a string, json or base64 encode
|----------------------------------------|-----------------------------------------------------------------------------------------|-------|
| `hooksGeneral.labels` | Extra labels for all Hook Job | `{}` |
| `hooksGeneral.annotations` | Extra annotations for all Hook Job | `{}` |
| `hooksGeneral.envsFromConfigmap` | Map of ConfigMaps and envs from it | `{}` |
| `hooksGeneral.envsFromSecret` | Map of Secrets and envs from it | `{}` |
| `hooksGeneral.env` | Array of extra environment variables | `[]` |
| `hooksGeneral.envConfigmaps` | Array of Configmaps names with extra envs | `[]` |
| `hooksGeneral.envSecrets` | Array of Secrets names with extra envs | `[]` |
| `hooksGeneral.envFrom` | Array of extra envFrom objects | `[]` |
| `hooksGeneral.parallelism` | How much Jobs can be run in parallel (ignored if defined on Hook level) | `1` |
| `hooksGeneral.completions` | How much Pods should finish to finish Job (ignored if defined on Hook level) | `1` |
| `hooksGeneral.activeDeadlineSeconds` | Duration of the Job (ignored if defined on Hook level) | `100` |
Expand Down Expand Up @@ -299,6 +356,12 @@ Secret `data` object is a map where value can be a string, json or base64 encode
|---------------------------------------|----------------------------------------------------------------------------------------|-------|
| `jobsGeneral.labels` | Extra labels for all Job | `{}` |
| `jobsGeneral.annotations` | Extra annotations for all Job | `{}` |
| `jobsGeneral.envsFromConfigmap` | Map of ConfigMaps and envs from it | `{}` |
| `jobsGeneral.envsFromSecret` | Map of Secrets and envs from it | `{}` |
| `jobsGeneral.env` | Array of extra environment variables | `[]` |
| `jobsGeneral.envConfigmaps` | Array of Configmaps names with extra envs | `[]` |
| `jobsGeneral.envSecrets` | Array of Secrets names with extra envs | `[]` |
| `jobsGeneral.envFrom` | Array of extra envFrom objects | `[]` |
| `jobsGeneral.parallelism` | How much Jobs can be run in parallel (ignored if defined on Job level) | `1` |
| `jobsGeneral.completions` | How much Pods should finish to finish Job (ignored if defined on Job level) | `1` |
| `jobsGeneral.activeDeadlineSeconds` | Duration of the Job (ignored if defined on Job level) | `100` |
Expand Down Expand Up @@ -347,6 +410,12 @@ Secret `data` object is a map where value can be a string, json or base64 encode
|----------------------------------------------|--------------------------------------------------------------------------------------------|-------|
| `cronJobsGeneral.labels` | Extra labels for all CronJobs | `{}` |
| `cronJobsGeneral.annotations` | Extra annotations for all CronJobs | `{}` |
| `cronJobsGeneral.envsFromConfigmap` | Map of ConfigMaps and envs from it | `{}` |
| `cronJobsGeneral.envsFromSecret` | Map of Secrets and envs from it | `{}` |
| `cronJobsGeneral.env` | Array of extra environment variables | `[]` |
| `cronJobsGeneral.envConfigmaps` | Array of Configmaps names with extra envs | `[]` |
| `cronJobsGeneral.envSecrets` | Array of Secrets names with extra envs | `[]` |
| `cronJobsGeneral.envFrom` | Array of extra envFrom objects | `[]` |
| `cronJobsGeneral.startingDeadlineSeconds` | Duration for starting all CronJobs (ignored if defined on CronJob level) | `` |
| `cronJobsGeneral.successfulJobsHistoryLimit` | Limitation of completed jobs should be kept (ignored if defined on CronJob level) | `3` |
| `cronJobsGeneral.failedJobsHistoryLimit` | Limitation of failed jobs should be kept (ignored if defined on CronJob level) | `1` |
Expand Down
18 changes: 6 additions & 12 deletions samples/cron-jobs.values.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
cronJobsGeneral:
enableAffinity: false
env:
- name: WORKLOAD_TYPE
value: CronJob

cronJobs:

mailing:
affinity:
nodeAffinity: {}
podAntiAffinity: {}
podAffinity: {}
schedule: "00 05 * * *"
containers:
- command: send-mail
Expand All @@ -19,10 +21,6 @@ cronJobs:
restartPolicy: OnFailure

flush-cache:
affinity:
nodeAffinity: {}
podAntiAffinity: {}
podAffinity: {}
schedule: "00 * * * *"
containers:
- command: flush-cache
Expand All @@ -37,10 +35,6 @@ cronJobs:
restartPolicy: OnFailure

report:
affinity:
nodeAffinity: {}
podAntiAffinity: {}
podAffinity: {}
schedule: "00 2 7 * *"
containers:
- command: make-report
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion templates/cronjob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ spec:
{{- with $.Values.generic.podAnnotations }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $ ) | nindent 12 }}{{- end }}
{{- with .podAnnotations }}{{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 12 }}{{- end }}
spec:
{{- include "helpers.pod" (dict "value" . "context" $ "general" $general "name" $name ) | indent 10 }}
{{- include "helpers.pod" (dict "value" . "general" $general "name" $name "context" $) | indent 10 }}
restartPolicy: {{ .restartPolicy | default "Never" }}
{{- if .commandDurationAlert }}
---
Expand Down
14 changes: 9 additions & 5 deletions templates/helpers/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ hostAliases: {{- include "helpers.tplvalues.render" (dict "value" $.Values.gener
{{- end }}
{{- if .affinity }}
affinity: {{- include "helpers.tplvalues.render" ( dict "value" .affinity "context" $) | nindent 2 }}
{{- else }}
{{- if $general.enableAffinity | default false }}
{{- else if $general.enableAffinity | default false }}
affinity:
nodeAffinity: {{- include "helpers.affinities.nodes" (dict "type" $.Values.nodeAffinityPreset.type "key" $.Values.nodeAffinityPreset.key "values" $.Values.nodeAffinityPreset.values) | nindent 4 }}
podAffinity: {{- include "helpers.affinities.pods" (dict "type" $.Values.podAffinityPreset "context" $) | nindent 4 }}
podAntiAffinity: {{- include "helpers.affinities.pods" (dict "type" $.Values.podAntiAffinityPreset "context" $) | nindent 4 }}
{{- end }}
{{- end }}
{{- if .dnsPolicy }}
dnsPolicy: {{ .dnsPolicy }}
{{- else if $.Values.generic.dnsPolicy }}
Expand Down Expand Up @@ -82,6 +80,9 @@ initContainers:
{{- with .lifecycle }}
lifecycle: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 4 }}
{{- end }}
{{- with .startupProbe }}
startupProbe: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 4 }}
{{- end }}
{{- with .livenessProbe }}
livenessProbe: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 4 }}
{{- end }}
Expand Down Expand Up @@ -117,14 +118,17 @@ containers:
command: {{- include "helpers.tplvalues.render" ( dict "value" .command "context" $) | nindent 2 }}
{{- end }}
{{- end }}
{{- include "helpers.workloads.envs" (dict "value" . "context" $) | indent 2 }}
{{- include "helpers.workloads.envsFrom" (dict "value" . "context" $) | indent 2 }}
{{- include "helpers.workloads.envs" (dict "value" . "general" $general "context" $) | indent 2 }}
{{- include "helpers.workloads.envsFrom" (dict "value" . "general" $general "context" $) | indent 2 }}
{{- with .ports }}
ports: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 2 }}
{{- end }}
{{- with .lifecycle }}
lifecycle: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 4 }}
{{- end }}
{{- with .startupProbe }}
startupProbe: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 4 }}
{{- end }}
{{- with .livenessProbe }}
livenessProbe: {{- include "helpers.tplvalues.render" ( dict "value" . "context" $) | nindent 4 }}
{{- end }}
Expand Down
Loading

0 comments on commit 1ad588a

Please sign in to comment.