Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
lucakuendig authored Oct 31, 2023
2 parents 89ff521 + 6197547 commit 36fd3db
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 64 deletions.
2 changes: 1 addition & 1 deletion charts/common/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: common
description: "Bedag's common Helm chart to use for creating other Helm charts"
version: 10.8.0
version: 10.10.1
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
Expand Down
2 changes: 1 addition & 1 deletion charts/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![Version: 10.8.0](https://img.shields.io/badge/Version-10.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 10.10.1](https://img.shields.io/badge/Version-10.10.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Bedag's common Helm chart to use for creating other Helm charts

Expand Down
22 changes: 22 additions & 0 deletions charts/common/ci/values.test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# includes is used to include the desired template functions (see templates/includes.yaml)
includes:
networkpolicy: true
deployment: true
statefulset: true
service: true
envSecret: true
envConfigMap: true
# files is needed for mounted volumes (secrets or configmaps)
files: true
configFiles: true
binaryFiles: true
pvcs: true
job: true
cronjob: true

# start common.ingress
ingress:
deploy: true
Expand Down Expand Up @@ -179,6 +195,12 @@ components:
- name: emptydir-volume
type: "emptyDir"
sizeLimit: 100Mi
- name: secret-store
type: "csi"
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "azure-kvname"

containers:
container-1:
Expand Down
14 changes: 14 additions & 0 deletions charts/common/templates/_pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,20 @@ volumes:
readOnly: {{ .readOnly }}
{{- end }}
{{- end }}
{{- else if eq .type "csi" }}
{{- if .driver }}
csi:
driver: {{ .driver }}
{{- if .readOnly }}
readOnly: {{ .readOnly }}
{{- end }}
{{- if .volumeAttributes }}
volumeAttributes:
{{- range $key, $val := .volumeAttributes }}
{{ $key }}: {{ $val }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
119 changes: 58 additions & 61 deletions charts/common/templates/includes.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,58 @@
{{- /* This file is used for developing & testing the common chart.
Uncomment each "template" line to use the corresponding function */ -}}

{{- /* ingress
{{- template "common.ingress.ingress" . }}
{{- template "common.ingress.secret" . }}
*/ -}}

{{- /* services
{{- template "common.service" . }}
*/ -}}

{{- /* statefulset
{{- template "common.statefulset" . }}
*/ -}}

{{- /* deployment
{{- template "common.deployment" . }}
*/ -}}

{{- /* job
{{- template "common.job" . }}
*/ -}}

{{- /* cronjob
{{- template "common.cronjob" . }}
*/ -}}

{{- /* envSecret
{{- template "common.controller.envSecret" . }}
*/ -}}

{{- /* envConfigMap
{{- template "common.controller.envConfigMap" . }}
*/ -}}

{{- /* configFiles
{{- template "common.controller.configFiles" . }}
*/ -}}

{{- /* binaryFiles
{{- template "common.controller.binaryFiles" . }}
*/ -}}

{{- /* files
{{- template "common.controller.files" . }}
*/ -}}

{{- /* pvcs
{{- template "common.pvcs" . }}
*/ -}}

{{- /* servicemonitor
{{- template "common.servicemonitor.headless.service" . }}
{{- template "common.servicemonitor.servicemonitor" . }}
{{- template "common.servicemonitor.secret" . }}
*/ -}}

{{- /* networkpolicy
{{- template "common.networkpolicy" . }}
*/ -}}
{{- if .Values.ingress.deploy }}
{{- template "common.ingress.ingress" . }}
{{- template "common.ingress.secret" . }}
{{- end }}

{{- if .Values.includes.service }}
{{- template "common.service" . }}
{{- end -}}

{{- if .Values.includes.statefulset }}
{{- template "common.statefulset" . }}
{{- end -}}

{{- if .Values.includes.deployment }}
{{- template "common.deployment" . }}
{{- end -}}

{{- if .Values.includes.job }}
{{- template "common.job" . }}
{{- end -}}

{{- if .Values.includes.cronjob }}
{{- template "common.cronjob" . }}
{{- end -}}

{{- if .Values.includes.envSecret }}
{{- template "common.controller.envSecret" . }}
{{- end -}}

{{- if .Values.includes.envConfigMap }}
{{- template "common.controller.envConfigMap" . }}
{{- end -}}

{{- if .Values.includes.configFiles }}
{{- template "common.controller.configFiles" . }}
{{- end -}}

{{- if .Values.includes.binaryFiles }}
{{- template "common.controller.binaryFiles" . }}
{{- end -}}

{{- if .Values.includes.files }}
{{- template "common.controller.files" . }}
{{- end -}}

{{- if .Values.includes.pvcs }}
{{- template "common.pvcs" . }}
{{- end -}}

{{- if .Values.servicemonitor.deploy }}
{{- template "common.servicemonitor.headless.service" . }}
{{- template "common.servicemonitor.servicemonitor" . }}
{{- template "common.servicemonitor.secret" . }}
{{- end -}}

{{- if .Values.servicemonitor.deploy }}
{{- template "common.networkpolicy" . }}
{{- end -}}
67 changes: 67 additions & 0 deletions charts/common/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,73 @@
"1.0.0"
]
},
"includes": {
"type": "object",
"required": [
"networkpolicy",
"deployment",
"statefulset",
"service",
"envSecret",
"envConfigMap",
"files",
"configFiles",
"binaryFiles",
"pvcs",
"job",
"cronjob"
],
"properties": {
"networkpolicy": {
"type": "boolean",
"default": false
},
"deployment": {
"type": "boolean",
"default": false
},
"statefulset": {
"type": "boolean",
"default": false
},
"service": {
"type": "boolean",
"default": false
},
"envSecret": {
"type": "boolean",
"default": false
},
"envConfigMap": {
"type": "boolean",
"default": false
},
"files": {
"type": "boolean",
"default": false
},
"configFiles": {
"type": "boolean",
"default": false
},
"binaryFiles": {
"type": "boolean",
"default": false
},
"pvcs": {
"type": "boolean",
"default": false
},
"job": {
"type": "boolean",
"default": false
},
"cronjob": {
"type": "boolean",
"default": false
}
}
},
"secrets": {
"type": "object",
"properties": {
Expand Down
27 changes: 26 additions & 1 deletion charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@
# defaultTag is used when no imageTag is specified in .Values.components.*.controller.image.tag
defaultTag: latest

# includes is used to include the desired template functions (see templates/includes.yaml)
includes:
networkpolicy: false
deployment: false
statefulset: false
service: false
envSecret: false
envConfigMap: false
# files is needed for mounted volumes (secrets or configmaps)
files: false
configFiles: false
binaryFiles: false
pvcs: false
job: false
cronjob: false

# timezone to set as environment variable 'TZ' in each pod. Comment out for using default ("Europe/Zurich")
# timezone: "Europe/Zurich"

Expand Down Expand Up @@ -442,7 +458,7 @@ components:
volumes: []
# -- name of the volume
# - name: generic-name
# -- type can either be "secret", "configMap", "persistentVolumeClaim", "emptyDir" or "external"
# -- type can either be "secret", "configMap", "persistentVolumeClaim", "emptyDir", "external" or "csi"
# type: "secret"
# START ONLY FOR SECRET or CONFIGMAP
# filePath is optional for specifying a filePath in the helm chart where the file is located.
Expand All @@ -468,6 +484,15 @@ components:
# readOnly will force the ReadOnly setting in VolumeMounts. Comment out for using default (false)
# readOnly: true
# END ONLY FOR EXTERNAL
# START ONLY FOR CSI
# driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.
# driver: "foo"
# readOnly will force the ReadOnly setting in VolumeMounts. Comment out for using default (false)
# readOnly: true
# volumeAttributes represents the arbitrary volume driver attributes.
# volumeAttributes:
# foo: "bar"
# END ONLY FOR CSI
# end pod

# start containers
Expand Down

0 comments on commit 36fd3db

Please sign in to comment.