777 on new scripts (+2 squashed commit)

Squashed commit:

[9ae7dd0f] add helm-docs to workflow

[2206f5ba] fix small typo in workflows (+1 squashed commits)

Squashed commits:

[29c2ceb4] Documentation-Cleanup (#181)

* work on readme generation

* document windows setup

* add simple pre-commit install script

* more docs for git setup

* Update pre-commit

* pre-commit automatic fixes

* Increase all patch versions

* Auto Readme and Config doc

* Auto app-readme.md generation

* increase common and common-test versions accordingly (due to cleanup)

* move contribution guidelines to /development in wiki

* fix some end-of-line issues (again)

* fix line 14 of workflows
This commit is contained in:
Kjeld Schouten-Lebbing
2021-02-23 18:21:54 +01:00
committed by kjeld Schouten-Lebbing
parent 94a6d6f9e1
commit 1d51be0e3d
674 changed files with 6631 additions and 1813 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v2
name: common-test
description: Helper chart to test different use cases of the common library
version: 1.3.0
version: 1.3.1
kubeVersion: ">=1.16.0-0"
keywords:
- truecharts
+60
View File
@@ -0,0 +1,60 @@
# common-test
![Version: 1.3.0](https://img.shields.io/badge/Version-1.3.0-informational?style=flat-square)
Helper chart to test different use cases of the common library
**Homepage:** <https://github.com/truecharts/truecharts/tree/master/charts/common-test>
## Maintainers
| Name | Email | Url |
| ---- | ------ | --- |
| truecharts | | |
## Requirements
Kubernetes: `>=1.16.0-0`
| Repository | Name | Version |
|------------|------|---------|
| file://../common | common | n/a |
## Values
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| appAdditionalServices.extra-tcp.enabled | bool | `true` | |
| appAdditionalServices.extra-tcp.port.name | string | `"tcp-test"` | |
| appAdditionalServices.extra-tcp.port.port | int | `51414` | |
| appAdditionalServices.extra-tcp.port.protocol | string | `"TCP"` | |
| appAdditionalServices.extra-tcp.port.targetPort | int | `51414` | |
| appAdditionalServices.extra-tcp.type | string | `"ClusterIP"` | |
| appAdditionalServices.extra-udp.enabled | bool | `true` | |
| appAdditionalServices.extra-udp.port.name | string | `"udp-test"` | |
| appAdditionalServices.extra-udp.port.port | int | `51414` | |
| appAdditionalServices.extra-udp.port.protocol | string | `"UDP"` | |
| appAdditionalServices.extra-udp.port.targetPort | int | `51414` | |
| appAdditionalServices.extra-udp.type | string | `"ClusterIP"` | |
| appAdditionalServicesEnabled | bool | `true` | |
| appVolumeMounts.data.datasetName | string | `"data"` | |
| appVolumeMounts.data.emptyDir | bool | `true` | |
| appVolumeMounts.data.enabled | bool | `true` | |
| appVolumeMounts.data.hostPath | string | `""` | |
| appVolumeMounts.data.hostPathEnabled | bool | `false` | |
| appVolumeMounts.data.mountPath | string | `"/data"` | |
| appVolumeMounts.test.datasetName | string | `"test"` | |
| appVolumeMounts.test.emptyDir | bool | `true` | |
| appVolumeMounts.test.enabled | bool | `true` | |
| appVolumeMounts.test.hostPath | string | `""` | |
| appVolumeMounts.test.hostPathEnabled | bool | `false` | |
| appVolumeMounts.test.mountPath | string | `"/test"` | |
| fixMountPermissions | bool | `false` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"b4bz/homer"` | |
| image.tag | string | `"latest"` | |
| ingress.enabled | bool | `true` | |
| service.port.port | int | `8080` | |
----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0)
@@ -25,7 +25,7 @@ addons:
volumeMounts:
- name: config
mountPath: /www/assets
fixMountPermissions: false
appVolumeMounts:
data:
@@ -42,7 +42,7 @@ appVolumeMounts:
mountPath: "/test"
hostPathEnabled: true
hostPath: "/tmp"
appAdditionalServicesEnabled: true
appAdditionalServices:
extra-tcp:
@@ -60,4 +60,4 @@ appAdditionalServices:
port: 51414
name: udp-test
protocol: UDP
targetPort: 51414
targetPort: 51414
+1 -1
View File
@@ -2,7 +2,7 @@ apiVersion: v2
name: common
description: Function library for TrueCharts
type: library
version: 1.3.0
version: 1.3.1
kubeVersion: ">=1.16.0-0"
# upstream_version: 3.0.1
+141 -89
View File
@@ -1,99 +1,151 @@
# Library chart for k8s@home media charts
# common
**WARNING: THIS CHART IS NOT MEANT TO BE INSTALLED DIRECTLY**
![Version: 1.3.0](https://img.shields.io/badge/Version-1.3.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
This is a [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm). It's purpose is for grouping common logic between the k8s@home charts.
Function library for TrueCharts
Since a lot of charts follow the same pattern this library was built to reduce maintenance cost between the charts that use it and try achieve a goal of being DRY.
**Homepage:** <https://github.com/truecharts/truecharts/tree/master/common>
## Introduction
## Maintainers
This chart provides common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager.
| Name | Email | Url |
| ---- | ------ | --- |
| truecharts | | |
## :star2: Changelog
## Requirements
Please refer to [CHANGELOG.md](CHANGELOG.md) for an overview of notable changes to the chart. **This is especially important for major version updates!**
Kubernetes: `>=1.16.0-0`
## TL;DR
## Values
When using one of the many charts that uses this library be sure to view this [values.yaml](./values.yaml) for configuration options. Any setting here can be used to define what values your helm deployment will use.
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| PGID | int | `568` | |
| PUID | int | `568` | |
| UMASK | string | `"002"` | |
| additionalContainers | list | `[]` | |
| additionalVolumeMounts | list | `[]` | |
| additionalVolumes | list | `[]` | |
| addons.codeserver.args[0] | string | `"--auth"` | |
| addons.codeserver.args[1] | string | `"none"` | |
| addons.codeserver.enabled | bool | `false` | |
| addons.codeserver.env | object | `{}` | |
| addons.codeserver.image.pullPolicy | string | `"IfNotPresent"` | |
| addons.codeserver.image.repository | string | `"codercom/code-server"` | |
| addons.codeserver.image.tag | string | `"3.7.4"` | |
| addons.codeserver.ingress.annotations | object | `{}` | |
| addons.codeserver.ingress.enabled | bool | `false` | |
| addons.codeserver.ingress.hosts[0].host | string | `"code.chart-example.local"` | |
| addons.codeserver.ingress.hosts[0].paths[0].path | string | `"/"` | |
| addons.codeserver.ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| addons.codeserver.ingress.labels | object | `{}` | |
| addons.codeserver.ingress.nameSuffix | string | `"codeserver"` | |
| addons.codeserver.ingress.tls | list | `[]` | |
| addons.codeserver.securityContext.runAsUser | int | `0` | |
| addons.codeserver.service.annotations | object | `{}` | |
| addons.codeserver.service.enabled | bool | `true` | |
| addons.codeserver.service.labels | object | `{}` | |
| addons.codeserver.service.port.name | string | `"codeserver"` | |
| addons.codeserver.service.port.port | int | `12321` | |
| addons.codeserver.service.port.protocol | string | `"TCP"` | |
| addons.codeserver.service.port.targetPort | string | `"codeserver"` | |
| addons.codeserver.service.type | string | `"ClusterIP"` | |
| addons.codeserver.volumeMounts | list | `[]` | |
| addons.codeserver.workingDir | string | `""` | |
| addons.vpn.additionalVolumeMounts | list | `[]` | |
| addons.vpn.configFile | string | `nil` | |
| addons.vpn.enabled | bool | `false` | |
| addons.vpn.env | object | `{}` | |
| addons.vpn.livenessProbe | object | `{}` | |
| addons.vpn.networkPolicy.egress | string | `nil` | |
| addons.vpn.networkPolicy.enabled | bool | `false` | |
| addons.vpn.openvpn.auth | string | `nil` | |
| addons.vpn.openvpn.authSecret | string | `nil` | |
| addons.vpn.openvpn.image.pullPolicy | string | `"IfNotPresent"` | |
| addons.vpn.openvpn.image.repository | string | `"dperson/openvpn-client"` | |
| addons.vpn.openvpn.image.tag | string | `"latest"` | |
| addons.vpn.scripts.down | string | `nil` | |
| addons.vpn.scripts.up | string | `nil` | |
| addons.vpn.securityContext.capabilities.add[0] | string | `"NET_ADMIN"` | |
| addons.vpn.securityContext.capabilities.add[1] | string | `"SYS_MODULE"` | |
| addons.vpn.type | string | `"openvpn"` | |
| addons.vpn.wireguard.image.pullPolicy | string | `"IfNotPresent"` | |
| addons.vpn.wireguard.image.repository | string | `"k8sathome/wireguard"` | |
| addons.vpn.wireguard.image.tag | string | `"1.0.20200827"` | |
| affinity | object | `{}` | |
| args | list | `[]` | |
| command | list | `[]` | |
| controllerAnnotations | object | `{}` | |
| controllerLabels | object | `{}` | |
| controllerType | string | `"deployment"` | |
| dnsPolicy | string | `"ClusterFirst"` | |
| enableServiceLinks | bool | `true` | |
| env | object | `{}` | |
| envFrom | list | `[]` | |
| envTpl | object | `{}` | |
| envValueFrom | object | `{}` | |
| fixMountPermissions | bool | `true` | |
| fullnameOverride | string | `""` | |
| hostAliases | list | `[]` | |
| hostNetwork | bool | `false` | |
| ingress.additionalIngresses | list | `[]` | |
| ingress.annotations | object | `{}` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0].host | string | `"chart-example.local"` | |
| ingress.hosts[0].paths[0].path | string | `"/"` | |
| ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| ingress.labels | object | `{}` | |
| ingress.tls | list | `[]` | |
| initContainers | list | `[]` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| persistence.config.accessMode | string | `"ReadWriteOnce"` | |
| persistence.config.enabled | bool | `false` | |
| persistence.config.mountPath | string | `"/config"` | |
| persistence.config.size | string | `"1Gi"` | |
| persistence.config.skipuninstall | bool | `false` | |
| persistence.shared.emptyDir | bool | `true` | |
| persistence.shared.enabled | bool | `false` | |
| persistence.shared.mountPath | string | `"/shared"` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| probes.liveness.custom | bool | `false` | |
| probes.liveness.enabled | bool | `true` | |
| probes.liveness.spec.failureThreshold | int | `5` | |
| probes.liveness.spec.initialDelaySeconds | int | `30` | |
| probes.liveness.spec.periodSeconds | int | `10` | |
| probes.liveness.spec.timeoutSeconds | int | `10` | |
| probes.readiness.custom | bool | `false` | |
| probes.readiness.enabled | bool | `true` | |
| probes.readiness.spec.failureThreshold | int | `5` | |
| probes.readiness.spec.initialDelaySeconds | int | `30` | |
| probes.readiness.spec.periodSeconds | int | `10` | |
| probes.readiness.spec.timeoutSeconds | int | `10` | |
| probes.startup.custom | bool | `false` | |
| probes.startup.enabled | bool | `true` | |
| probes.startup.spec.failureThreshold | int | `30` | |
| probes.startup.spec.initialDelaySeconds | int | `5` | |
| probes.startup.spec.periodSeconds | int | `10` | |
| probes.startup.spec.timeoutSeconds | int | `10` | |
| replicas | int | `1` | |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
| service.additionalPorts | list | `[]` | |
| service.additionalServices | list | `[]` | |
| service.annotations | object | `{}` | |
| service.enabled | bool | `true` | |
| service.labels | object | `{}` | |
| service.port.name | string | `nil` | |
| service.port.port | string | `nil` | |
| service.port.protocol | string | `"TCP"` | |
| service.port.targetPort | string | `nil` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `false` | |
| serviceAccount.name | string | `""` | |
| strategy.type | string | `"RollingUpdate"` | |
| tolerations | list | `[]` | |
| volumeClaimTemplates | list | `[]` | |
For example using the helm CLI tool
```bash
helm install node-red \
--set image.repository="nodered/node-red" \
--set image.tag="1.2.5" \
--set env.TZ="America/New_York" \
k8s-at-home/node-red
```
or
```yaml
# node-red-values.yaml
image:
repository: nodered/node-red
tag: 1.2.5
env:
TZ: America/New_York
```
```bash
helm install node-red \
--values=./node-red-values.yaml \
k8s-at-home/node-red
```
## Creating a new chart
First be sure to checkout the many charts that already use this like [qBittorrent](../qbittorrent/), [node-red](../node-red/) or the many others in this repository.
Include this chart as a dependency in your `Chart.yaml` e.g.
```yaml
# Chart.yaml
dependencies:
- name: common
version: x.x.x
repository: https://k8s-at-home.com/charts/
```
Write a `values.yaml` with some basic defaults you want to present to the user e.g.
```yaml
# Default values for node-red.
image:
repository: nodered/node-red
pullPolicy: IfNotPresent
tag: 1.2.5
strategy:
type: Recreate
# See more environment varaibles in the node-red documentation
# https://nodered.org/docs/getting-started/docker
env: {}
# TZ:
# NODE_OPTIONS:
# NODE_RED_ENABLE_PROJECTS:
# NODE_RED_ENABLE_SAFE_MODE:
# FLOWS:
service:
port:
port: 1880
persistence:
data:
enabled: false
emptyDir: false
mountPath: /data
```
If testing locally make sure you update the dependencies with:
```bash
helm dependency update
```
----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0)
+1 -1
View File
@@ -4,7 +4,7 @@ Main entrypoint for the common library chart. It will render all underlying temp
{{- define "common.all" -}}
{{- /* Merge the local chart values and the common chart defaults */ -}}
{{- include "common.values.setup" . }}
{{- /* Enable code-server add-on if required */ -}}
{{- if .Values.addons.codeserver.enabled }}
{{- include "common.addon.codeserver" . }}
+1 -1
View File
@@ -1,5 +1,5 @@
{{/*
This template serves as the blueprint for the DaemonSet objects that are created
This template serves as the blueprint for the DaemonSet objects that are created
within the common library.
*/}}
{{- define "common.daemonset" -}}
+1 -1
View File
@@ -1,5 +1,5 @@
{{/*
This template serves as the blueprint for the Deployment objects that are created
This template serves as the blueprint for the Deployment objects that are created
within the common library.
*/}}
{{- define "common.deployment" -}}
+2 -2
View File
@@ -1,5 +1,5 @@
{{/*
This template serves as the blueprint for the StatefulSet objects that are created
This template serves as the blueprint for the StatefulSet objects that are created
within the common library.
*/}}
{{- define "common.statefulset" -}}
@@ -41,7 +41,7 @@ spec:
- metadata:
name: {{ $vct.name }}
spec:
accessModes:
accessModes:
- {{ required (printf "accessMode is required for vCT %v" $vct.name) $vct.accessMode | quote }}
resources:
requests:
@@ -14,7 +14,7 @@ spec:
policyTypes:
- Egress
egress:
{{- with .Values.addons.vpn.networkPolicy.egress }}
{{- with .Values.addons.vpn.networkPolicy.egress }}
{{- . | toYaml | nindent 4 }}
{{- end -}}
{{- end -}}
+1 -1
View File
@@ -7,7 +7,7 @@ It will include / inject the required templates based on the given values.
{{- if eq "openvpn" .Values.addons.vpn.type -}}
{{- include "common.addon.openvpn" . }}
{{- end -}}
{{- if eq "wireguard" .Values.addons.vpn.type -}}
{{- include "common.addon.wireguard" . }}
{{- end -}}
@@ -15,7 +15,7 @@ env:
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if or .Values.addons.vpn.openvpn.auth .Values.addons.vpn.openvpn.authSecret }}
envFrom:
- secretRef:
@@ -1,7 +1,7 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Return a soft nodeAffinity definition
Return a soft nodeAffinity definition
{{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
*/}}
{{- define "common.affinities.nodes.soft" -}}
@@ -98,7 +98,7 @@ Params:
{{- $requiredPasswordError := include "common.validations.values.single.empty" $requiredPassword -}}
{{- $passwordValidationErrors := list $requiredPasswordError -}}
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $.context) -}}
{{- if .strong }}
{{- $subStr := list (lower (randAlpha 1)) (randNumeric 1) (upper (randAlpha 1)) | join "_" }}
{{- $password = randAscii $passwordLength }}
+2 -2
View File
@@ -41,7 +41,7 @@ Usage:
{{- $value = ( index $latestObj . ) -}}
{{- $latestObj = $value -}}
{{- end -}}
{{- printf "%v" (default "" $value) -}}
{{- printf "%v" (default "" $value) -}}
{{- end -}}
{{/*
@@ -58,5 +58,5 @@ Usage:
{{- $key = . }}
{{- end -}}
{{- end -}}
{{- printf "%s" $key -}}
{{- printf "%s" $key -}}
{{- end -}}
@@ -1,5 +1,5 @@
{{/*
This template serves as a blueprint for all Ingress objects that are created
This template serves as a blueprint for all Ingress objects that are created
within the common library.
*/}}
{{- define "common.classes.ingress" -}}
@@ -51,7 +51,7 @@ spec:
rules:
{{- range $values.hosts }}
{{- if .hostTpl }}
- host: {{ tpl .hostTpl $ | quote }}
- host: {{ tpl .hostTpl $ | quote }}
{{- else }}
- host: {{ .host | quote }}
{{- end }}
+1 -1
View File
@@ -1,5 +1,5 @@
{{/*
This template serves as a blueprint for all PersistentVolumeClaim objects that are created
This template serves as a blueprint for all PersistentVolumeClaim objects that are created
within the common library.
*/}}
{{- define "common.classes.pvc" -}}
@@ -1,5 +1,5 @@
{{/*
This template serves as a blueprint for all Service objects that are created
This template serves as a blueprint for all Service objects that are created
within the common library.
*/}}
{{- define "common.classes.service" -}}
@@ -32,4 +32,4 @@ Renders the additional ingress objects from appIngress
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,5 +1,5 @@
{{/*
This template serves as the blueprint for the mountPermissions job that is run
This template serves as the blueprint for the mountPermissions job that is run
before chart installation.
*/}}
{{- define "common.custom.mountpermissions" -}}
@@ -1,5 +1,5 @@
{{/*
This template serves as the blueprint for the mountPermissions job that is run
This template serves as the blueprint for the mountPermissions job that is run
before chart installation.
*/}}
{{- define "common.custom.mountpermissions.job" -}}
@@ -51,9 +51,9 @@ spec:
- |
chown -R {{ print .Values.PUID }}:{{ print .Values.PGID }} {{ print $values.mountPath }}
#args:
#
#
#securityContext:
#
#
volumeMounts:
{{- include "common.custom.configuredAppVolumeMounts" . | indent 12 }}
{{- with (include "common.controller.volumes" . | trim) }}
@@ -1,5 +1,5 @@
{{/*
This template serves as a blueprint for all appIngress objects that are created
This template serves as a blueprint for all appIngress objects that are created
within the common library.
*/}}
{{- define "common.custom.classes.appIngressHTTP" -}}
@@ -1,5 +1,5 @@
{{/*
This template serves as a blueprint for all appIngressTCP objects that are created
This template serves as a blueprint for all appIngressTCP objects that are created
within the common library.
*/}}
{{- define "common.custom.classes.appIngressTCP" -}}
@@ -23,7 +23,7 @@ metadata:
{{- include "common.labels" . | nindent 4 }}
annotations:
{{- if or (eq $values.certType "letsencrypt-prod") (eq $values.certType "letsencrypt-staging") }}
cert-manager.io/cluster-issuer: {{ $values.certType }}
cert-manager.io/cluster-issuer: {{ $values.certType }}
{{- end }}
{{- with $values.annotations }}
{{- toYaml . | nindent 4 }}
@@ -1,5 +1,5 @@
{{/*
This template serves as a blueprint for all appIngressTCP objects that are created
This template serves as a blueprint for all appIngressTCP objects that are created
within the common library.
*/}}
{{- define "common.custom.classes.appIngressUDP" -}}
@@ -1,4 +1,4 @@
{{/*
{{/*
Merge the local chart values and the common chart defaults.
*/}}
{{- define "common.values.setup" -}}
@@ -7,5 +7,5 @@ Merge the local chart values and the common chart defaults.
{{- $userValues := deepCopy (omit .Values "common") -}}
{{- $mergedValues := mustMergeOverwrite $defaultValues $userValues -}}
{{- $_ := set . "Values" (deepCopy $mergedValues) -}}
{{- end }}
{{- end }}
{{- end }}
@@ -45,7 +45,7 @@ The main container included in the controller.
{{- end }}
{{- range $key, $value := .Values.envValueFrom }}
- name: {{ $key }}
valueFrom:
valueFrom:
{{- $value | toYaml | nindent 8 }}
{{- end }}
{{- end }}
@@ -8,7 +8,7 @@ Probes selection logic.
{{- "" | nindent 0 }}
{{- $probeName }}Probe:
{{- if $probe.custom -}}
{{- $probe.spec | toYaml | nindent 2 }}
{{- $probe.spec | toYaml | nindent 2 }}
{{- else }}
{{- "tcpSocket:" | nindent 2 }}
{{- printf "port: %v" $svcPort | nindent 4 }}