mirror of
https://github.com/nikdoof/helm-charts.git
synced 2025-12-17 11:59:21 +00:00
Compare commits
64 Commits
plex-expor
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 193939bd06 | |||
| 814d439ea1 | |||
|
|
fc76008f70 | ||
|
|
7d9729648f | ||
| f3cc3e190c | |||
|
|
b176c1baa1 | ||
| 3c73ffec61 | |||
|
|
854de227c6 | ||
| 9e7e126e3b | |||
|
|
3477414580 | ||
| 7c9da31698 | |||
|
|
68bac6536f | ||
| 7c8fec46d2 | |||
|
|
057cff3c53 | ||
| 9e381e07bf | |||
| 28b2e73a1c | |||
|
|
49aead8392 | ||
|
|
5736e631b1 | ||
| 0cb9253cf2 | |||
|
|
ae4baa5a8d | ||
| ad896bfc25 | |||
|
|
c3f4320bc9 | ||
| e577d114a0 | |||
|
|
ee0dc43acb | ||
| 12d667302d | |||
| 71a2a2a3fe | |||
|
|
a2cfdc0fa5 | ||
| cc49faf2f2 | |||
|
|
7d49c188c9 | ||
| 9a201834c3 | |||
|
|
ee8767e7a6 | ||
|
b7dc73097a
|
|||
| 408afd720f | |||
|
c1fc20c281
|
|||
|
3d3535cb3b
|
|||
|
cc91cc2f98
|
|||
|
37615237d6
|
|||
|
30256c3ae5
|
|||
|
2f3d052cd5
|
|||
|
e091d3adbc
|
|||
|
bd0a2d1155
|
|||
|
e2bd3ff0b8
|
|||
|
4436e99f22
|
|||
|
41eeb4795d
|
|||
| acb65e778e | |||
| 3e65c6aff7 | |||
|
d9ed2b2bed
|
|||
| 855c04e7f3 | |||
|
|
067d636a28 | ||
|
|
37bfd4bdd5 | ||
|
396816c4a0
|
|||
|
1b7d8fd3e2
|
|||
|
3e2b990951
|
|||
|
2dc6067e10
|
|||
|
0565593931
|
|||
| 3c7c7ed7a1 | |||
|
39411f2306
|
|||
|
|
582b08a1a7 | ||
|
|
e595c03ce3 | ||
|
|
4a07da46b7 | ||
|
|
041349a168 | ||
|
|
9992558871 | ||
|
|
7982f72173 | ||
|
|
44f292950f |
1
.github/ct.yaml
vendored
1
.github/ct.yaml
vendored
@@ -8,3 +8,4 @@ chart-repos:
|
|||||||
- k8s-at-home-libraries=https://library-charts.k8s-at-home.com
|
- k8s-at-home-libraries=https://library-charts.k8s-at-home.com
|
||||||
- k8s-at-home=https://k8s-at-home.com/charts
|
- k8s-at-home=https://k8s-at-home.com/charts
|
||||||
- jetstack=https://charts.jetstack.io
|
- jetstack=https://charts.jetstack.io
|
||||||
|
- nikdoof=https://nikdoof.github.io/helm-charts/
|
||||||
|
|||||||
29
.github/workflows/lint-test.yaml
vendored
29
.github/workflows/lint-test.yaml
vendored
@@ -2,26 +2,31 @@ name: Lint and Test Charts
|
|||||||
|
|
||||||
on: pull_request
|
on: pull_request
|
||||||
|
|
||||||
|
env:
|
||||||
|
K8S_VERSION: 1.22
|
||||||
|
HELM_VERSION: 3.9.2
|
||||||
|
PYTHON_VERSION: 3.11
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Install Helm
|
||||||
uses: azure/setup-helm@v1
|
uses: azure/setup-helm@v4
|
||||||
with:
|
with:
|
||||||
version: v3.6.3
|
version: "v${{ env.HELM_VERSION }}"
|
||||||
|
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: "${{ env.PYTHON_VERSION }}"
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@v2.1.0
|
uses: helm/chart-testing-action@v2.7.0
|
||||||
|
|
||||||
- name: Run chart-testing (list-changed)
|
- name: Run chart-testing (list-changed)
|
||||||
id: list-changed
|
id: list-changed
|
||||||
@@ -34,15 +39,19 @@ jobs:
|
|||||||
- name: Run chart-testing (lint)
|
- name: Run chart-testing (lint)
|
||||||
run: ct lint --config .github/ct.yaml
|
run: ct lint --config .github/ct.yaml
|
||||||
|
|
||||||
- name: Create k3d cluster
|
- name: Create k8s Kind Cluster
|
||||||
uses: nolar/setup-k3d-k3s@v1
|
uses: helm/kind-action@v1.12.0
|
||||||
with:
|
|
||||||
version: v1.19
|
|
||||||
if: steps.list-changed.outputs.changed == 'true'
|
if: steps.list-changed.outputs.changed == 'true'
|
||||||
|
|
||||||
- name: Remove node taints
|
- name: Remove node taints
|
||||||
run: |
|
run: |
|
||||||
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
||||||
|
if: steps.list-changed.outputs.changed == 'true'
|
||||||
|
|
||||||
|
- name: Install CRDs
|
||||||
|
run: |
|
||||||
|
cat crds/*.yaml | kubectl apply -f -
|
||||||
|
if: steps.list-changed.outputs.changed == 'true'
|
||||||
|
|
||||||
- name: Run chart-testing (install)
|
- name: Run chart-testing (install)
|
||||||
run: ct install --config .github/ct.yaml
|
run: ct install --config .github/ct.yaml
|
||||||
|
|||||||
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@@ -20,12 +20,12 @@ jobs:
|
|||||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Install Helm
|
||||||
uses: azure/setup-helm@v1
|
uses: azure/setup-helm@v4
|
||||||
with:
|
with:
|
||||||
version: v3.4.0
|
version: v3.4.0
|
||||||
|
|
||||||
- name: Run chart-releaser
|
- name: Run chart-releaser
|
||||||
uses: helm/chart-releaser-action@v1.2.1
|
uses: helm/chart-releaser-action@v1.7.0
|
||||||
with:
|
with:
|
||||||
charts_repo_url: https://nikdoof.github.io/helm-charts
|
charts_repo_url: https://nikdoof.github.io/helm-charts
|
||||||
env:
|
env:
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -22,15 +22,13 @@ You can then run `helm search nikdoof` to see the charts.
|
|||||||
|
|
||||||
See [charts folder](./charts) for a complete list.
|
See [charts folder](./charts) for a complete list.
|
||||||
|
|
||||||
* [aaisp2mqtt](./charts/aaisp2mqtt) - A tool to pull information from [Andrews & Arnold](https://www.aa.net.uk/) CHAOSv2 API and output to MQTT.
|
|
||||||
* [idrac6](./charts/idrac6) - A VNC/Web UI container to wrap around the outdated Java/KVM solution in Dell iDRAC6, and make it HTML5.
|
|
||||||
* [vsphere-influxdb-go](./charts/vsphere-influxdb-go) - A vSphere statistics exporter that outputs to InfluxDB.
|
|
||||||
* [zigbee2mqttassistant](./charts/zigbee2mqttassistant) - A WebUI for Zigbee2MQTT.
|
|
||||||
* [hg612-exporter](./charts/hg612-exporter) - A Prometheus exporter for HG612 xDSL Modems.
|
|
||||||
* [aaisp-exporter](./charts/aaisp-exporter) - A Prometheus exporter for [Andrews & Arnold](https://www.aa.net.uk/) CHAOSv2 API.
|
* [aaisp-exporter](./charts/aaisp-exporter) - A Prometheus exporter for [Andrews & Arnold](https://www.aa.net.uk/) CHAOSv2 API.
|
||||||
|
* [antennas](./charts/antennas) - Proxy mapping service for allowing Plex to use TVHeadend.
|
||||||
|
* [hg612-exporter](./charts/hg612-exporter) - A Prometheus exporter for HG612 xDSL Modems.
|
||||||
|
* [idrac6](./charts/idrac6) - A VNC/Web UI container to wrap around the outdated Java/KVM solution in Dell iDRAC6, and make it HTML5.
|
||||||
|
* [mqtt-exporter](./charts/mqtt-exporter) - A generic Prometheus exporter for MQTT data, useful to export Home Assistant state data via MQTT.
|
||||||
* [plex-exporter](./charts/plex-exporter) - A Prometheus exporter for Plex Media Server.
|
* [plex-exporter](./charts/plex-exporter) - A Prometheus exporter for Plex Media Server.
|
||||||
* [vmware-exporter](./charts/vmware-exporter) - A Prometheus exporter for VMware vSphere.
|
* [vmware-exporter](./charts/vmware-exporter) - A Prometheus exporter for VMware vSphere.
|
||||||
* [mqtt-exporter](./charts/mqtt-exporter) - A generic Prometheus exporter for MQTT data.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,17 @@ apiVersion: v2
|
|||||||
appVersion: 0.2.1
|
appVersion: 0.2.1
|
||||||
description: A prometheus exporter for the Andrew & Arnold CHAOS API
|
description: A prometheus exporter for the Andrew & Arnold CHAOS API
|
||||||
name: aaisp-exporter
|
name: aaisp-exporter
|
||||||
version: 0.2.0
|
version: 0.2.3
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- aaisp-exporter
|
- aaisp-exporter
|
||||||
home: https://github.com/nikdoof/helm-charts/tree/master/charts/aaisp-exporter
|
home: https://github.com/nikdoof/helm-charts/tree/master/charts/aaisp-exporter
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/nikdoof/aaisp-chaos
|
- https://github.com/nikdoof/aaisp-chaos
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: nikdoof
|
- name: nikdoof
|
||||||
email: andy@tensixtyone.com
|
email: andy@tensixtyone.com
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: https://library-charts.k8s-at-home.com
|
repository: https://nikdoof.github.io/helm-charts/
|
||||||
version: 4.3.0
|
version: 4.5.3
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
|
||||||
apiVersion: monitoring.coreos.com/v1
|
|
||||||
kind: PrometheusRule
|
|
||||||
metadata:
|
|
||||||
name: {{ include "common.names.fullname" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.metrics.prometheusRule.labels }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
groups:
|
|
||||||
- name: {{ include "common.names.fullname" . }}
|
|
||||||
rules:
|
|
||||||
- alert: AAISPExporterAbsent
|
|
||||||
annotations:
|
|
||||||
description: AAISP Exporter has disappeared from Prometheus service discovery.
|
|
||||||
summary: AAISP Exporter is down.
|
|
||||||
expr: |
|
|
||||||
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
|
|
||||||
for: 5m
|
|
||||||
labels:
|
|
||||||
severity: critical
|
|
||||||
{{- with .Values.metrics.prometheusRule.rules }}
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{{- if .Values.metrics.enabled }}
|
|
||||||
apiVersion: monitoring.coreos.com/v1
|
|
||||||
kind: ServiceMonitor
|
|
||||||
metadata:
|
|
||||||
name: {{ include "common.names.fullname" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.metrics.serviceMonitor.labels }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
|
||||||
endpoints:
|
|
||||||
- port: metrics
|
|
||||||
{{- with .Values.metrics.serviceMonitor.interval }}
|
|
||||||
interval: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
|
|
||||||
scrapeTimeout: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
path: /metrics
|
|
||||||
{{- end }}
|
|
||||||
@@ -48,15 +48,15 @@ metrics:
|
|||||||
prometheusRule:
|
prometheusRule:
|
||||||
enabled: false
|
enabled: false
|
||||||
labels: {}
|
labels: {}
|
||||||
# -- Configure additionial rules for the chart under this key.
|
# -- Configure additional rules for the chart under this key.
|
||||||
# @default -- See prometheusrules.yaml
|
# @default -- See prometheusrules.yaml
|
||||||
rules: []
|
rules:
|
||||||
# - alert: aaispExporterAbsent
|
- alert: AAISPExporterAbsent
|
||||||
# annotations:
|
annotations:
|
||||||
# description: aaisp Exporter has disappeared from Prometheus service discovery.
|
description: AAISP Exporter has disappeared from Prometheus service discovery.
|
||||||
# summary: aaisp Exporter is down.
|
summary: AAISP Exporter is down.
|
||||||
# expr: |
|
expr: |
|
||||||
# absent(up{job=~".*aaispexporter.*"} == 1)
|
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
|
||||||
# for: 5m
|
for: 5m
|
||||||
# labels:
|
labels:
|
||||||
# severity: critical
|
severity: critical
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
# Patterns to ignore when building packages.
|
|
||||||
# This supports shell glob matching, relative path matching, and
|
|
||||||
# negation (prefixed with !). Only one pattern per line.
|
|
||||||
.DS_Store
|
|
||||||
# Common VCS dirs
|
|
||||||
.git/
|
|
||||||
.gitignore
|
|
||||||
.bzr/
|
|
||||||
.bzrignore
|
|
||||||
.hg/
|
|
||||||
.hgignore
|
|
||||||
.svn/
|
|
||||||
# Common backup files
|
|
||||||
*.swp
|
|
||||||
*.bak
|
|
||||||
*.tmp
|
|
||||||
*~
|
|
||||||
# Various IDEs
|
|
||||||
.project
|
|
||||||
.idea/
|
|
||||||
*.tmproj
|
|
||||||
.vscode/
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
appVersion: "0.3.1"
|
|
||||||
description: Pulls data from the AAISP CHAOSv2 API into MQTT
|
|
||||||
name: aaisp2mqtt
|
|
||||||
version: 0.3.3
|
|
||||||
keywords:
|
|
||||||
- aaisp
|
|
||||||
- mqtt
|
|
||||||
home: https://github.com/nikdoof/aaisp2mqtt
|
|
||||||
sources:
|
|
||||||
- https://hub.docker.com/r/nikdoof/aaisp2mqtt/
|
|
||||||
- https://github.com/natm/aaisp2mqtt
|
|
||||||
maintainers:
|
|
||||||
- name: nikdoof
|
|
||||||
email: andy@tensixtyone.com
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
# aaisp2mqtt
|
|
||||||
|
|
||||||
 
|
|
||||||
|
|
||||||
Pulls data from the AAISP CHAOSv2 API into MQTT
|
|
||||||
|
|
||||||
**Homepage:** <https://github.com/nikdoof/aaisp2mqtt>
|
|
||||||
|
|
||||||
## Maintainers
|
|
||||||
|
|
||||||
| Name | Email | Url |
|
|
||||||
| ---- | ------ | --- |
|
|
||||||
| nikdoof | andy@tensixtyone.com | |
|
|
||||||
|
|
||||||
## Source Code
|
|
||||||
|
|
||||||
* <https://hub.docker.com/r/nikdoof/aaisp2mqtt/>
|
|
||||||
* <https://github.com/natm/aaisp2mqtt>
|
|
||||||
|
|
||||||
## Values
|
|
||||||
|
|
||||||
| Key | Type | Default | Description |
|
|
||||||
|-----|------|---------|-------------|
|
|
||||||
| aaisp | object | `{}` | |
|
|
||||||
| affinity | object | `{}` | |
|
|
||||||
| cronjob.concurrencyPolicy | string | `"Allow"` | |
|
|
||||||
| cronjob.failedJobsHistoryLimit | int | `1` | |
|
|
||||||
| cronjob.schedule | string | `"*/10 * * * *"` | |
|
|
||||||
| cronjob.successfulJobsHistoryLimit | int | `3` | |
|
|
||||||
| fullnameOverride | string | `""` | |
|
|
||||||
| homeassistant.enabled | bool | `false` | |
|
|
||||||
| image.pullPolicy | string | `"IfNotPresent"` | |
|
|
||||||
| image.repository | string | `"nikdoof/aaisp2mqtt"` | |
|
|
||||||
| image.tag | string | `"0.3.1"` | |
|
|
||||||
| mqtt.authenticated | bool | `false` | |
|
|
||||||
| mqtt.port | int | `1883` | |
|
|
||||||
| nameOverride | string | `""` | |
|
|
||||||
| nodeSelector | object | `{}` | |
|
|
||||||
| replicaCount | int | `1` | |
|
|
||||||
| resources | object | `{}` | |
|
|
||||||
| tolerations | list | `[]` | |
|
|
||||||
|
|
||||||
----------------------------------------------
|
|
||||||
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0)
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
mqtt:
|
|
||||||
broker: localhost
|
|
||||||
|
|
||||||
existingSecretName: aaisp2mqtt-secret
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
aaisp:
|
|
||||||
username: test1@a
|
|
||||||
password: TesttestTest
|
|
||||||
|
|
||||||
mqtt:
|
|
||||||
broker: localhost
|
|
||||||
|
|
||||||
homeassistant:
|
|
||||||
enabled: true
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
aaisp:
|
|
||||||
username: test1@a
|
|
||||||
password: TesttestTest
|
|
||||||
|
|
||||||
mqtt:
|
|
||||||
broker: localhost
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
{{/* vim: set filetype=mustache: */}}
|
|
||||||
{{/*
|
|
||||||
Expand the name of the chart.
|
|
||||||
*/}}
|
|
||||||
{{- define "aaisp2mqtt.name" -}}
|
|
||||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Create a default fully qualified app name.
|
|
||||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
||||||
If release name contains chart name it will be used as a full name.
|
|
||||||
*/}}
|
|
||||||
{{- define "aaisp2mqtt.fullname" -}}
|
|
||||||
{{- if .Values.fullnameOverride -}}
|
|
||||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
|
||||||
{{- if contains $name .Release.Name -}}
|
|
||||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Create chart name and version as used by the chart label.
|
|
||||||
*/}}
|
|
||||||
{{- define "aaisp2mqtt.chart" -}}
|
|
||||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Common labels
|
|
||||||
*/}}
|
|
||||||
{{- define "aaisp2mqtt.labels" -}}
|
|
||||||
app.kubernetes.io/name: {{ include "aaisp2mqtt.name" . }}
|
|
||||||
helm.sh/chart: {{ include "aaisp2mqtt.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
{{- if .Chart.AppVersion }}
|
|
||||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
||||||
{{- end }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Create the name of the service account to use
|
|
||||||
*/}}
|
|
||||||
{{- define "aaisp2mqtt.serviceAccountName" -}}
|
|
||||||
{{- if .Values.serviceAccount.create -}}
|
|
||||||
{{ default (include "aaisp2mqtt.fullname" .) .Values.serviceAccount.name }}
|
|
||||||
{{- else -}}
|
|
||||||
{{ default "default" .Values.serviceAccount.name }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: batch/v1beta1
|
|
||||||
kind: CronJob
|
|
||||||
metadata:
|
|
||||||
name: {{ include "aaisp2mqtt.fullname" . }}-cronjob
|
|
||||||
{{- if .Values.deploymentAnnotations }}
|
|
||||||
annotations:
|
|
||||||
{{- range $key, $value := .Values.deploymentAnnotations }}
|
|
||||||
{{ $key }}: {{ $value | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: {{ include "aaisp2mqtt.name" . }}
|
|
||||||
helm.sh/chart: {{ include "aaisp2mqtt.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ include "aaisp2mqtt.name" . }}
|
|
||||||
spec:
|
|
||||||
schedule: {{ .Values.cronjob.schedule | quote }}
|
|
||||||
successfulJobsHistoryLimit: {{ .Values.cronjob.successfulJobsHistoryLimit }}
|
|
||||||
failedJobsHistoryLimit: {{ .Values.cronjob.failedJobsHistoryLimit }}
|
|
||||||
concurrencyPolicy: {{ .Values.cronjob.concurrencyPolicy }}
|
|
||||||
{{- if .Values.cronjob.startingDeadlineSeconds }}
|
|
||||||
startingDeadlineSeconds: {{ .Values.cronjob.startingDeadlineSeconds }}
|
|
||||||
{{- end }}
|
|
||||||
jobTemplate:
|
|
||||||
spec:
|
|
||||||
backoffLimit: 0
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: {{ include "aaisp2mqtt.name" . }}
|
|
||||||
helm.sh/chart: {{ include "aaisp2mqtt.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ include "aaisp2mqtt.name" . }}
|
|
||||||
spec:
|
|
||||||
restartPolicy: Never
|
|
||||||
{{- if .Values.image.pullSecrets }}
|
|
||||||
imagePullSecrets:
|
|
||||||
{{- range .Values.image.pullSecrets }}
|
|
||||||
- name: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
|
||||||
- name: {{ .Chart.Name }}
|
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
resources:
|
|
||||||
{{ toYaml .Values.resources | indent 16 }}
|
|
||||||
env:
|
|
||||||
- name: AAISP_USERNAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ default "aaisp2mqtt-secret" .Values.existingSecretName }}
|
|
||||||
key: aaisp.username
|
|
||||||
- name: AAISP_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ default "aaisp2mqtt-secret" .Values.existingSecretName }}
|
|
||||||
key: aaisp.password
|
|
||||||
- name: MQTT_BROKER
|
|
||||||
value: {{ .Values.mqtt.broker }}
|
|
||||||
- name: MQTT_PORT
|
|
||||||
value: "{{ default 1883 .Values.mqtt.port }}"
|
|
||||||
{{- if .Values.mqtt.authenticated }}
|
|
||||||
- name: MQTT_USERNAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ default "aaisp2mqtt-secret" .Values.existingSecretName }}
|
|
||||||
key: mqtt.username
|
|
||||||
- name: MQTT_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ default "aaisp2mqtt-secret" .Values.existingSecretName }}
|
|
||||||
key: mqtt.password
|
|
||||||
{{- end }}
|
|
||||||
- name: MQTT_TOPIC_PREFIX
|
|
||||||
value: {{ default "aaisp" .Values.mqtt.topicPrefix }}
|
|
||||||
{{- if .Values.homeassistant.enabled }}
|
|
||||||
- name: HOMEASSISTANT_ENABLED
|
|
||||||
value: '{{ .Values.homeassistant.enabled }}'
|
|
||||||
{{- if .Values.homeassistant.discoveryPrefix }}
|
|
||||||
- name: HOMEASSISTANT_DISCOVERY_PREFIX
|
|
||||||
value: {{ .Values.homeassistant.discoveryPrefix }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.nodeSelector }}
|
|
||||||
nodeSelector:
|
|
||||||
{{ toYaml . | indent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.affinity }}
|
|
||||||
affinity:
|
|
||||||
{{ toYaml . | indent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{ toYaml . | indent 12 }}:
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
{{- if not (.Values.existingSecretName) }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: aaisp2mqtt-secret
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: {{ include "aaisp2mqtt.name" . }}
|
|
||||||
helm.sh/chart: {{ include "aaisp2mqtt.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ include "aaisp2mqtt.name" . }}
|
|
||||||
type: Opaque
|
|
||||||
data:
|
|
||||||
aaisp.username: {{ .Values.aaisp.username | b64enc }}
|
|
||||||
aaisp.password: {{ .Values.aaisp.password | b64enc }}
|
|
||||||
{{- if .Values.mqtt.authenticated }}
|
|
||||||
mqtt.username: {{ .Values.mqtt.username | b64enc }}
|
|
||||||
mqtt.password: {{ .Values.mqtt.password | b64enc }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
# Default values for aaisp2mqtt.
|
|
||||||
# This is a YAML-formatted file.
|
|
||||||
# Declare variables to be passed into your templates.
|
|
||||||
|
|
||||||
replicaCount: 1
|
|
||||||
|
|
||||||
image:
|
|
||||||
repository: nikdoof/aaisp2mqtt
|
|
||||||
tag: 0.3.1
|
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
# imagePullSecrets: []
|
|
||||||
|
|
||||||
nameOverride: ""
|
|
||||||
fullnameOverride: ""
|
|
||||||
|
|
||||||
## Use a pre-existing secret for login information
|
|
||||||
##
|
|
||||||
# existingSecretName: existing-secret
|
|
||||||
|
|
||||||
## Connection details
|
|
||||||
##
|
|
||||||
aaisp: {}
|
|
||||||
# username: user1@a
|
|
||||||
# password: password
|
|
||||||
|
|
||||||
mqtt:
|
|
||||||
# broker: localhost
|
|
||||||
port: 1883
|
|
||||||
authenticated: false
|
|
||||||
# username: kube
|
|
||||||
# password: kube
|
|
||||||
# topicPrefix: aaisp
|
|
||||||
|
|
||||||
homeassistant:
|
|
||||||
enabled: false
|
|
||||||
# discoveryPrefix: homeassistant
|
|
||||||
|
|
||||||
cronjob:
|
|
||||||
schedule: "*/10 * * * *"
|
|
||||||
successfulJobsHistoryLimit: 3
|
|
||||||
failedJobsHistoryLimit: 1
|
|
||||||
# startingDeadlineSeconds: 10
|
|
||||||
concurrencyPolicy: Allow
|
|
||||||
|
|
||||||
resources: {}
|
|
||||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
|
||||||
# choice for the user. This also increases chances charts run on environments with little
|
|
||||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
|
||||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
|
||||||
# limits:
|
|
||||||
# cpu: 100m
|
|
||||||
# memory: 128Mi
|
|
||||||
# requests:
|
|
||||||
# cpu: 100m
|
|
||||||
# memory: 128Mi
|
|
||||||
|
|
||||||
nodeSelector: {}
|
|
||||||
|
|
||||||
tolerations: []
|
|
||||||
|
|
||||||
affinity: {}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
appVersion: "4.1.0"
|
appVersion: "4.2.0"
|
||||||
description: Antennas
|
description: Antennas
|
||||||
name: antennas
|
name: antennas
|
||||||
version: 1.1.0
|
version: 1.1.4
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- tvheadend
|
- tvheadend
|
||||||
@@ -17,5 +17,5 @@ maintainers:
|
|||||||
email: andy@tensixtyone.com
|
email: andy@tensixtyone.com
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: https://library-charts.k8s-at-home.com
|
repository: https://nikdoof.github.io/helm-charts/
|
||||||
version: 4.3.0
|
version: 4.5.3
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{- include "common.values.setup" . -}}
|
||||||
{{- $values := .Values.service -}}
|
{{- $values := .Values.service -}}
|
||||||
{{- $serviceName := include "common.names.fullname" . -}}
|
{{- $serviceName := include "common.names.fullname" . -}}
|
||||||
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ image:
|
|||||||
# -- image repository
|
# -- image repository
|
||||||
repository: thejf/antennas
|
repository: thejf/antennas
|
||||||
# -- image tag
|
# -- image tag
|
||||||
tag: 4.1.0
|
tag: 4.2.0
|
||||||
# -- image pull policy
|
# -- image pull policy
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
|||||||
@@ -20,3 +20,7 @@
|
|||||||
.idea/
|
.idea/
|
||||||
*.tmproj
|
*.tmproj
|
||||||
.vscode/
|
.vscode/
|
||||||
|
# OWNERS file for Kubernetes
|
||||||
|
OWNERS
|
||||||
|
# helm-docs templates
|
||||||
|
*.gotmpl
|
||||||
11
charts/common-chart/Chart.yaml
Normal file
11
charts/common-chart/Chart.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v2
|
||||||
|
description: A simple wrapper chart around the common chart
|
||||||
|
name: common-chart
|
||||||
|
version: 1.2.3
|
||||||
|
maintainers:
|
||||||
|
- name: nikdoof
|
||||||
|
dependencies:
|
||||||
|
- name: common
|
||||||
|
repository: https://nikdoof.github.io/helm-charts/
|
||||||
|
version: 4.5.3
|
||||||
2
charts/common-chart/templates/common.yaml
Normal file
2
charts/common-chart/templates/common.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
{{ include "common.all" . }}
|
||||||
1
charts/common-chart/values.yaml
Normal file
1
charts/common-chart/values.yaml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
---
|
||||||
@@ -20,3 +20,9 @@
|
|||||||
.idea/
|
.idea/
|
||||||
*.tmproj
|
*.tmproj
|
||||||
.vscode/
|
.vscode/
|
||||||
|
# OWNERS file for Kubernetes
|
||||||
|
OWNERS
|
||||||
|
# helm-docs templates
|
||||||
|
*.gotmpl
|
||||||
|
# Test files
|
||||||
|
tests/
|
||||||
11
charts/common/Chart.yaml
Normal file
11
charts/common/Chart.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: common
|
||||||
|
description: Common chart library, based off KaH's common
|
||||||
|
type: library
|
||||||
|
version: 4.5.3
|
||||||
|
kubeVersion: ">=1.16.0-0"
|
||||||
|
keywords:
|
||||||
|
- common
|
||||||
|
home: https://github.com/nikdoof/helm-charts/tree/main/stable/common
|
||||||
|
maintainers:
|
||||||
|
- name: nikdoof
|
||||||
66
charts/common/templates/_all.tpl
Normal file
66
charts/common/templates/_all.tpl
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{{/*
|
||||||
|
Main entrypoint for the common library chart. It will render all underlying templates based on the provided values.
|
||||||
|
*/}}
|
||||||
|
{{- 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" . }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* Enable VPN add-on if required */ -}}
|
||||||
|
{{- if .Values.addons.vpn.enabled }}
|
||||||
|
{{- include "common.addon.vpn" . }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* Enable promtail add-on if required */ -}}
|
||||||
|
{{- if .Values.addons.promtail.enabled }}
|
||||||
|
{{- include "common.addon.promtail" . }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* Enable netshoot add-on if required */ -}}
|
||||||
|
{{- if .Values.addons.netshoot.enabled }}
|
||||||
|
{{- include "common.addon.netshoot" . }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ include "common.configmap" . | nindent 0 }}
|
||||||
|
|
||||||
|
{{- /* Build the templates */ -}}
|
||||||
|
{{- include "common.pvc" . }}
|
||||||
|
|
||||||
|
{{- if .Values.serviceAccount.create -}}
|
||||||
|
{{- include "common.serviceAccount" . }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if .Values.controller.enabled }}
|
||||||
|
{{- if eq .Values.controller.type "deployment" }}
|
||||||
|
{{- include "common.deployment" . | nindent 0 }}
|
||||||
|
{{ else if eq .Values.controller.type "daemonset" }}
|
||||||
|
{{- include "common.daemonset" . | nindent 0 }}
|
||||||
|
{{ else if eq .Values.controller.type "statefulset" }}
|
||||||
|
{{- include "common.statefulset" . | nindent 0 }}
|
||||||
|
{{ else }}
|
||||||
|
{{- fail (printf "Not a valid controller.type (%s)" .Values.controller.type) }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ include "common.classes.hpa" . | nindent 0 }}
|
||||||
|
|
||||||
|
{{ include "common.service" . | nindent 0 }}
|
||||||
|
|
||||||
|
{{ include "common.ingress" . | nindent 0 }}
|
||||||
|
|
||||||
|
{{- if .Values.secret -}}
|
||||||
|
{{ include "common.secret" . | nindent 0 }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if .Values.metrics.enabled -}}
|
||||||
|
{{ include "common.serviceMonitor" . | nindent 0 }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled -}}
|
||||||
|
{{ include "common.prometheusRule" . | nindent 0 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
19
charts/common/templates/_configmap.tpl
Normal file
19
charts/common/templates/_configmap.tpl
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{{/*
|
||||||
|
Renders the configMap objects required by the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.configmap" -}}
|
||||||
|
{{- /* Generate named configMaps as required */ -}}
|
||||||
|
{{- range $name, $configmap := .Values.configmap }}
|
||||||
|
{{- if $configmap.enabled -}}
|
||||||
|
{{- $configmapValues := $configmap -}}
|
||||||
|
|
||||||
|
{{/* set the default nameOverride to the configMap name */}}
|
||||||
|
{{- if not $configmapValues.nameOverride -}}
|
||||||
|
{{- $_ := set $configmapValues "nameOverride" $name -}}
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
|
{{- $_ := set $ "ObjectValues" (dict "configmap" $configmapValues) -}}
|
||||||
|
{{- include "common.classes.configmap" $ }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
35
charts/common/templates/_daemonset.tpl
Normal file
35
charts/common/templates/_daemonset.tpl
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{{/*
|
||||||
|
This template serves as the blueprint for the DaemonSet objects that are created
|
||||||
|
within the common library.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.daemonset" }}
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: DaemonSet
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
{{- with (merge (.Values.controller.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||||
|
labels: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with (merge (.Values.controller.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||||
|
annotations: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
revisionHistoryLimit: {{ .Values.controller.revisionHistoryLimit }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
{{- with include ("common.podAnnotations") . }}
|
||||||
|
annotations:
|
||||||
|
{{- . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
{{- include "common.labels.selectorLabels" . | nindent 8 }}
|
||||||
|
{{- with .Values.podLabels }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- include "common.controller.pod" . | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
53
charts/common/templates/_deployment.tpl
Normal file
53
charts/common/templates/_deployment.tpl
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{{/*
|
||||||
|
This template serves as the blueprint for the Deployment objects that are created
|
||||||
|
within the common library.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.deployment" }}
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
{{- with (merge (.Values.controller.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||||
|
labels: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with (merge (.Values.controller.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||||
|
annotations: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
revisionHistoryLimit: {{ .Values.controller.revisionHistoryLimit }}
|
||||||
|
replicas: {{ .Values.controller.replicas }}
|
||||||
|
{{- $strategy := default "Recreate" .Values.controller.strategy }}
|
||||||
|
{{- if and (ne $strategy "Recreate") (ne $strategy "RollingUpdate") }}
|
||||||
|
{{- fail (printf "Not a valid strategy type for Deployment (%s)" $strategy) }}
|
||||||
|
{{- end }}
|
||||||
|
strategy:
|
||||||
|
type: {{ $strategy }}
|
||||||
|
{{- with .Values.controller.rollingUpdate }}
|
||||||
|
{{- if and (eq $strategy "RollingUpdate") (or .surge .unavailable) }}
|
||||||
|
rollingUpdate:
|
||||||
|
{{- with .unavailable }}
|
||||||
|
maxUnavailable: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .surge }}
|
||||||
|
maxSurge: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
{{- with include ("common.podAnnotations") . }}
|
||||||
|
annotations:
|
||||||
|
{{- . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
{{- include "common.labels.selectorLabels" . | nindent 8 }}
|
||||||
|
{{- with .Values.podLabels }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- include "common.controller.pod" . | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
39
charts/common/templates/_ingress.tpl
Normal file
39
charts/common/templates/_ingress.tpl
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{{/* Renders the Ingress objects required by the chart */}}
|
||||||
|
{{- define "common.ingress" -}}
|
||||||
|
{{- /* Generate named ingresses as required */ -}}
|
||||||
|
{{- range $name, $ingress := .Values.ingress }}
|
||||||
|
{{- if $ingress.enabled -}}
|
||||||
|
{{- $ingressValues := $ingress -}}
|
||||||
|
|
||||||
|
{{/* set defaults */}}
|
||||||
|
{{- if and (not $ingressValues.nameOverride) (ne $name (include "common.ingress.primary" $)) -}}
|
||||||
|
{{- $_ := set $ingressValues "nameOverride" $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $_ := set $ "ObjectValues" (dict "ingress" $ingressValues) -}}
|
||||||
|
{{- include "common.classes.ingress" $ }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/* Return the name of the primary ingress object */}}
|
||||||
|
{{- define "common.ingress.primary" -}}
|
||||||
|
{{- $enabledIngresses := dict -}}
|
||||||
|
{{- range $name, $ingress := .Values.ingress -}}
|
||||||
|
{{- if $ingress.enabled -}}
|
||||||
|
{{- $_ := set $enabledIngresses $name . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $result := "" -}}
|
||||||
|
{{- range $name, $ingress := $enabledIngresses -}}
|
||||||
|
{{- if and (hasKey $ingress "primary") $ingress.primary -}}
|
||||||
|
{{- $result = $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not $result -}}
|
||||||
|
{{- $result = keys $enabledIngresses | first -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $result -}}
|
||||||
|
{{- end -}}
|
||||||
56
charts/common/templates/_notes.tpl
Normal file
56
charts/common/templates/_notes.tpl
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{{/*
|
||||||
|
Default NOTES.txt content.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.notes.defaultNotes" -}}
|
||||||
|
|
||||||
|
{{- $primaryIngress := get .Values.ingress (include "common.ingress.primary" .) -}}
|
||||||
|
{{- $primaryService := get .Values.service (include "common.service.primary" .) -}}
|
||||||
|
{{- $primaryPort := "" -}}
|
||||||
|
{{- if $primaryService -}}
|
||||||
|
{{- $primaryPort = get $primaryService.ports (include "common.classes.service.ports.primary" (dict "serviceName" (include "common.service.primary" .) "values" $primaryService)) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $prefix := "http" -}}
|
||||||
|
{{- if $primaryPort }}
|
||||||
|
{{- if hasKey $primaryPort "protocol" }}
|
||||||
|
{{- if eq $primaryPort.protocol "HTTPS" }}
|
||||||
|
{{- $prefix = "https" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if $primaryIngress }}
|
||||||
|
1. Access the application by visiting one of these URL's:
|
||||||
|
{{ range $primaryIngress.hosts }}
|
||||||
|
{{- $protocol := "http" -}}
|
||||||
|
{{ if $primaryIngress.tls -}}
|
||||||
|
{{- $prefix = "https" -}}
|
||||||
|
{{ end -}}
|
||||||
|
{{- $host := .host -}}
|
||||||
|
{{ if .hostTpl -}}
|
||||||
|
{{- $host = tpl .hostTpl $ -}}
|
||||||
|
{{ end }}
|
||||||
|
{{- $path := (first .paths).path | default "/" -}}
|
||||||
|
{{ if (first .paths).pathTpl -}}
|
||||||
|
{{- $path = tpl (first .paths).pathTpl $ -}}
|
||||||
|
{{ end }}
|
||||||
|
- {{ $protocol }}://{{- $host }}{{- $path }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if and $primaryService $primaryPort }}
|
||||||
|
1. Get the application URL by running these commands:
|
||||||
|
{{- if contains "NodePort" $primaryService.type }}
|
||||||
|
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.names.fullname" . }})
|
||||||
|
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||||
|
echo {{ $prefix }}://$NODE_IP:$NODE_PORT
|
||||||
|
{{- else if contains "LoadBalancer" $primaryService.type }}
|
||||||
|
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||||
|
You can watch the status of by running 'kubectl get svc -w {{ include "common.names.fullname" . }}'
|
||||||
|
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||||
|
echo {{ $prefix }}://$SERVICE_IP:{{ $primaryPort.port }}
|
||||||
|
{{- else if contains "ClusterIP" $primaryService.type }}
|
||||||
|
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "common.names.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||||
|
echo "Visit {{ $prefix }}://127.0.0.1:8080 to use your application"
|
||||||
|
kubectl port-forward $POD_NAME 8080:{{ $primaryPort.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
{{- define "common.prometheusRule" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: PrometheusRule
|
kind: PrometheusRule
|
||||||
metadata:
|
metadata:
|
||||||
@@ -12,15 +13,6 @@ spec:
|
|||||||
groups:
|
groups:
|
||||||
- name: {{ include "common.names.fullname" . }}
|
- name: {{ include "common.names.fullname" . }}
|
||||||
rules:
|
rules:
|
||||||
- alert: PlexExporterAbsent
|
|
||||||
annotations:
|
|
||||||
description: Plex Exporter has disappeared from Prometheus service discovery.
|
|
||||||
summary: Plex Exporter is down.
|
|
||||||
expr: |
|
|
||||||
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
|
|
||||||
for: 5m
|
|
||||||
labels:
|
|
||||||
severity: critical
|
|
||||||
{{- with .Values.metrics.prometheusRule.rules }}
|
{{- with .Values.metrics.prometheusRule.rules }}
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
16
charts/common/templates/_pvc.tpl
Normal file
16
charts/common/templates/_pvc.tpl
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{{/*
|
||||||
|
Renders the Persistent Volume Claim objects required by the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.pvc" -}}
|
||||||
|
{{- /* Generate pvc as required */ -}}
|
||||||
|
{{- range $index, $PVC := .Values.persistence }}
|
||||||
|
{{- if and $PVC.enabled (eq (default "pvc" $PVC.type) "pvc") (not $PVC.existingClaim) -}}
|
||||||
|
{{- $persistenceValues := $PVC -}}
|
||||||
|
{{- if not $persistenceValues.nameOverride -}}
|
||||||
|
{{- $_ := set $persistenceValues "nameOverride" $index -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $_ := set $ "ObjectValues" (dict "persistence" $persistenceValues) -}}
|
||||||
|
{{- include "common.classes.pvc" $ | nindent 0 -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
17
charts/common/templates/_secret.tpl
Normal file
17
charts/common/templates/_secret.tpl
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{{/*
|
||||||
|
The Secret object to be created.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.secret" }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels: {{- include "common.labels" $ | nindent 4 }}
|
||||||
|
annotations: {{- include "common.annotations" $ | nindent 4 }}
|
||||||
|
type: Opaque
|
||||||
|
{{- with .Values.secret }}
|
||||||
|
stringData:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
43
charts/common/templates/_service.tpl
Normal file
43
charts/common/templates/_service.tpl
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{{/*
|
||||||
|
Renders the Service objects required by the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.service" -}}
|
||||||
|
{{- /* Generate named services as required */ -}}
|
||||||
|
{{- range $name, $service := .Values.service }}
|
||||||
|
{{- if $service.enabled -}}
|
||||||
|
{{- $serviceValues := $service -}}
|
||||||
|
|
||||||
|
{{/* set the default nameOverride to the service name */}}
|
||||||
|
{{- if and (not $serviceValues.nameOverride) (ne $name (include "common.service.primary" $)) -}}
|
||||||
|
{{- $_ := set $serviceValues "nameOverride" $name -}}
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
|
{{- $_ := set $ "ObjectValues" (dict "service" $serviceValues) -}}
|
||||||
|
{{- include "common.classes.service" $ }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the primary service object
|
||||||
|
*/}}
|
||||||
|
{{- define "common.service.primary" -}}
|
||||||
|
{{- $enabledServices := dict -}}
|
||||||
|
{{- range $name, $service := .Values.service -}}
|
||||||
|
{{- if $service.enabled -}}
|
||||||
|
{{- $_ := set $enabledServices $name . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $result := "" -}}
|
||||||
|
{{- range $name, $service := $enabledServices -}}
|
||||||
|
{{- if and (hasKey $service "primary") $service.primary -}}
|
||||||
|
{{- $result = $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not $result -}}
|
||||||
|
{{- $result = keys $enabledServices | first -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $result -}}
|
||||||
|
{{- end -}}
|
||||||
14
charts/common/templates/_serviceaccount.tpl
Normal file
14
charts/common/templates/_serviceaccount.tpl
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{{/*
|
||||||
|
The ServiceAccount object to be created.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.serviceAccount" }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.serviceAccountName" . }}
|
||||||
|
labels: {{- include "common.labels" $ | nindent 4 }}
|
||||||
|
{{- with (merge (.Values.serviceAccount.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||||
|
annotations: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{{- if .Values.metrics.enabled }}
|
{{- define "common.serviceMonitor" }}
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
62
charts/common/templates/_statefulset.tpl
Normal file
62
charts/common/templates/_statefulset.tpl
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{{/*
|
||||||
|
This template serves as the blueprint for the StatefulSet objects that are created
|
||||||
|
within the common library.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.statefulset" }}
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
{{- with (merge (.Values.controller.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||||
|
labels: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with (merge (.Values.controller.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||||
|
annotations: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
revisionHistoryLimit: {{ .Values.controller.revisionHistoryLimit }}
|
||||||
|
replicas: {{ .Values.controller.replicas }}
|
||||||
|
podManagementPolicy: {{ default "OrderedReady" .Values.controller.podManagementPolicy }}
|
||||||
|
{{- $strategy := default "RollingUpdate" .Values.controller.strategy }}
|
||||||
|
{{- if and (ne $strategy "OnDelete") (ne $strategy "RollingUpdate") }}
|
||||||
|
{{- fail (printf "Not a valid strategy type for StatefulSet (%s)" $strategy) }}
|
||||||
|
{{- end }}
|
||||||
|
updateStrategy:
|
||||||
|
type: {{ $strategy }}
|
||||||
|
{{- if and (eq $strategy "RollingUpdate") .Values.controller.rollingUpdate.partition }}
|
||||||
|
rollingUpdate:
|
||||||
|
partition: {{ .Values.controller.rollingUpdate.partition }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
||||||
|
serviceName: {{ include "common.names.fullname" . }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
{{- with include ("common.podAnnotations") . }}
|
||||||
|
annotations:
|
||||||
|
{{- . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
{{- include "common.labels.selectorLabels" . | nindent 8 }}
|
||||||
|
{{- with .Values.podLabels }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- include "common.controller.pod" . | nindent 6 }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
{{- range $index, $vct := .Values.volumeClaimTemplates }}
|
||||||
|
- metadata:
|
||||||
|
name: {{ $vct.name }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ required (printf "accessMode is required for vCT %v" $vct.name) $vct.accessMode | quote }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ required (printf "size is required for PVC %v" $vct.name) $vct.size | quote }}
|
||||||
|
{{- if $vct.storageClass }}
|
||||||
|
storageClassName: {{ if (eq "-" $vct.storageClass) }}""{{- else }}{{ $vct.storageClass | quote }}{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
50
charts/common/templates/addons/code-server/_codeserver.tpl
Normal file
50
charts/common/templates/addons/code-server/_codeserver.tpl
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{{/*
|
||||||
|
Template to render code-server addon
|
||||||
|
It will include / inject the required templates based on the given values.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.codeserver" -}}
|
||||||
|
{{- if .Values.addons.codeserver.enabled -}}
|
||||||
|
{{/* Append the code-server container to the additionalContainers */}}
|
||||||
|
{{- $container := include "common.addon.codeserver.container" . | fromYaml -}}
|
||||||
|
{{- if $container -}}
|
||||||
|
{{- $_ := set .Values.additionalContainers "addon-codeserver" $container -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Include the deployKeySecret if not empty */}}
|
||||||
|
{{- $secret := include "common.addon.codeserver.deployKeySecret" . -}}
|
||||||
|
{{- if $secret -}}
|
||||||
|
{{- $secret | nindent 0 -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Append the secret volume to the volumes */}}
|
||||||
|
{{- $volume := include "common.addon.codeserver.deployKeyVolumeSpec" . | fromYaml -}}
|
||||||
|
{{- if $volume -}}
|
||||||
|
{{- $_ := set .Values.persistence "deploykey" (dict "enabled" "true" "mountPath" "-" "type" "custom" "volumeSpec" $volume) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Add the code-server service */}}
|
||||||
|
{{- if .Values.addons.codeserver.service.enabled -}}
|
||||||
|
{{- $serviceValues := .Values.addons.codeserver.service -}}
|
||||||
|
{{- $_ := set $serviceValues "nameOverride" "codeserver" -}}
|
||||||
|
{{- $_ := set $ "ObjectValues" (dict "service" $serviceValues) -}}
|
||||||
|
{{- include "common.classes.service" $ -}}
|
||||||
|
{{- $_ := unset $ "ObjectValues" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Add the code-server ingress */}}
|
||||||
|
{{- if .Values.addons.codeserver.ingress.enabled -}}
|
||||||
|
{{- $ingressValues := .Values.addons.codeserver.ingress -}}
|
||||||
|
{{- $_ := set $ingressValues "nameOverride" "codeserver" -}}
|
||||||
|
|
||||||
|
{{/* Determine the target service name & port */}}
|
||||||
|
{{- $svcName := printf "%v-codeserver" (include "common.names.fullname" .) -}}
|
||||||
|
{{- $svcPort := .Values.addons.codeserver.service.ports.codeserver.port -}}
|
||||||
|
{{- range $_, $host := $ingressValues.hosts -}}
|
||||||
|
{{- $_ := set (index $host.paths 0) "service" (dict "name" $svcName "port" $svcPort) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $_ := set $ "ObjectValues" (dict "ingress" $ingressValues) -}}
|
||||||
|
{{- include "common.classes.ingress" $ -}}
|
||||||
|
{{- $_ := unset $ "ObjectValues" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
46
charts/common/templates/addons/code-server/_container.tpl
Normal file
46
charts/common/templates/addons/code-server/_container.tpl
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{{/*
|
||||||
|
The code-server sidecar container to be inserted.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.codeserver.container" -}}
|
||||||
|
{{- if lt (len .Values.addons.codeserver.volumeMounts) 1 }}
|
||||||
|
{{- fail "At least 1 volumeMount is required for codeserver container" }}
|
||||||
|
{{- end -}}
|
||||||
|
name: codeserver
|
||||||
|
image: "{{ .Values.addons.codeserver.image.repository }}:{{ .Values.addons.codeserver.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.addons.codeserver.pullPolicy }}
|
||||||
|
{{- with .Values.addons.codeserver.securityContext }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.codeserver.env }}
|
||||||
|
env:
|
||||||
|
{{- range $k, $v := . }}
|
||||||
|
- name: {{ $k }}
|
||||||
|
value: {{ $v | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: codeserver
|
||||||
|
containerPort: {{ .Values.addons.codeserver.service.ports.codeserver.port }}
|
||||||
|
protocol: TCP
|
||||||
|
args:
|
||||||
|
{{- range .Values.addons.codeserver.args }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
- "--port"
|
||||||
|
- "{{ .Values.addons.codeserver.service.ports.codeserver.port }}"
|
||||||
|
- {{ .Values.addons.codeserver.workingDir | default (first .Values.addons.codeserver.volumeMounts).mountPath }}
|
||||||
|
volumeMounts:
|
||||||
|
{{- with .Values.addons.codeserver.volumeMounts }}
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.addons.codeserver.git.deployKey .Values.addons.codeserver.git.deployKeyBase64 .Values.addons.codeserver.git.deployKeySecret }}
|
||||||
|
- name: deploykey
|
||||||
|
mountPath: /root/.ssh/id_rsa
|
||||||
|
subPath: id_rsa
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.codeserver.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
22
charts/common/templates/addons/code-server/_secret.tpl
Normal file
22
charts/common/templates/addons/code-server/_secret.tpl
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{{/*
|
||||||
|
The OpenVPN credentials secrets to be included.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.codeserver.deployKeySecret" -}}
|
||||||
|
{{- if or .Values.addons.codeserver.git.deployKey .Values.addons.codeserver.git.deployKeyBase64 }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ template "common.names.fullname" . }}-deploykey
|
||||||
|
labels: {{- include "common.labels" $ | nindent 4 }}
|
||||||
|
annotations: {{- include "common.annotations" $ | nindent 4 }}
|
||||||
|
type: Opaque
|
||||||
|
{{- if .Values.addons.codeserver.git.deployKey }}
|
||||||
|
stringData:
|
||||||
|
id_rsa: {{ .Values.addons.codeserver.git.deployKey | quote }}
|
||||||
|
{{- else }}
|
||||||
|
data:
|
||||||
|
id_rsa: {{ .Values.addons.codeserver.git.deployKeyBase64 | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
17
charts/common/templates/addons/code-server/_volume.tpl
Normal file
17
charts/common/templates/addons/code-server/_volume.tpl
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{{/*
|
||||||
|
The volume (referencing git deploykey) to be inserted into additionalVolumes.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.codeserver.deployKeyVolumeSpec" -}}
|
||||||
|
{{- if or .Values.addons.codeserver.git.deployKey .Values.addons.codeserver.git.deployKeyBase64 .Values.addons.codeserver.git.deployKeySecret }}
|
||||||
|
secret:
|
||||||
|
{{- if .Values.addons.codeserver.git.deployKeySecret }}
|
||||||
|
secretName: {{ .Values.addons.codeserver.git.deployKeySecret }}
|
||||||
|
{{- else }}
|
||||||
|
secretName: {{ include "common.names.fullname" . }}-deploykey
|
||||||
|
{{- end }}
|
||||||
|
defaultMode: 256
|
||||||
|
items:
|
||||||
|
- key: id_rsa
|
||||||
|
path: id_rsa
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
27
charts/common/templates/addons/netshoot/_container.tpl
Normal file
27
charts/common/templates/addons/netshoot/_container.tpl
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{{/*
|
||||||
|
The netshoot sidecar container to be inserted.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.netshoot.container" -}}
|
||||||
|
name: netshoot
|
||||||
|
image: "{{ .Values.addons.netshoot.image.repository }}:{{ .Values.addons.netshoot.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.addons.netshoot.pullPolicy }}
|
||||||
|
{{- with .Values.addons.netshoot.securityContext }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.netshoot.env }}
|
||||||
|
env:
|
||||||
|
{{- range $k, $v := . }}
|
||||||
|
- name: {{ $k }}
|
||||||
|
value: {{ $v | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- sleep infinity
|
||||||
|
{{- with .Values.addons.netshoot.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
13
charts/common/templates/addons/netshoot/_netshoot.tpl
Normal file
13
charts/common/templates/addons/netshoot/_netshoot.tpl
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{{/*
|
||||||
|
Template to render netshoot addon
|
||||||
|
It will include / inject the required templates based on the given values.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.netshoot" -}}
|
||||||
|
{{- if .Values.addons.netshoot.enabled -}}
|
||||||
|
{{/* Append the netshoot container to the additionalContainers */}}
|
||||||
|
{{- $container := include "common.addon.netshoot.container" . | fromYaml -}}
|
||||||
|
{{- if $container -}}
|
||||||
|
{{- $_ := set .Values.additionalContainers "addon-netshoot" $container -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
35
charts/common/templates/addons/promtail/_configmap.tpl
Normal file
35
charts/common/templates/addons/promtail/_configmap.tpl
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{{/*
|
||||||
|
The promtail config to be included.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.promtail.configmap" -}}
|
||||||
|
{{- if .Values.addons.promtail.enabled }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}-promtail
|
||||||
|
labels: {{- include "common.labels" $ | nindent 4 }}
|
||||||
|
annotations: {{- include "common.annotations" $ | nindent 4 }}
|
||||||
|
data:
|
||||||
|
promtail.yaml: |
|
||||||
|
server:
|
||||||
|
http_listen_port: 9080
|
||||||
|
grpc_listen_port: 0
|
||||||
|
positions:
|
||||||
|
filename: /tmp/positions.yaml
|
||||||
|
{{- with .Values.addons.promtail.loki }}
|
||||||
|
client:
|
||||||
|
url: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
scrape_configs:
|
||||||
|
{{- range .Values.addons.promtail.logs }}
|
||||||
|
- job_name: {{ .name }}
|
||||||
|
static_configs:
|
||||||
|
- targets:
|
||||||
|
- localhost
|
||||||
|
labels:
|
||||||
|
job: {{ .name }}
|
||||||
|
__path__: "{{ .path }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
39
charts/common/templates/addons/promtail/_container.tpl
Normal file
39
charts/common/templates/addons/promtail/_container.tpl
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{{/*
|
||||||
|
The promtail sidecar container to be inserted.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.promtail.container" -}}
|
||||||
|
{{- if lt (len .Values.addons.promtail.volumeMounts) 1 }}
|
||||||
|
{{- fail "At least 1 volumeMount is required for the promtail container" }}
|
||||||
|
{{- end -}}
|
||||||
|
name: promtail
|
||||||
|
image: "{{ .Values.addons.promtail.image.repository }}:{{ .Values.addons.promtail.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.addons.promtail.pullPolicy }}
|
||||||
|
{{- with .Values.addons.promtail.securityContext }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.promtail.env }}
|
||||||
|
env:
|
||||||
|
{{- range $k, $v := . }}
|
||||||
|
- name: {{ $k }}
|
||||||
|
value: {{ $v | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
args:
|
||||||
|
{{- range .Values.addons.promtail.args }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
- "-config.file=/etc/promtail/promtail.yaml"
|
||||||
|
volumeMounts:
|
||||||
|
- name: promtail-config
|
||||||
|
mountPath: /etc/promtail/promtail.yaml
|
||||||
|
subPath: promtail.yaml
|
||||||
|
readOnly: true
|
||||||
|
{{- with .Values.addons.promtail.volumeMounts }}
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.promtail.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
25
charts/common/templates/addons/promtail/_promtail.tpl
Normal file
25
charts/common/templates/addons/promtail/_promtail.tpl
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{{/*
|
||||||
|
Template to render promtail addon
|
||||||
|
It will include / inject the required templates based on the given values.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.promtail" -}}
|
||||||
|
{{- if .Values.addons.promtail.enabled -}}
|
||||||
|
{{/* Append the promtail container to the additionalContainers */}}
|
||||||
|
{{- $container := include "common.addon.promtail.container" . | fromYaml -}}
|
||||||
|
{{- if $container -}}
|
||||||
|
{{- $_ := set .Values.additionalContainers "addon-promtail" $container -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Include the configmap if not empty */}}
|
||||||
|
{{- $configmap := include "common.addon.promtail.configmap" . -}}
|
||||||
|
{{- if $configmap -}}
|
||||||
|
{{- $configmap | nindent 0 -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Append the promtail config volume to the volumes */}}
|
||||||
|
{{- $volume := include "common.addon.promtail.volumeSpec" . | fromYaml -}}
|
||||||
|
{{- if $volume -}}
|
||||||
|
{{- $_ := set .Values.persistence "promtail-config" (dict "enabled" "true" "mountPath" "-" "type" "custom" "volumeSpec" $volume) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
7
charts/common/templates/addons/promtail/_volume.tpl
Normal file
7
charts/common/templates/addons/promtail/_volume.tpl
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{{/*
|
||||||
|
The volume (referencing config) to be inserted into additionalVolumes.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.promtail.volumeSpec" -}}
|
||||||
|
configMap:
|
||||||
|
name: {{ include "common.names.fullname" . }}-promtail
|
||||||
|
{{- end -}}
|
||||||
23
charts/common/templates/addons/vpn/_configmap.tpl
Normal file
23
charts/common/templates/addons/vpn/_configmap.tpl
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{{/*
|
||||||
|
The VPN config and scripts to be included.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.vpn.configmap" -}}
|
||||||
|
{{- if or .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}-vpn
|
||||||
|
labels: {{- include "common.labels" $ | nindent 4 }}
|
||||||
|
annotations: {{- include "common.annotations" $ | nindent 4 }}
|
||||||
|
data:
|
||||||
|
{{- with .Values.addons.vpn.scripts.up }}
|
||||||
|
up.sh: |-
|
||||||
|
{{- . | nindent 4}}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.scripts.down }}
|
||||||
|
down.sh: |-
|
||||||
|
{{- . | nindent 4}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
29
charts/common/templates/addons/vpn/_networkpolicy.tpl
Normal file
29
charts/common/templates/addons/vpn/_networkpolicy.tpl
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{{/*
|
||||||
|
Blueprint for the NetworkPolicy object that can be included in the addon.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.vpn.networkpolicy" -}}
|
||||||
|
{{- if .Values.addons.vpn.networkPolicy.enabled }}
|
||||||
|
---
|
||||||
|
kind: NetworkPolicy
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
{{- with (merge (.Values.addons.vpn.networkPolicy.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||||
|
labels: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with (merge (.Values.addons.vpn.networkPolicy.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||||
|
annotations: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
podSelector:
|
||||||
|
{{- with (merge .Values.addons.vpn.networkPolicy.podSelectorLabels (include "common.labels.selectorLabels" . | fromYaml)) }}
|
||||||
|
matchLabels: {{- toYaml . | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
policyTypes:
|
||||||
|
- Egress
|
||||||
|
egress:
|
||||||
|
{{- with .Values.addons.vpn.networkPolicy.egress }}
|
||||||
|
{{- . | toYaml | nindent 4 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
19
charts/common/templates/addons/vpn/_secret.tpl
Normal file
19
charts/common/templates/addons/vpn/_secret.tpl
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{{/*
|
||||||
|
The OpenVPN config secret to be included.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.vpn.secret" -}}
|
||||||
|
{{- if and .Values.addons.vpn.configFile (not .Values.addons.vpn.configFileSecret) }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}-vpnconfig
|
||||||
|
labels: {{- include "common.labels" $ | nindent 4 }}
|
||||||
|
annotations: {{- include "common.annotations" $ | nindent 4 }}
|
||||||
|
stringData:
|
||||||
|
{{- with .Values.addons.vpn.configFile }}
|
||||||
|
vpnConfigfile: |-
|
||||||
|
{{- . | nindent 4}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
37
charts/common/templates/addons/vpn/_volume.tpl
Normal file
37
charts/common/templates/addons/vpn/_volume.tpl
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{{/*
|
||||||
|
The volume (referencing VPN scripts) to be inserted into additionalVolumes.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.vpn.scriptsVolumeSpec" -}}
|
||||||
|
{{- if or .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down -}}
|
||||||
|
configMap:
|
||||||
|
name: {{ include "common.names.fullname" . }}-vpn
|
||||||
|
items:
|
||||||
|
{{- if .Values.addons.vpn.scripts.up }}
|
||||||
|
- key: up.sh
|
||||||
|
path: up.sh
|
||||||
|
mode: 0777
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.addons.vpn.scripts.down }}
|
||||||
|
- key: down.sh
|
||||||
|
path: down.sh
|
||||||
|
mode: 0777
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
The volume (referencing VPN config) to be inserted into additionalVolumes.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.vpn.configVolumeSpec" -}}
|
||||||
|
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret -}}
|
||||||
|
secret:
|
||||||
|
{{- if .Values.addons.vpn.configFileSecret }}
|
||||||
|
secretName: {{ .Values.addons.vpn.configFileSecret }}
|
||||||
|
{{- else }}
|
||||||
|
secretName: {{ include "common.names.fullname" . }}-vpnconfig
|
||||||
|
{{- end }}
|
||||||
|
items:
|
||||||
|
- key: vpnConfigfile
|
||||||
|
path: vpnConfigfile
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
49
charts/common/templates/addons/vpn/_vpn.tpl
Normal file
49
charts/common/templates/addons/vpn/_vpn.tpl
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{{/*
|
||||||
|
Template to render VPN addon
|
||||||
|
It will include / inject the required templates based on the given values.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.vpn" -}}
|
||||||
|
{{- if .Values.addons.vpn.enabled -}}
|
||||||
|
{{- if eq "openvpn" .Values.addons.vpn.type -}}
|
||||||
|
{{- include "common.addon.openvpn" . }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if eq "wireguard" .Values.addons.vpn.type -}}
|
||||||
|
{{- include "common.addon.wireguard" . }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if eq "gluetun" .Values.addons.vpn.type -}}
|
||||||
|
{{- include "common.addon.gluetun" . }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Include the configmap if not empty */}}
|
||||||
|
{{- $configmap := include "common.addon.vpn.configmap" . -}}
|
||||||
|
{{- if $configmap -}}
|
||||||
|
{{- $configmap | nindent 0 -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Include the secret if not empty */}}
|
||||||
|
{{- $secret := include "common.addon.vpn.secret" . -}}
|
||||||
|
{{- if $secret -}}
|
||||||
|
{{- $secret | nindent 0 -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Append the vpn scripts volume to the volumes */}}
|
||||||
|
{{- $scriptVolume := include "common.addon.vpn.scriptsVolumeSpec" . | fromYaml -}}
|
||||||
|
{{- if $scriptVolume -}}
|
||||||
|
{{- $_ := set .Values.persistence "vpnscript" (dict "enabled" "true" "mountPath" "-" "type" "custom" "volumeSpec" $scriptVolume) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Append the vpn config volume to the volumes */}}
|
||||||
|
{{- $configVolume := include "common.addon.vpn.configVolumeSpec" . | fromYaml }}
|
||||||
|
{{ if $configVolume -}}
|
||||||
|
{{- $_ := set .Values.persistence "vpnconfig" (dict "enabled" "true" "mountPath" "-" "type" "custom" "volumeSpec" $configVolume) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Include the networkpolicy if not empty */}}
|
||||||
|
{{- $networkpolicy := include "common.addon.vpn.networkpolicy" . -}}
|
||||||
|
{{- if $networkpolicy -}}
|
||||||
|
{{- $networkpolicy | nindent 0 -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
11
charts/common/templates/addons/vpn/gluetun/_addon.tpl
Normal file
11
charts/common/templates/addons/vpn/gluetun/_addon.tpl
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{{/*
|
||||||
|
Template to render gluetun addon. It will add the container to the list of additionalContainers.
|
||||||
|
*/}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.gluetun" -}}
|
||||||
|
{{/* Append the gluetun container to the additionalContainers */}}
|
||||||
|
{{- $container := fromYaml (include "common.addon.gluetun.container" .) -}}
|
||||||
|
{{- if $container -}}
|
||||||
|
{{- $_ := set .Values.additionalContainers "addon-gluetun" $container -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
57
charts/common/templates/addons/vpn/gluetun/_container.tpl
Normal file
57
charts/common/templates/addons/vpn/gluetun/_container.tpl
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
{{/*
|
||||||
|
The gluetun sidecar container to be inserted.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.gluetun.container" -}}
|
||||||
|
name: gluetun
|
||||||
|
image: "{{ .Values.addons.vpn.gluetun.image.repository }}:{{ .Values.addons.vpn.gluetun.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.addons.vpn.gluetun.pullPolicy }}
|
||||||
|
{{- with .Values.addons.vpn.securityContext }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.env }}
|
||||||
|
env:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.envFrom }}
|
||||||
|
envFrom:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.args }}
|
||||||
|
args:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down .Values.addons.vpn.additionalVolumeMounts .Values.persistence.shared.enabled }}
|
||||||
|
volumeMounts:
|
||||||
|
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret }}
|
||||||
|
- name: vpnconfig
|
||||||
|
mountPath: /gluetun/config.conf
|
||||||
|
subPath: vpnConfigfile
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.addons.vpn.scripts.up }}
|
||||||
|
- name: vpnscript
|
||||||
|
mountPath: /gluetun/scripts/up.sh
|
||||||
|
subPath: up.sh
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.addons.vpn.scripts.down }}
|
||||||
|
- name: vpnscript
|
||||||
|
mountPath: /gluetun/scripts/down.sh
|
||||||
|
subPath: down.sh
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.persistence.shared.enabled }}
|
||||||
|
- mountPath: {{ .Values.persistence.shared.mountPath }}
|
||||||
|
name: shared
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.additionalVolumeMounts }}
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.livenessProbe }}
|
||||||
|
livenessProbe:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- with .Values.addons.vpn.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
17
charts/common/templates/addons/vpn/openvpn/_addon.tpl
Normal file
17
charts/common/templates/addons/vpn/openvpn/_addon.tpl
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{{/*
|
||||||
|
Template to render OpenVPN addon. It will add the container to the list of additionalContainers
|
||||||
|
and add a credentials secret if speciffied.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.openvpn" -}}
|
||||||
|
{{/* Append the openVPN container to the additionalContainers */}}
|
||||||
|
{{- $container := include "common.addon.openvpn.container" . | fromYaml -}}
|
||||||
|
{{- if $container -}}
|
||||||
|
{{- $_ := set .Values.additionalContainers "addon-openvpn" $container -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Include the secret if not empty */}}
|
||||||
|
{{- $secret := include "common.addon.openvpn.secret" . -}}
|
||||||
|
{{- if $secret -}}
|
||||||
|
{{- $secret | nindent 0 -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
66
charts/common/templates/addons/vpn/openvpn/_container.tpl
Normal file
66
charts/common/templates/addons/vpn/openvpn/_container.tpl
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{{/*
|
||||||
|
The OpenVPN sidecar container to be inserted.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.openvpn.container" -}}
|
||||||
|
name: openvpn
|
||||||
|
image: "{{ .Values.addons.vpn.openvpn.image.repository }}:{{ .Values.addons.vpn.openvpn.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.addons.vpn.openvpn.pullPolicy }}
|
||||||
|
{{- with .Values.addons.vpn.securityContext }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.env }}
|
||||||
|
env:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.envFrom }}
|
||||||
|
envFrom:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.args }}
|
||||||
|
args:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.addons.vpn.openvpn.auth .Values.addons.vpn.openvpn.authSecret }}
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
{{- if .Values.addons.vpn.openvpn.authSecret }}
|
||||||
|
name: {{ .Values.addons.vpn.openvpn.authSecret }}
|
||||||
|
{{- else }}
|
||||||
|
name: {{ include "common.names.fullname" . }}-openvpn
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down .Values.addons.vpn.additionalVolumeMounts .Values.persistence.shared.enabled }}
|
||||||
|
volumeMounts:
|
||||||
|
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret }}
|
||||||
|
- name: vpnconfig
|
||||||
|
mountPath: /vpn/vpn.conf
|
||||||
|
subPath: vpnConfigfile
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.addons.vpn.scripts.up }}
|
||||||
|
- name: vpnscript
|
||||||
|
mountPath: /vpn/up.sh
|
||||||
|
subPath: up.sh
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.addons.vpn.scripts.down }}
|
||||||
|
- name: vpnscript
|
||||||
|
mountPath: /vpn/down.sh
|
||||||
|
subPath: down.sh
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.persistence.shared.enabled }}
|
||||||
|
- mountPath: {{ .Values.persistence.shared.mountPath }}
|
||||||
|
name: shared
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.additionalVolumeMounts }}
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.livenessProbe }}
|
||||||
|
livenessProbe:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- with .Values.addons.vpn.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
16
charts/common/templates/addons/vpn/openvpn/_secret.tpl
Normal file
16
charts/common/templates/addons/vpn/openvpn/_secret.tpl
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{{/*
|
||||||
|
The OpenVPN credentials secrets to be included.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.openvpn.secret" -}}
|
||||||
|
{{- with .Values.addons.vpn.openvpn.auth }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" $ }}-openvpn
|
||||||
|
labels: {{- include "common.labels" $ | nindent 4 }}
|
||||||
|
annotations: {{- include "common.annotations" $ | nindent 4 }}
|
||||||
|
data:
|
||||||
|
VPN_AUTH: {{ . | b64enc }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
11
charts/common/templates/addons/vpn/wireguard/_addon.tpl
Normal file
11
charts/common/templates/addons/vpn/wireguard/_addon.tpl
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{{/*
|
||||||
|
Template to render Wireguard addon. It will add the container to the list of additionalContainers.
|
||||||
|
*/}}
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.wireguard" -}}
|
||||||
|
{{/* Append the Wireguard container to the additionalContainers */}}
|
||||||
|
{{- $container := fromYaml (include "common.addon.wireguard.container" .) -}}
|
||||||
|
{{- if $container -}}
|
||||||
|
{{- $_ := set .Values.additionalContainers "addon-wireguard" $container -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
57
charts/common/templates/addons/vpn/wireguard/_container.tpl
Normal file
57
charts/common/templates/addons/vpn/wireguard/_container.tpl
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
{{/*
|
||||||
|
The Wireguard sidecar container to be inserted.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.addon.wireguard.container" -}}
|
||||||
|
name: wireguard
|
||||||
|
image: "{{ .Values.addons.vpn.wireguard.image.repository }}:{{ .Values.addons.vpn.wireguard.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.addons.vpn.wireguard.pullPolicy }}
|
||||||
|
{{- with .Values.addons.vpn.securityContext }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.env }}
|
||||||
|
env:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.envFrom }}
|
||||||
|
envFrom:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.args }}
|
||||||
|
args:
|
||||||
|
{{- . | toYaml | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down .Values.addons.vpn.additionalVolumeMounts .Values.persistence.shared.enabled }}
|
||||||
|
volumeMounts:
|
||||||
|
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret }}
|
||||||
|
- name: vpnconfig
|
||||||
|
mountPath: /etc/wireguard/wg0.conf
|
||||||
|
subPath: vpnConfigfile
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.addons.vpn.scripts.up }}
|
||||||
|
- name: vpnscript
|
||||||
|
mountPath: /config/up.sh
|
||||||
|
subPath: up.sh
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.addons.vpn.scripts.down }}
|
||||||
|
- name: vpnscript
|
||||||
|
mountPath: /config/down.sh
|
||||||
|
subPath: down.sh
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.persistence.shared.enabled }}
|
||||||
|
- mountPath: {{ .Values.persistence.shared.mountPath }}
|
||||||
|
name: shared
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.additionalVolumeMounts }}
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.addons.vpn.livenessProbe }}
|
||||||
|
livenessProbe:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- with .Values.addons.vpn.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
37
charts/common/templates/classes/_HorizontalPodAutoscaler.tpl
Normal file
37
charts/common/templates/classes/_HorizontalPodAutoscaler.tpl
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{{/*
|
||||||
|
This template serves as a blueprint for horizontal pod autoscaler objects that are created
|
||||||
|
using the common library.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.classes.hpa" -}}
|
||||||
|
{{- if .Values.autoscaling.enabled -}}
|
||||||
|
{{- $hpaName := include "common.names.fullname" . -}}
|
||||||
|
{{- $targetName := include "common.names.fullname" . }}
|
||||||
|
---
|
||||||
|
apiVersion: autoscaling/v2beta1
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: {{ $hpaName }}
|
||||||
|
labels: {{- include "common.labels" $ | nindent 4 }}
|
||||||
|
annotations: {{- include "common.annotations" $ | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: {{ include "common.names.controllerType" . }}
|
||||||
|
name: {{ .Values.autoscaling.target | default $targetName }}
|
||||||
|
minReplicas: {{ .Values.autoscaling.minReplicas | default 1 }}
|
||||||
|
maxReplicas: {{ .Values.autoscaling.maxReplicas | default 3 }}
|
||||||
|
metrics:
|
||||||
|
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: memory
|
||||||
|
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
34
charts/common/templates/classes/_configmap.tpl
Normal file
34
charts/common/templates/classes/_configmap.tpl
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{{/*
|
||||||
|
This template serves as a blueprint for all configMap objects that are created
|
||||||
|
within the common library.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.classes.configmap" -}}
|
||||||
|
{{- $fullName := include "common.names.fullname" . -}}
|
||||||
|
{{- $configMapName := $fullName -}}
|
||||||
|
{{- $values := .Values.configmap -}}
|
||||||
|
|
||||||
|
{{- if hasKey . "ObjectValues" -}}
|
||||||
|
{{- with .ObjectValues.configmap -}}
|
||||||
|
{{- $values = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
|
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
||||||
|
{{- $configMapName = printf "%v-%v" $configMapName $values.nameOverride -}}
|
||||||
|
{{- end }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ $configMapName }}
|
||||||
|
{{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||||
|
labels: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with (merge ($values.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||||
|
annotations: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
data:
|
||||||
|
{{- with $values.data }}
|
||||||
|
{{- tpl (toYaml .) $ | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
82
charts/common/templates/classes/_ingress.tpl
Normal file
82
charts/common/templates/classes/_ingress.tpl
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
{{/*
|
||||||
|
This template serves as a blueprint for all Ingress objects that are created
|
||||||
|
within the common library.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.classes.ingress" -}}
|
||||||
|
{{- $fullName := include "common.names.fullname" . -}}
|
||||||
|
{{- $ingressName := $fullName -}}
|
||||||
|
{{- $values := .Values.ingress -}}
|
||||||
|
|
||||||
|
{{- if hasKey . "ObjectValues" -}}
|
||||||
|
{{- with .ObjectValues.ingress -}}
|
||||||
|
{{- $values = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
|
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
||||||
|
{{- $ingressName = printf "%v-%v" $ingressName $values.nameOverride -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $primaryService := get .Values.service (include "common.service.primary" .) -}}
|
||||||
|
{{- $defaultServiceName := $fullName -}}
|
||||||
|
{{- if and (hasKey $primaryService "nameOverride") $primaryService.nameOverride -}}
|
||||||
|
{{- $defaultServiceName = printf "%v-%v" $defaultServiceName $primaryService.nameOverride -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $defaultServicePort := get $primaryService.ports (include "common.classes.service.ports.primary" (dict "values" $primaryService)) -}}
|
||||||
|
{{- $isStable := include "common.capabilities.ingress.isStable" . }}
|
||||||
|
---
|
||||||
|
apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ $ingressName }}
|
||||||
|
{{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||||
|
labels: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with (merge ($values.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||||
|
annotations: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if and $isStable $values.ingressClassName }}
|
||||||
|
ingressClassName: {{ $values.ingressClassName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $values.tls }}
|
||||||
|
tls:
|
||||||
|
{{- range $values.tls }}
|
||||||
|
- hosts:
|
||||||
|
{{- range .hosts }}
|
||||||
|
- {{ tpl . $ | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .secretName }}
|
||||||
|
secretName: {{ tpl .secretName $ | quote}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
{{- range $values.hosts }}
|
||||||
|
- host: {{ tpl .host $ | quote }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
{{- range .paths }}
|
||||||
|
{{- $service := $defaultServiceName -}}
|
||||||
|
{{- $port := $defaultServicePort.port -}}
|
||||||
|
{{- if .service -}}
|
||||||
|
{{- $service = default $service .service.name -}}
|
||||||
|
{{- $port = default $port .service.port -}}
|
||||||
|
{{- end }}
|
||||||
|
- path: {{ tpl .path $ | quote }}
|
||||||
|
{{- if $isStable }}
|
||||||
|
pathType: {{ default "Prefix" .pathType }}
|
||||||
|
{{- end }}
|
||||||
|
backend:
|
||||||
|
{{- if $isStable }}
|
||||||
|
service:
|
||||||
|
name: {{ $service }}
|
||||||
|
port:
|
||||||
|
number: {{ $port }}
|
||||||
|
{{- else }}
|
||||||
|
serviceName: {{ $service }}
|
||||||
|
servicePort: {{ $port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
45
charts/common/templates/classes/_pvc.tpl
Normal file
45
charts/common/templates/classes/_pvc.tpl
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{{/*
|
||||||
|
This template serves as a blueprint for all PersistentVolumeClaim objects that are created
|
||||||
|
within the common library.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.classes.pvc" -}}
|
||||||
|
{{- $values := .Values.persistence -}}
|
||||||
|
{{- if hasKey . "ObjectValues" -}}
|
||||||
|
{{- with .ObjectValues.persistence -}}
|
||||||
|
{{- $values = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ end -}}
|
||||||
|
{{- $pvcName := include "common.names.fullname" . -}}
|
||||||
|
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
||||||
|
{{- if not (eq $values.nameOverride "-") -}}
|
||||||
|
{{- $pvcName = printf "%v-%v" $pvcName $values.nameOverride -}}
|
||||||
|
{{ end -}}
|
||||||
|
{{ end }}
|
||||||
|
---
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ $pvcName }}
|
||||||
|
{{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||||
|
labels: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
annotations:
|
||||||
|
{{- if $values.retain }}
|
||||||
|
"helm.sh/resource-policy": keep
|
||||||
|
{{- end }}
|
||||||
|
{{- with (merge ($values.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ required (printf "accessMode is required for PVC %v" $pvcName) $values.accessMode | quote }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ required (printf "size is required for PVC %v" $pvcName) $values.size | quote }}
|
||||||
|
{{- if $values.storageClass }}
|
||||||
|
storageClassName: {{ if (eq "-" $values.storageClass) }}""{{- else }}{{ $values.storageClass | quote }}{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $values.volumeName }}
|
||||||
|
volumeName: {{ $values.volumeName | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
98
charts/common/templates/classes/_service.tpl
Normal file
98
charts/common/templates/classes/_service.tpl
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{{/*
|
||||||
|
This template serves as a blueprint for all Service objects that are created
|
||||||
|
within the common library.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.classes.service" -}}
|
||||||
|
{{- $values := .Values.service -}}
|
||||||
|
{{- if hasKey . "ObjectValues" -}}
|
||||||
|
{{- with .ObjectValues.service -}}
|
||||||
|
{{- $values = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
|
{{- $serviceName := include "common.names.fullname" . -}}
|
||||||
|
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
|
||||||
|
{{- $serviceName = printf "%v-%v" $serviceName $values.nameOverride -}}
|
||||||
|
{{ end -}}
|
||||||
|
{{- $svcType := $values.type | default "" -}}
|
||||||
|
{{- $primaryPort := get $values.ports (include "common.classes.service.ports.primary" (dict "values" $values)) }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ $serviceName }}
|
||||||
|
{{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }}
|
||||||
|
labels: {{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
annotations:
|
||||||
|
{{- if eq ( $primaryPort.protocol | default "" ) "HTTPS" }}
|
||||||
|
traefik.ingress.kubernetes.io/service.serversscheme: https
|
||||||
|
{{- end }}
|
||||||
|
{{- with (merge ($values.annotations | default dict) (include "common.annotations" $ | fromYaml)) }}
|
||||||
|
{{ toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if (or (eq $svcType "ClusterIP") (empty $svcType)) }}
|
||||||
|
type: ClusterIP
|
||||||
|
{{- if $values.clusterIP }}
|
||||||
|
clusterIP: {{ $values.clusterIP }}
|
||||||
|
{{end}}
|
||||||
|
{{- else if eq $svcType "LoadBalancer" }}
|
||||||
|
type: {{ $svcType }}
|
||||||
|
{{- if $values.loadBalancerIP }}
|
||||||
|
loadBalancerIP: {{ $values.loadBalancerIP }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $values.loadBalancerSourceRanges }}
|
||||||
|
loadBalancerSourceRanges:
|
||||||
|
{{ toYaml $values.loadBalancerSourceRanges | nindent 4 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else }}
|
||||||
|
type: {{ $svcType }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $values.externalTrafficPolicy }}
|
||||||
|
externalTrafficPolicy: {{ $values.externalTrafficPolicy }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $values.sessionAffinity }}
|
||||||
|
sessionAffinity: {{ $values.sessionAffinity }}
|
||||||
|
{{- if $values.sessionAffinityConfig }}
|
||||||
|
sessionAffinityConfig:
|
||||||
|
{{ toYaml $values.sessionAffinityConfig | nindent 4 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- with $values.externalIPs }}
|
||||||
|
externalIPs:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $values.publishNotReadyAddresses }}
|
||||||
|
publishNotReadyAddresses: {{ $values.publishNotReadyAddresses }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $values.ipFamilyPolicy }}
|
||||||
|
ipFamilyPolicy: {{ $values.ipFamilyPolicy }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with $values.ipFamilies }}
|
||||||
|
ipFamilies:
|
||||||
|
{{ toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
{{- range $name, $port := $values.ports }}
|
||||||
|
{{- if $port.enabled }}
|
||||||
|
- port: {{ $port.port }}
|
||||||
|
targetPort: {{ $port.targetPort | default $name }}
|
||||||
|
{{- if $port.protocol }}
|
||||||
|
{{- if or ( eq $port.protocol "HTTP" ) ( eq $port.protocol "HTTPS" ) ( eq $port.protocol "TCP" ) }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- else }}
|
||||||
|
protocol: {{ $port.protocol }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}
|
||||||
|
name: {{ $name }}
|
||||||
|
{{- if (and (eq $svcType "NodePort") (not (empty $port.nodePort))) }}
|
||||||
|
nodePort: {{ $port.nodePort }}
|
||||||
|
{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
{{- include "common.labels.selectorLabels" . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
27
charts/common/templates/classes/_service_ports.tpl
Normal file
27
charts/common/templates/classes/_service_ports.tpl
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{{/*
|
||||||
|
Return the primary port for a given Service object.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.classes.service.ports.primary" -}}
|
||||||
|
{{- $enabledPorts := dict -}}
|
||||||
|
{{- range $name, $port := .values.ports -}}
|
||||||
|
{{- if $port.enabled -}}
|
||||||
|
{{- $_ := set $enabledPorts $name . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if eq 0 (len $enabledPorts) }}
|
||||||
|
{{- fail (printf "No ports are enabled for service \"%s\"!" .serviceName) }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- $result := "" -}}
|
||||||
|
{{- range $name, $port := $enabledPorts -}}
|
||||||
|
{{- if and (hasKey $port "primary") $port.primary -}}
|
||||||
|
{{- $result = $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not $result -}}
|
||||||
|
{{- $result = keys $enabledPorts | first -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $result -}}
|
||||||
|
{{- end -}}
|
||||||
27
charts/common/templates/lib/chart/_annotations.tpl
Normal file
27
charts/common/templates/lib/chart/_annotations.tpl
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{{/* Common annotations shared across objects */}}
|
||||||
|
{{- define "common.annotations" -}}
|
||||||
|
{{- with .Values.global.annotations }}
|
||||||
|
{{- range $k, $v := . }}
|
||||||
|
{{- $name := $k }}
|
||||||
|
{{- $value := tpl $v $ }}
|
||||||
|
{{ $name }}: {{ quote $value }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Determine the Pod annotations used in the controller */}}
|
||||||
|
{{- define "common.podAnnotations" -}}
|
||||||
|
{{- if .Values.podAnnotations -}}
|
||||||
|
{{- tpl (toYaml .Values.podAnnotations) . | nindent 0 -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- $configMapsFound := false -}}
|
||||||
|
{{- range $name, $configmap := .Values.configmap -}}
|
||||||
|
{{- if $configmap.enabled -}}
|
||||||
|
{{- $configMapsFound = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $configMapsFound -}}
|
||||||
|
{{- printf "checksum/config: %v" (include ("common.configmap") . | sha256sum) | nindent 0 -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
19
charts/common/templates/lib/chart/_capabilities.tpl
Normal file
19
charts/common/templates/lib/chart/_capabilities.tpl
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{{/* Allow KubeVersion to be overridden. */}}
|
||||||
|
{{- define "common.capabilities.ingress.kubeVersion" -}}
|
||||||
|
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Return the appropriate apiVersion for Ingress objects */}}
|
||||||
|
{{- define "common.capabilities.ingress.apiVersion" -}}
|
||||||
|
{{- print "networking.k8s.io/v1" -}}
|
||||||
|
{{- if semverCompare "<1.19" (include "common.capabilities.ingress.kubeVersion" .) -}}
|
||||||
|
{{- print "beta1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Check Ingress stability */}}
|
||||||
|
{{- define "common.capabilities.ingress.isStable" -}}
|
||||||
|
{{- if eq (include "common.capabilities.ingress.apiVersion" .) "networking.k8s.io/v1" -}}
|
||||||
|
{{- true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
22
charts/common/templates/lib/chart/_labels.tpl
Normal file
22
charts/common/templates/lib/chart/_labels.tpl
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{{/* Common labels shared across objects */}}
|
||||||
|
{{- define "common.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "common.names.chart" . }}
|
||||||
|
{{ include "common.labels.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- with .Values.global.labels }}
|
||||||
|
{{- range $k, $v := . }}
|
||||||
|
{{- $name := $k }}
|
||||||
|
{{- $value := tpl $v $ }}
|
||||||
|
{{ $name }}: {{ quote $value }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Selector labels shared across objects */}}
|
||||||
|
{{- define "common.labels.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end -}}
|
||||||
58
charts/common/templates/lib/chart/_names.tpl
Normal file
58
charts/common/templates/lib/chart/_names.tpl
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{{/* Expand the name of the chart */}}
|
||||||
|
{{- define "common.names.name" -}}
|
||||||
|
{{- $globalNameOverride := "" -}}
|
||||||
|
{{- if hasKey .Values "global" -}}
|
||||||
|
{{- $globalNameOverride = (default $globalNameOverride .Values.global.nameOverride) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- default .Chart.Name (default .Values.nameOverride $globalNameOverride) | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name.
|
||||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.names.fullname" -}}
|
||||||
|
{{- $name := include "common.names.name" . -}}
|
||||||
|
{{- $globalFullNameOverride := "" -}}
|
||||||
|
{{- if hasKey .Values "global" -}}
|
||||||
|
{{- $globalFullNameOverride = (default $globalFullNameOverride .Values.global.fullnameOverride) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if or .Values.fullnameOverride $globalFullNameOverride -}}
|
||||||
|
{{- $name = default .Values.fullnameOverride $globalFullNameOverride -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- if contains $name .Release.Name -}}
|
||||||
|
{{- $name = .Release.Name -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name = printf "%s-%s" .Release.Name $name -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- trunc 63 $name | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Create chart name and version as used by the chart label */}}
|
||||||
|
{{- define "common.names.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Create the name of the ServiceAccount to use */}}
|
||||||
|
{{- define "common.names.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create -}}
|
||||||
|
{{- default (include "common.names.fullname" .) .Values.serviceAccount.name -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- default "default" .Values.serviceAccount.name -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* Return the properly cased version of the controller type */}}
|
||||||
|
{{- define "common.names.controllerType" -}}
|
||||||
|
{{- if eq .Values.controller.type "deployment" -}}
|
||||||
|
{{- print "Deployment" -}}
|
||||||
|
{{- else if eq .Values.controller.type "daemonset" -}}
|
||||||
|
{{- print "DaemonSet" -}}
|
||||||
|
{{- else if eq .Values.controller.type "statefulset" -}}
|
||||||
|
{{- print "StatefulSet" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- fail (printf "Not a valid controller.type (%s)" .Values.controller.type) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
9
charts/common/templates/lib/chart/_values.tpl
Normal file
9
charts/common/templates/lib/chart/_values.tpl
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{{/* Merge the local chart values and the common chart defaults */}}
|
||||||
|
{{- define "common.values.setup" -}}
|
||||||
|
{{- if .Values.common -}}
|
||||||
|
{{- $defaultValues := deepCopy .Values.common -}}
|
||||||
|
{{- $userValues := deepCopy (omit .Values "common") -}}
|
||||||
|
{{- $mergedValues := mustMergeOverwrite $defaultValues $userValues -}}
|
||||||
|
{{- $_ := set . "Values" (deepCopy $mergedValues) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
62
charts/common/templates/lib/controller/_container.tpl
Normal file
62
charts/common/templates/lib/controller/_container.tpl
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{{- /* The main container included in the controller */ -}}
|
||||||
|
{{- define "common.controller.mainContainer" -}}
|
||||||
|
- name: {{ include "common.names.fullname" . }}
|
||||||
|
image: {{ printf "%s:%s" .Values.image.repository (default .Chart.AppVersion .Values.image.tag) | quote }}
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
{{- with .Values.command }}
|
||||||
|
command:
|
||||||
|
{{- if kindIs "string" . }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- else }}
|
||||||
|
{{ toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.args }}
|
||||||
|
args:
|
||||||
|
{{- if kindIs "string" . }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- else }}
|
||||||
|
{{ toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.securityContext }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.lifecycle }}
|
||||||
|
lifecycle:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.termination.messagePath }}
|
||||||
|
terminationMessagePath: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.termination.messagePolicy }}
|
||||||
|
terminationMessagePolicy: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- with .Values.env }}
|
||||||
|
env:
|
||||||
|
{{- get (fromYaml (include "common.controller.env_vars" $)) "env" | toYaml | nindent 4 -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.envFrom .Values.secret }}
|
||||||
|
envFrom:
|
||||||
|
{{- with .Values.envFrom }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.secret }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
{{- include "common.controller.ports" . | trim | nindent 4 }}
|
||||||
|
{{- with (include "common.controller.volumeMounts" . | trim) }}
|
||||||
|
volumeMounts:
|
||||||
|
{{- nindent 4 . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- include "common.controller.probes" . | trim | nindent 2 }}
|
||||||
|
{{- with .Values.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
43
charts/common/templates/lib/controller/_env_vars.tpl
Normal file
43
charts/common/templates/lib/controller/_env_vars.tpl
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{{/*
|
||||||
|
Environment variables used by containers.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.controller.env_vars" -}}
|
||||||
|
{{- $values := .Values.env -}}
|
||||||
|
{{- if hasKey . "ObjectValues" -}}
|
||||||
|
{{- with .ObjectValues.env -}}
|
||||||
|
{{- $values = . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- with $values -}}
|
||||||
|
{{- $result := list -}}
|
||||||
|
{{- range $k, $v := . -}}
|
||||||
|
{{- $name := $k -}}
|
||||||
|
{{- $value := $v -}}
|
||||||
|
{{- if kindIs "int" $name -}}
|
||||||
|
{{- $name = required "environment variables as a list of maps require a name field" $value.name -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if kindIs "map" $value -}}
|
||||||
|
{{- if hasKey $value "value" -}}
|
||||||
|
{{- $envValue := $value.value | toString -}}
|
||||||
|
{{- $result = append $result (dict "name" $name "value" (tpl $envValue $)) -}}
|
||||||
|
{{- else if hasKey $value "valueFrom" -}}
|
||||||
|
{{- $result = append $result (dict "name" $name "valueFrom" $value.valueFrom) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $result = append $result (dict "name" $name "valueFrom" $value) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if not (kindIs "map" $value) -}}
|
||||||
|
{{- if kindIs "string" $value -}}
|
||||||
|
{{- $result = append $result (dict "name" $name "value" (tpl $value $)) -}}
|
||||||
|
{{- else if or (kindIs "float64" $value) (kindIs "bool" $value) -}}
|
||||||
|
{{- $result = append $result (dict "name" $name "value" ($value | toString)) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $result = append $result (dict "name" $name "value" $value) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- toYaml (dict "env" $result) | nindent 0 -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
105
charts/common/templates/lib/controller/_pod.tpl
Normal file
105
charts/common/templates/lib/controller/_pod.tpl
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
{{- /*
|
||||||
|
The pod definition included in the controller.
|
||||||
|
*/ -}}
|
||||||
|
{{- define "common.controller.pod" -}}
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ include "common.names.serviceAccountName" . }}
|
||||||
|
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
|
||||||
|
{{- with .Values.podSecurityContext }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.priorityClassName }}
|
||||||
|
priorityClassName: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.runtimeClassName }}
|
||||||
|
runtimeClassName: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.schedulerName }}
|
||||||
|
schedulerName: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.hostNetwork }}
|
||||||
|
hostNetwork: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.hostname }}
|
||||||
|
hostname: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.dnsPolicy }}
|
||||||
|
dnsPolicy: {{ .Values.dnsPolicy }}
|
||||||
|
{{- else if .Values.hostNetwork }}
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
{{- else }}
|
||||||
|
dnsPolicy: ClusterFirst
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.dnsConfig }}
|
||||||
|
dnsConfig:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
enableServiceLinks: {{ .Values.enableServiceLinks }}
|
||||||
|
{{- with .Values.termination.gracePeriodSeconds }}
|
||||||
|
terminationGracePeriodSeconds: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.initContainers }}
|
||||||
|
initContainers:
|
||||||
|
{{- $initContainers := list }}
|
||||||
|
{{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }}
|
||||||
|
{{- $container := get $.Values.initContainers $key }}
|
||||||
|
{{- if not $container.name -}}
|
||||||
|
{{- $_ := set $container "name" $key }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $container.env -}}
|
||||||
|
{{- $_ := set $ "ObjectValues" (dict "env" $container.env) -}}
|
||||||
|
{{- $newEnv := fromYaml (include "common.controller.env_vars" $) -}}
|
||||||
|
{{- $_ := unset $.ObjectValues "env" -}}
|
||||||
|
{{- $_ := set $container "env" $newEnv.env }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $initContainers = append $initContainers $container }}
|
||||||
|
{{- end }}
|
||||||
|
{{- tpl (toYaml $initContainers) $ | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
{{- include "common.controller.mainContainer" . | nindent 2 }}
|
||||||
|
{{- with .Values.additionalContainers }}
|
||||||
|
{{- $additionalContainers := list }}
|
||||||
|
{{- range $name, $container := . }}
|
||||||
|
{{- if not $container.name -}}
|
||||||
|
{{- $_ := set $container "name" $name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $container.env -}}
|
||||||
|
{{- $_ := set $ "ObjectValues" (dict "env" $container.env) -}}
|
||||||
|
{{- $newEnv := fromYaml (include "common.controller.env_vars" $) -}}
|
||||||
|
{{- $_ := set $container "env" $newEnv.env }}
|
||||||
|
{{- $_ := unset $.ObjectValues "env" -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- $additionalContainers = append $additionalContainers $container }}
|
||||||
|
{{- end }}
|
||||||
|
{{- tpl (toYaml $additionalContainers) $ | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with (include "common.controller.volumes" . | trim) }}
|
||||||
|
volumes:
|
||||||
|
{{- nindent 2 . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.hostAliases }}
|
||||||
|
hostAliases:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.nodeSelector }}
|
||||||
|
nodeSelector:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.topologySpreadConstraints }}
|
||||||
|
topologySpreadConstraints:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
36
charts/common/templates/lib/controller/_ports.tpl
Normal file
36
charts/common/templates/lib/controller/_ports.tpl
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{{/*
|
||||||
|
Ports included by the controller.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.controller.ports" -}}
|
||||||
|
{{- $ports := list -}}
|
||||||
|
{{- range .Values.service -}}
|
||||||
|
{{- if .enabled -}}
|
||||||
|
{{- range $name, $port := .ports -}}
|
||||||
|
{{- $_ := set $port "name" $name -}}
|
||||||
|
{{- $ports = mustAppend $ports $port -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/* export/render the list of ports */}}
|
||||||
|
{{- if $ports -}}
|
||||||
|
{{- range $_ := $ports }}
|
||||||
|
{{- if .enabled }}
|
||||||
|
- name: {{ .name }}
|
||||||
|
{{- if and .targetPort (kindIs "string" .targetPort) }}
|
||||||
|
{{- fail (printf "Our charts do not support named ports for targetPort. (port name %s, targetPort %s)" .name .targetPort) }}
|
||||||
|
{{- end }}
|
||||||
|
containerPort: {{ .targetPort | default .port }}
|
||||||
|
{{- if .protocol }}
|
||||||
|
{{- if or ( eq .protocol "HTTP" ) ( eq .protocol "HTTPS" ) ( eq .protocol "TCP" ) }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- else }}
|
||||||
|
protocol: {{ .protocol }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}
|
||||||
|
{{- end}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
33
charts/common/templates/lib/controller/_probes.tpl
Normal file
33
charts/common/templates/lib/controller/_probes.tpl
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{{/*
|
||||||
|
Probes selection logic.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.controller.probes" -}}
|
||||||
|
{{- $primaryService := get .Values.service (include "common.service.primary" .) -}}
|
||||||
|
{{- $primaryPort := "" -}}
|
||||||
|
{{- if $primaryService -}}
|
||||||
|
{{- $primaryPort = get $primaryService.ports (include "common.classes.service.ports.primary" (dict "serviceName" (include "common.service.primary" .) "values" $primaryService)) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- range $probeName, $probe := .Values.probes }}
|
||||||
|
{{- if $probe.enabled -}}
|
||||||
|
{{- "" | nindent 0 }}
|
||||||
|
{{- $probeName }}Probe:
|
||||||
|
{{- if $probe.custom -}}
|
||||||
|
{{- $probe.spec | toYaml | nindent 2 }}
|
||||||
|
{{- else }}
|
||||||
|
{{- if and $primaryService $primaryPort -}}
|
||||||
|
{{- "tcpSocket:" | nindent 2 }}
|
||||||
|
{{- if $primaryPort.targetPort }}
|
||||||
|
{{- printf "port: %v" $primaryPort.targetPort | nindent 4 }}
|
||||||
|
{{- else}}
|
||||||
|
{{- printf "port: %v" $primaryPort.port | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- printf "initialDelaySeconds: %v" $probe.spec.initialDelaySeconds | nindent 2 }}
|
||||||
|
{{- printf "failureThreshold: %v" $probe.spec.failureThreshold | nindent 2 }}
|
||||||
|
{{- printf "timeoutSeconds: %v" $probe.spec.timeoutSeconds | nindent 2 }}
|
||||||
|
{{- printf "periodSeconds: %v" $probe.spec.periodSeconds | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
56
charts/common/templates/lib/controller/_volumemounts.tpl
Normal file
56
charts/common/templates/lib/controller/_volumemounts.tpl
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{{/* Volumes included by the controller */}}
|
||||||
|
{{- define "common.controller.volumeMounts" -}}
|
||||||
|
{{- range $persistenceIndex, $persistenceItem := .Values.persistence }}
|
||||||
|
{{- if $persistenceItem.enabled -}}
|
||||||
|
{{- if kindIs "slice" $persistenceItem.subPath -}}
|
||||||
|
{{- if $persistenceItem.mountPath -}}
|
||||||
|
{{- fail (printf "Cannot use persistence.mountPath with a subPath list (%s)" $persistenceIndex) }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- range $subPathIndex, $subPathItem := $persistenceItem.subPath }}
|
||||||
|
- name: {{ $persistenceIndex }}
|
||||||
|
subPath: {{ required "subPaths as a list of maps require a path field" $subPathItem.path }}
|
||||||
|
mountPath: {{ required "subPaths as a list of maps require an explicit mountPath field" $subPathItem.mountPath }}
|
||||||
|
{{- with $subPathItem.readOnly }}
|
||||||
|
readOnly: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with $subPathItem.mountPropagation }}
|
||||||
|
mountPropagation: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{/* Set the default mountPath to /<name_of_the_peristence_item> */}}
|
||||||
|
{{- $mountPath := (printf "/%v" $persistenceIndex) -}}
|
||||||
|
{{- if eq "hostPath" (default "pvc" $persistenceItem.type) -}}
|
||||||
|
{{- $mountPath = $persistenceItem.hostPath -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{/* Use the specified mountPath if provided */}}
|
||||||
|
{{- with $persistenceItem.mountPath -}}
|
||||||
|
{{- $mountPath = . -}}
|
||||||
|
{{- end }}
|
||||||
|
{{- if ne $mountPath "-" }}
|
||||||
|
- name: {{ $persistenceIndex }}
|
||||||
|
mountPath: {{ $mountPath }}
|
||||||
|
{{- with $persistenceItem.subPath }}
|
||||||
|
subPath: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with $persistenceItem.readOnly }}
|
||||||
|
readOnly: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with $persistenceItem.mountPropagation }}
|
||||||
|
mountPropagation: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if eq .Values.controller.type "statefulset" }}
|
||||||
|
{{- range $index, $vct := .Values.volumeClaimTemplates }}
|
||||||
|
- mountPath: {{ $vct.mountPath }}
|
||||||
|
name: {{ $vct.name }}
|
||||||
|
{{- if $vct.subPath }}
|
||||||
|
subPath: {{ $vct.subPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
68
charts/common/templates/lib/controller/_volumes.tpl
Normal file
68
charts/common/templates/lib/controller/_volumes.tpl
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
{{/*
|
||||||
|
Volumes included by the controller.
|
||||||
|
*/}}
|
||||||
|
{{- define "common.controller.volumes" -}}
|
||||||
|
{{- range $index, $persistence := .Values.persistence }}
|
||||||
|
{{- if $persistence.enabled }}
|
||||||
|
- name: {{ $index }}
|
||||||
|
{{- if eq (default "pvc" $persistence.type) "pvc" }}
|
||||||
|
{{- $pvcName := (include "common.names.fullname" $) -}}
|
||||||
|
{{- if $persistence.existingClaim }}
|
||||||
|
{{- /* Always prefer an existingClaim if that is set */}}
|
||||||
|
{{- $pvcName = $persistence.existingClaim -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- /* Otherwise refer to the PVC name */}}
|
||||||
|
{{- if $persistence.nameOverride -}}
|
||||||
|
{{- if not (eq $persistence.nameOverride "-") -}}
|
||||||
|
{{- $pvcName = (printf "%s-%s" (include "common.names.fullname" $) $persistence.nameOverride) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $pvcName = (printf "%s-%s" (include "common.names.fullname" $) $index) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ $pvcName }}
|
||||||
|
{{- else if or (eq $persistence.type "configMap") (eq $persistence.type "secret") }}
|
||||||
|
{{- $objectName := (required (printf "name not set for persistence item %s" $index) $persistence.name) }}
|
||||||
|
{{- $objectName = tpl $objectName $ }}
|
||||||
|
{{- if eq $persistence.type "configMap" }}
|
||||||
|
configMap:
|
||||||
|
name: {{ $objectName }}
|
||||||
|
{{- else }}
|
||||||
|
secret:
|
||||||
|
secretName: {{ $objectName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with $persistence.defaultMode }}
|
||||||
|
defaultMode: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with $persistence.items }}
|
||||||
|
items:
|
||||||
|
{{- toYaml . | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if eq $persistence.type "emptyDir" }}
|
||||||
|
{{- $emptyDir := dict -}}
|
||||||
|
{{- with $persistence.medium -}}
|
||||||
|
{{- $_ := set $emptyDir "medium" . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- with $persistence.sizeLimit -}}
|
||||||
|
{{- $_ := set $emptyDir "sizeLimit" . -}}
|
||||||
|
{{- end }}
|
||||||
|
emptyDir: {{- $emptyDir | toYaml | nindent 4 }}
|
||||||
|
{{- else if eq $persistence.type "hostPath" }}
|
||||||
|
hostPath:
|
||||||
|
path: {{ required "hostPath not set" $persistence.hostPath }}
|
||||||
|
{{- with $persistence.hostPathType }}
|
||||||
|
type: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if eq $persistence.type "nfs" }}
|
||||||
|
nfs:
|
||||||
|
server: {{ required "server not set" $persistence.server }}
|
||||||
|
path: {{ required "path not set" $persistence.path }}
|
||||||
|
{{- else if eq $persistence.type "custom" }}
|
||||||
|
{{- toYaml $persistence.volumeSpec | nindent 2 }}
|
||||||
|
{{- else }}
|
||||||
|
{{- fail (printf "Not a valid persistence.type (%s)" .Values.persistence.type) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
789
charts/common/values.yaml
Normal file
789
charts/common/values.yaml
Normal file
@@ -0,0 +1,789 @@
|
|||||||
|
global:
|
||||||
|
# -- Set an override for the prefix of the fullname
|
||||||
|
nameOverride:
|
||||||
|
# -- Set the entire name definition
|
||||||
|
fullnameOverride:
|
||||||
|
# -- Set additional global labels. Helm templates can be used.
|
||||||
|
labels: {}
|
||||||
|
# -- Set additional global annotations. Helm templates can be used.
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
controller:
|
||||||
|
# -- enable the controller.
|
||||||
|
enabled: true
|
||||||
|
# -- Set the controller type.
|
||||||
|
# Valid options are deployment, daemonset or statefulset
|
||||||
|
type: deployment
|
||||||
|
# -- Set annotations on the deployment/statefulset/daemonset
|
||||||
|
annotations: {}
|
||||||
|
# -- Set labels on the deployment/statefulset/daemonset
|
||||||
|
labels: {}
|
||||||
|
# -- Number of desired pods
|
||||||
|
replicas: 1
|
||||||
|
# -- Set the controller upgrade strategy
|
||||||
|
# For Deployments, valid values are Recreate (default) and RollingUpdate.
|
||||||
|
# For StatefulSets, valid values are OnDelete and RollingUpdate (default).
|
||||||
|
# DaemonSets ignore this.
|
||||||
|
strategy:
|
||||||
|
rollingUpdate:
|
||||||
|
# -- Set deployment RollingUpdate max unavailable
|
||||||
|
unavailable:
|
||||||
|
# -- Set deployment RollingUpdate max surge
|
||||||
|
surge:
|
||||||
|
# -- Set statefulset RollingUpdate partition
|
||||||
|
partition:
|
||||||
|
# -- ReplicaSet revision history limit
|
||||||
|
revisionHistoryLimit: 3
|
||||||
|
# -- Set statefulset podManagementPolicy, valid values are Parallel and OrderedReady (default).
|
||||||
|
podManagementPolicy:
|
||||||
|
|
||||||
|
image:
|
||||||
|
# -- image repository
|
||||||
|
repository:
|
||||||
|
# -- image tag
|
||||||
|
tag:
|
||||||
|
# -- image pull policy
|
||||||
|
pullPolicy:
|
||||||
|
|
||||||
|
# -- Set image pull secrets
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
# -- Override the command(s) for the default container
|
||||||
|
command: []
|
||||||
|
# -- Override the args for the default container
|
||||||
|
args: []
|
||||||
|
|
||||||
|
# -- Set annotations on the pod
|
||||||
|
podAnnotations: {}
|
||||||
|
|
||||||
|
# -- Set labels on the pod
|
||||||
|
podLabels: {}
|
||||||
|
|
||||||
|
# -- Add a Horizontal Pod Autoscaler
|
||||||
|
# @default -- <disabled>
|
||||||
|
autoscaling:
|
||||||
|
enabled: false
|
||||||
|
target: # deploymentname
|
||||||
|
minReplicas: # 1
|
||||||
|
maxReplicas: # 100
|
||||||
|
targetCPUUtilizationPercentage: # 80
|
||||||
|
targetMemoryUtilizationPercentage: # 80
|
||||||
|
|
||||||
|
serviceAccount:
|
||||||
|
# -- Specifies whether a service account should be created
|
||||||
|
create: false
|
||||||
|
|
||||||
|
# -- Annotations to add to the service account
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
# -- The name of the service account to use.
|
||||||
|
# If not set and create is true, a name is generated using the fullname template
|
||||||
|
name: ""
|
||||||
|
|
||||||
|
# -- Specifies whether a service account token should be automatically mounted.
|
||||||
|
automountServiceAccountToken: true
|
||||||
|
|
||||||
|
# -- Use this to populate a secret with the values you specify.
|
||||||
|
# Be aware that these values are not encrypted by default, and could therefore visible
|
||||||
|
# to anybody with access to the values.yaml file.
|
||||||
|
secret: {}
|
||||||
|
# PASSWORD: my-password
|
||||||
|
|
||||||
|
# -- Configure configMaps for the chart here.
|
||||||
|
# Additional configMaps can be added by adding a dictionary key similar to the 'config' object.
|
||||||
|
# @default -- See below
|
||||||
|
configmap:
|
||||||
|
config:
|
||||||
|
# -- Enables or disables the configMap
|
||||||
|
enabled: false
|
||||||
|
# -- Labels to add to the configMap
|
||||||
|
labels: {}
|
||||||
|
# -- Annotations to add to the configMap
|
||||||
|
annotations: {}
|
||||||
|
# -- configMap data content. Helm template enabled.
|
||||||
|
data: {}
|
||||||
|
# foo: bar
|
||||||
|
|
||||||
|
# -- Main environment variables. Template enabled.
|
||||||
|
# Syntax options:
|
||||||
|
# A) TZ: UTC
|
||||||
|
# B) PASSWD: '{{ .Release.Name }}'
|
||||||
|
# C) PASSWD:
|
||||||
|
# configMapKeyRef:
|
||||||
|
# name: config-map-name
|
||||||
|
# key: key-name
|
||||||
|
# D) PASSWD:
|
||||||
|
# valueFrom:
|
||||||
|
# secretKeyRef:
|
||||||
|
# name: secret-name
|
||||||
|
# key: key-name
|
||||||
|
# ...
|
||||||
|
# E) - name: TZ
|
||||||
|
# value: UTC
|
||||||
|
# F) - name: TZ
|
||||||
|
# value: '{{ .Release.Name }}'
|
||||||
|
env:
|
||||||
|
|
||||||
|
# -- Secrets and/or ConfigMaps that will be loaded as environment variables.
|
||||||
|
# [[ref]](https://unofficial-kubernetes.readthedocs.io/en/latest/tasks/configure-pod-container/configmap/#use-case-consume-configmap-in-environment-variables)
|
||||||
|
envFrom: []
|
||||||
|
# - configMapRef:
|
||||||
|
# name: config-map-name
|
||||||
|
# - secretRef:
|
||||||
|
# name: secret-name
|
||||||
|
|
||||||
|
# -- Custom priority class for different treatment by the scheduler
|
||||||
|
priorityClassName: # system-node-critical
|
||||||
|
|
||||||
|
# -- Allow specifying a runtimeClassName other than the default one (ie: nvidia)
|
||||||
|
runtimeClassName: # nvidia
|
||||||
|
|
||||||
|
# -- Allows specifying a custom scheduler name
|
||||||
|
schedulerName: # awkward-dangerous-scheduler
|
||||||
|
|
||||||
|
# -- Allows specifying explicit hostname setting
|
||||||
|
hostname:
|
||||||
|
|
||||||
|
# -- When using hostNetwork make sure you set dnsPolicy to `ClusterFirstWithHostNet`
|
||||||
|
hostNetwork: false
|
||||||
|
|
||||||
|
# -- Defaults to "ClusterFirst" if hostNetwork is false and "ClusterFirstWithHostNet" if hostNetwork is true.
|
||||||
|
dnsPolicy: # ClusterFirst
|
||||||
|
|
||||||
|
# -- Optional DNS settings, configuring the ndots option may resolve nslookup issues on some Kubernetes setups.
|
||||||
|
dnsConfig: {}
|
||||||
|
# options:
|
||||||
|
# - name: ndots
|
||||||
|
# value: "1"
|
||||||
|
|
||||||
|
# -- Enable/disable the generation of environment variables for services.
|
||||||
|
# [[ref]](https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#accessing-the-service)
|
||||||
|
enableServiceLinks: true
|
||||||
|
|
||||||
|
# -- Configure the Security Context for the Pod
|
||||||
|
podSecurityContext: {}
|
||||||
|
|
||||||
|
# -- Configure the Security Context for the main container
|
||||||
|
securityContext: {}
|
||||||
|
|
||||||
|
# -- Configure the lifecycle for the main container
|
||||||
|
lifecycle: {}
|
||||||
|
|
||||||
|
# -- Specify any initContainers here as dictionary items. Each initContainer should have its own key.
|
||||||
|
# The dictionary item key will determine the order. Helm templates can be used.
|
||||||
|
initContainers: {}
|
||||||
|
|
||||||
|
# -- Specify any additional containers here as dictionary items. Each additional container should have its own key.
|
||||||
|
# Helm templates can be used.
|
||||||
|
additionalContainers: {}
|
||||||
|
|
||||||
|
# -- Probe configuration
|
||||||
|
# -- [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
|
||||||
|
# @default -- See below
|
||||||
|
probes:
|
||||||
|
# -- Liveness probe configuration
|
||||||
|
# @default -- See below
|
||||||
|
liveness:
|
||||||
|
# -- Enable the liveness probe
|
||||||
|
enabled: true
|
||||||
|
# -- Set this to `true` if you wish to specify your own livenessProbe
|
||||||
|
custom: false
|
||||||
|
# -- The spec field contains the values for the default livenessProbe.
|
||||||
|
# If you selected `custom: true`, this field holds the definition of the livenessProbe.
|
||||||
|
# @default -- See below
|
||||||
|
spec:
|
||||||
|
initialDelaySeconds: 0
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
|
||||||
|
# -- Redainess probe configuration
|
||||||
|
# @default -- See below
|
||||||
|
readiness:
|
||||||
|
# -- Enable the readiness probe
|
||||||
|
enabled: true
|
||||||
|
# -- Set this to `true` if you wish to specify your own readinessProbe
|
||||||
|
custom: false
|
||||||
|
# -- The spec field contains the values for the default readinessProbe.
|
||||||
|
# If you selected `custom: true`, this field holds the definition of the readinessProbe.
|
||||||
|
# @default -- See below
|
||||||
|
spec:
|
||||||
|
initialDelaySeconds: 0
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
|
||||||
|
# -- Startup probe configuration
|
||||||
|
# @default -- See below
|
||||||
|
startup:
|
||||||
|
# -- Enable the startup probe
|
||||||
|
enabled: true
|
||||||
|
# -- Set this to `true` if you wish to specify your own startupProbe
|
||||||
|
custom: false
|
||||||
|
# -- The spec field contains the values for the default startupProbe.
|
||||||
|
# If you selected `custom: true`, this field holds the definition of the startupProbe.
|
||||||
|
# @default -- See below
|
||||||
|
spec:
|
||||||
|
initialDelaySeconds: 0
|
||||||
|
timeoutSeconds: 1
|
||||||
|
## This means it has a maximum of 5*30=150 seconds to start up before it fails
|
||||||
|
periodSeconds: 5
|
||||||
|
failureThreshold: 30
|
||||||
|
|
||||||
|
termination:
|
||||||
|
# -- Configure the path at which the file to which the main container's termination message will be written.
|
||||||
|
# -- [[ref](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#lifecycle-1)]
|
||||||
|
messagePath:
|
||||||
|
|
||||||
|
# -- Indicate how the main container's termination message should be populated.
|
||||||
|
# Valid options are `File` and `FallbackToLogsOnError`.
|
||||||
|
# -- [[ref](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#lifecycle-1)]
|
||||||
|
messagePolicy:
|
||||||
|
|
||||||
|
# -- Duration in seconds the pod needs to terminate gracefully
|
||||||
|
# -- [[ref](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#lifecycle)]
|
||||||
|
gracePeriodSeconds:
|
||||||
|
|
||||||
|
# -- Configure the services for the chart here.
|
||||||
|
# Additional services can be added by adding a dictionary key similar to the 'main' service.
|
||||||
|
# @default -- See below
|
||||||
|
service:
|
||||||
|
main:
|
||||||
|
# -- Enables or disables the service
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# -- Make this the primary service (used in probes, notes, etc...).
|
||||||
|
# If there is more than 1 service, make sure that only 1 service is marked as primary.
|
||||||
|
primary: true
|
||||||
|
|
||||||
|
# -- Override the name suffix that is used for this service
|
||||||
|
nameOverride:
|
||||||
|
|
||||||
|
# -- Set the service type
|
||||||
|
type: ClusterIP
|
||||||
|
|
||||||
|
# -- Specify the externalTrafficPolicy for the service. Options: Cluster, Local
|
||||||
|
# -- [[ref](https://kubernetes.io/docs/tutorials/services/source-ip/)]
|
||||||
|
externalTrafficPolicy:
|
||||||
|
|
||||||
|
# -- Specify the ip policy. Options: SingleStack, PreferDualStack, RequireDualStack
|
||||||
|
ipFamilyPolicy:
|
||||||
|
# -- The ip families that should be used. Options: IPv4, IPv6
|
||||||
|
ipFamilies: []
|
||||||
|
|
||||||
|
# -- Provide additional annotations which may be required.
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
# -- Provide additional labels which may be required.
|
||||||
|
labels: {}
|
||||||
|
|
||||||
|
# -- Configure the Service port information here.
|
||||||
|
# Additional ports can be added by adding a dictionary key similar to the 'http' service.
|
||||||
|
# @default -- See below
|
||||||
|
ports:
|
||||||
|
http:
|
||||||
|
# -- Enables or disables the port
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# -- Make this the primary port (used in probes, notes, etc...)
|
||||||
|
# If there is more than 1 service, make sure that only 1 port is marked as primary.
|
||||||
|
primary: true
|
||||||
|
|
||||||
|
# -- The port number
|
||||||
|
port:
|
||||||
|
|
||||||
|
# -- Port protocol.
|
||||||
|
# Support values are `HTTP`, `HTTPS`, `TCP` and `UDP`.
|
||||||
|
# HTTPS and HTTPS spawn a TCP service and get used for internal URL and name generation
|
||||||
|
protocol: HTTP
|
||||||
|
|
||||||
|
# -- Specify a service targetPort if you wish to differ the service port from the application port.
|
||||||
|
# If `targetPort` is specified, this port number is used in the container definition instead of
|
||||||
|
# the `port` value. Therefore named ports are not supported for this field.
|
||||||
|
targetPort:
|
||||||
|
|
||||||
|
# -- Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||||
|
# [[ref]](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport)
|
||||||
|
nodePort:
|
||||||
|
|
||||||
|
# -- Configure the ingresses for the chart here.
|
||||||
|
# Additional ingresses can be added by adding a dictionary key similar to the 'main' ingress.
|
||||||
|
# @default -- See below
|
||||||
|
ingress:
|
||||||
|
main:
|
||||||
|
# -- Enables or disables the ingress
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
# -- Make this the primary ingress (used in probes, notes, etc...).
|
||||||
|
# If there is more than 1 ingress, make sure that only 1 ingress is marked as primary.
|
||||||
|
primary: true
|
||||||
|
|
||||||
|
# -- Override the name suffix that is used for this ingress.
|
||||||
|
nameOverride:
|
||||||
|
|
||||||
|
# -- Provide additional annotations which may be required.
|
||||||
|
annotations: {}
|
||||||
|
# kubernetes.io/ingress.class: nginx
|
||||||
|
# kubernetes.io/tls-acme: "true"
|
||||||
|
|
||||||
|
# -- Provide additional labels which may be required.
|
||||||
|
labels: {}
|
||||||
|
|
||||||
|
# -- Set the ingressClass that is used for this ingress.
|
||||||
|
# Requires Kubernetes >=1.19
|
||||||
|
ingressClassName: # "nginx"
|
||||||
|
|
||||||
|
## Configure the hosts for the ingress
|
||||||
|
hosts:
|
||||||
|
- # -- Host address. Helm template can be passed.
|
||||||
|
host: chart-example.local
|
||||||
|
## Configure the paths for the host
|
||||||
|
paths:
|
||||||
|
- # -- Path. Helm template can be passed.
|
||||||
|
path: /
|
||||||
|
# -- Ignored if not kubeVersion >= 1.14-0
|
||||||
|
pathType: Prefix
|
||||||
|
service:
|
||||||
|
# -- Overrides the service name reference for this path
|
||||||
|
name:
|
||||||
|
# -- Overrides the service port reference for this path
|
||||||
|
port:
|
||||||
|
|
||||||
|
# -- Configure TLS for the ingress. Both secretName and hosts can process a Helm template.
|
||||||
|
tls: []
|
||||||
|
# - secretName: chart-example-tls
|
||||||
|
# hosts:
|
||||||
|
# - chart-example.local
|
||||||
|
|
||||||
|
# -- Configure persistence for the chart here.
|
||||||
|
# Additional items can be added by adding a dictionary key similar to the 'config' key.
|
||||||
|
# [[ref]](http://docs.k8s-at-home.com/our-helm-charts/common-library-storage)
|
||||||
|
# @default -- See below
|
||||||
|
persistence:
|
||||||
|
# -- Default persistence for configuration files.
|
||||||
|
# @default -- See below
|
||||||
|
config:
|
||||||
|
# -- Enables or disables the persistence item
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
# -- Sets the persistence type
|
||||||
|
# Valid options are pvc, emptyDir, hostPath, secret, configMap or custom
|
||||||
|
type: pvc
|
||||||
|
|
||||||
|
# -- Where to mount the volume in the main container.
|
||||||
|
# Defaults to `/<name_of_the_volume>`,
|
||||||
|
# setting to '-' creates the volume but disables the volumeMount.
|
||||||
|
mountPath: # /config
|
||||||
|
# -- Specify if the volume should be mounted read-only.
|
||||||
|
readOnly: false
|
||||||
|
# -- Override the name suffix that is used for this volume.
|
||||||
|
nameOverride:
|
||||||
|
|
||||||
|
# -- Storage Class for the config volume.
|
||||||
|
# If set to `-`, dynamic provisioning is disabled.
|
||||||
|
# If set to something else, the given storageClass is used.
|
||||||
|
# If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner.
|
||||||
|
storageClass: # "-"
|
||||||
|
|
||||||
|
# -- If you want to reuse an existing claim, the name of the existing PVC can be passed here.
|
||||||
|
existingClaim: # your-claim
|
||||||
|
|
||||||
|
# -- Used in conjunction with `existingClaim`. Specifies a sub-path inside the referenced volume instead of its root
|
||||||
|
subPath: # some-subpath
|
||||||
|
|
||||||
|
# -- AccessMode for the persistent volume.
|
||||||
|
# Make sure to select an access mode that is supported by your storage provider!
|
||||||
|
# [[ref]](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes)
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
|
||||||
|
# -- The amount of storage that is requested for the persistent volume.
|
||||||
|
size: 1Gi
|
||||||
|
|
||||||
|
# -- Set to true to retain the PVC upon `helm uninstall`
|
||||||
|
retain: false
|
||||||
|
|
||||||
|
# -- Create an emptyDir volume to share between all containers
|
||||||
|
# [[ref]]https://kubernetes.io/docs/concepts/storage/volumes/#emptydir)
|
||||||
|
# @default -- See below
|
||||||
|
shared:
|
||||||
|
enabled: false
|
||||||
|
type: emptyDir
|
||||||
|
mountPath: /shared
|
||||||
|
|
||||||
|
# -- Set the medium to "Memory" to mount a tmpfs (RAM-backed filesystem) instead
|
||||||
|
# of the storage medium that backs the node.
|
||||||
|
medium: # Memory
|
||||||
|
|
||||||
|
# -- If the `SizeMemoryBackedVolumes` feature gate is enabled, you can
|
||||||
|
# specify a size for memory backed volumes.
|
||||||
|
sizeLimit: # 1Gi
|
||||||
|
|
||||||
|
# -- Used in conjunction with `controller.type: statefulset` to create individual disks for each instance.
|
||||||
|
volumeClaimTemplates: []
|
||||||
|
# - name: data
|
||||||
|
# mountPath: /data
|
||||||
|
# accessMode: "ReadWriteOnce"
|
||||||
|
# size: 1Gi
|
||||||
|
# - name: backup
|
||||||
|
# mountPath: /backup
|
||||||
|
# subPath: theSubPath
|
||||||
|
# accessMode: "ReadWriteOnce"
|
||||||
|
# size: 2Gi
|
||||||
|
# storageClass: cheap-storage-class
|
||||||
|
|
||||||
|
# -- Node selection constraint
|
||||||
|
# [[ref]](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
|
||||||
|
nodeSelector: {}
|
||||||
|
|
||||||
|
# -- Defines affinity constraint rules.
|
||||||
|
# [[ref]](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)
|
||||||
|
affinity: {}
|
||||||
|
|
||||||
|
# -- Defines topologySpreadConstraint rules.
|
||||||
|
# [[ref]](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/)
|
||||||
|
topologySpreadConstraints: []
|
||||||
|
# - maxSkew: <integer>
|
||||||
|
# topologyKey: <string>
|
||||||
|
# whenUnsatisfiable: <string>
|
||||||
|
# labelSelector: <object>
|
||||||
|
|
||||||
|
# -- Specify taint tolerations
|
||||||
|
# [[ref]](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)
|
||||||
|
tolerations: []
|
||||||
|
|
||||||
|
# -- Use hostAliases to add custom entries to /etc/hosts - mapping IP addresses to hostnames.
|
||||||
|
# [[ref]](https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/)
|
||||||
|
hostAliases: []
|
||||||
|
# - ip: "192.168.1.100"
|
||||||
|
# hostnames:
|
||||||
|
# - "example.com"
|
||||||
|
# - "www.example.com"
|
||||||
|
|
||||||
|
# -- Set the resource requests / limits for the main container.
|
||||||
|
resources: {}
|
||||||
|
## We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
|
## choice for the user. This also increases chances charts run on environments with little
|
||||||
|
## resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
|
## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||||
|
# limits:
|
||||||
|
# cpu: 100m
|
||||||
|
# memory: 128Mi
|
||||||
|
# requests:
|
||||||
|
# cpu: 100m
|
||||||
|
# memory: 128Mi
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
# -- Enable metrics collections with serviceMonitor
|
||||||
|
# @default -- See values.yaml
|
||||||
|
enabled: false
|
||||||
|
serviceMonitor:
|
||||||
|
interval: 3m
|
||||||
|
scrapeTimeout: 1m
|
||||||
|
labels: {}
|
||||||
|
# -- Enable and configure Prometheus Rules for the chart under this key.
|
||||||
|
# @default -- See values.yaml
|
||||||
|
prometheusRule:
|
||||||
|
enabled: false
|
||||||
|
labels: {}
|
||||||
|
# -- Configure additionial rules for the chart under this key.
|
||||||
|
# @default -- See prometheusrules.yaml
|
||||||
|
rules: []
|
||||||
|
# - alert: SonarrDown
|
||||||
|
# annotations:
|
||||||
|
# description: Sonarr service is down.
|
||||||
|
# summary: Sonarr is down.
|
||||||
|
# expr: |
|
||||||
|
# sonarr_system_status == 0
|
||||||
|
# for: 5m
|
||||||
|
# labels:
|
||||||
|
# severity: critical
|
||||||
|
|
||||||
|
# -- The common chart supports several add-ons. These can be configured under this key.
|
||||||
|
# @default -- See below
|
||||||
|
addons:
|
||||||
|
|
||||||
|
# -- The common chart supports adding a VPN add-on. It can be configured under this key.
|
||||||
|
# For more info, check out [our docs](http://docs.k8s-at-home.com/our-helm-charts/common-library-add-ons/#wireguard-vpn)
|
||||||
|
# @default -- See values.yaml
|
||||||
|
vpn:
|
||||||
|
# -- Enable running a VPN in the pod to route traffic through a VPN
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
# -- Specify the VPN type. Valid options are `openvpn`, `wireguard` and `gluetun`.
|
||||||
|
type: openvpn
|
||||||
|
|
||||||
|
# -- OpenVPN specific configuration
|
||||||
|
# @default -- See below
|
||||||
|
openvpn:
|
||||||
|
image:
|
||||||
|
# -- Specify the openvpn client image
|
||||||
|
repository: dperson/openvpn-client
|
||||||
|
# -- Specify the openvpn client image tag
|
||||||
|
tag: latest
|
||||||
|
# -- Specify the openvpn client image pull policy
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
# -- Credentials to connect to the VPN Service (used with -a)
|
||||||
|
auth: # "user;password"
|
||||||
|
# -- Optionally specify an existing secret that contains the credentials.
|
||||||
|
# Credentials should be stored under the `VPN_AUTH` key
|
||||||
|
authSecret: # my-vpn-secret
|
||||||
|
|
||||||
|
# -- WireGuard specific configuration
|
||||||
|
# @default -- See below
|
||||||
|
wireguard:
|
||||||
|
image:
|
||||||
|
# -- Specify the WireGuard image
|
||||||
|
repository: ghcr.io/k8s-at-home/wireguard
|
||||||
|
# -- Specify the WireGuard image tag
|
||||||
|
tag: v1.0.20210914
|
||||||
|
# -- Specify the WireGuard image pull policy
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
# -- Gluetun specific configuration
|
||||||
|
# -- Make sure to read the [documentation](https://github.com/qdm12/gluetun/wiki) to see how to configure this addon!
|
||||||
|
# @default -- See below
|
||||||
|
gluetun:
|
||||||
|
image:
|
||||||
|
# -- Specify the Gluetun image
|
||||||
|
repository: docker.io/qmcgaw/gluetun
|
||||||
|
# -- Specify the Gluetun image tag
|
||||||
|
tag: v3.30.0
|
||||||
|
# -- Specify the Gluetun image pull policy
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
# -- Set the VPN container securityContext
|
||||||
|
# @default -- See values.yaml
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- SYS_MODULE
|
||||||
|
|
||||||
|
# -- All variables specified here will be added to the vpn sidecar container
|
||||||
|
# See the documentation of the VPN image for all config values
|
||||||
|
env: {}
|
||||||
|
# TZ: UTC
|
||||||
|
|
||||||
|
# -- Override the args for the vpn sidecar container
|
||||||
|
args: []
|
||||||
|
|
||||||
|
# -- Provide a customized vpn configuration file to be used by the VPN.
|
||||||
|
configFile: # |-
|
||||||
|
# Some Example Config
|
||||||
|
# remote greatvpnhost.com 8888
|
||||||
|
# auth-user-pass
|
||||||
|
# Cipher AES
|
||||||
|
|
||||||
|
# -- Reference an existing secret that contains the VPN configuration file
|
||||||
|
# The chart expects it to be present under the `vpnConfigfile` key.
|
||||||
|
configFileSecret:
|
||||||
|
|
||||||
|
# -- Provide custom up/down scripts that can be used by the vpn configuration.
|
||||||
|
# @default -- See values.yaml
|
||||||
|
scripts:
|
||||||
|
# @default -- See below
|
||||||
|
up: # |-
|
||||||
|
# #!/bin/bash
|
||||||
|
# echo "connected" > /shared/vpnstatus
|
||||||
|
|
||||||
|
# @default -- See below
|
||||||
|
down: # |-
|
||||||
|
# #!/bin/bash
|
||||||
|
# echo "disconnected" > /shared/vpnstatus
|
||||||
|
|
||||||
|
additionalVolumeMounts: []
|
||||||
|
|
||||||
|
# -- Optionally specify a livenessProbe, e.g. to check if the connection is still
|
||||||
|
# being protected by the VPN
|
||||||
|
livenessProbe: {}
|
||||||
|
# exec:
|
||||||
|
# command:
|
||||||
|
# - sh
|
||||||
|
# - -c
|
||||||
|
# - if [ $(curl -s https://ipinfo.io/country) == 'US' ]; then exit 0; else exit $?; fi
|
||||||
|
# initialDelaySeconds: 30
|
||||||
|
# periodSeconds: 60
|
||||||
|
# failureThreshold: 1
|
||||||
|
|
||||||
|
networkPolicy:
|
||||||
|
# -- If set to true, will deploy a network policy that blocks all outbound
|
||||||
|
# traffic except traffic specified as allowed
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
# -- Provide additional annotations which may be required.
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
# -- Provide additional labels which may be required.
|
||||||
|
labels: {}
|
||||||
|
|
||||||
|
# -- Provide additional podSelector labels which may be required.
|
||||||
|
podSelectorLabels: {}
|
||||||
|
|
||||||
|
# -- The egress configuration for your network policy, All outbound traffic
|
||||||
|
# from the pod will be blocked unless specified here.
|
||||||
|
# [[ref]](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
||||||
|
# [[recipes]](https://github.com/ahmetb/kubernetes-network-policy-recipes)
|
||||||
|
egress:
|
||||||
|
# - to:
|
||||||
|
# - ipBlock:
|
||||||
|
# cidr: 0.0.0.0/0
|
||||||
|
# ports:
|
||||||
|
# - port: 53
|
||||||
|
# protocol: UDP
|
||||||
|
# - port: 53
|
||||||
|
# protocol: TCP
|
||||||
|
|
||||||
|
# -- The common library supports adding a code-server add-on to access files. It can be configured under this key.
|
||||||
|
# For more info, check out [our docs](http://docs.k8s-at-home.com/our-helm-charts/common-library-add-ons/#code-server)
|
||||||
|
# @default -- See values.yaml
|
||||||
|
codeserver:
|
||||||
|
# -- Enable running a code-server container in the pod
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
image:
|
||||||
|
# -- Specify the code-server image
|
||||||
|
repository: ghcr.io/coder/code-server
|
||||||
|
# -- Specify the code-server image tag
|
||||||
|
tag: 4.5.1
|
||||||
|
# -- Specify the code-server image pull policy
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
# -- Set any environment variables for code-server here
|
||||||
|
env: {}
|
||||||
|
# TZ: UTC
|
||||||
|
|
||||||
|
# -- Set codeserver command line arguments.
|
||||||
|
# Consider setting --user-data-dir to a persistent location to preserve code-server setting changes
|
||||||
|
args:
|
||||||
|
- --auth
|
||||||
|
- none
|
||||||
|
# - --user-data-dir
|
||||||
|
# - "/config/.vscode"
|
||||||
|
|
||||||
|
# -- Specify a list of volumes that get mounted in the code-server container.
|
||||||
|
# At least 1 volumeMount is required!
|
||||||
|
volumeMounts: []
|
||||||
|
# - name: config
|
||||||
|
# mountPath: /data/config
|
||||||
|
|
||||||
|
# -- Specify the working dir that will be opened when code-server starts
|
||||||
|
# If not given, the app will default to the mountpah of the first specified volumeMount
|
||||||
|
workingDir: ""
|
||||||
|
|
||||||
|
# -- Optionally allow access a Git repository by passing in a private SSH key
|
||||||
|
# @default -- See below
|
||||||
|
git:
|
||||||
|
# -- Raw SSH private key
|
||||||
|
deployKey: ""
|
||||||
|
# -- Base64-encoded SSH private key. When both variables are set, the raw SSH key takes precedence.
|
||||||
|
deployKeyBase64: ""
|
||||||
|
# -- Existing secret containing SSH private key
|
||||||
|
# The chart expects it to be present under the `id_rsa` key.
|
||||||
|
deployKeySecret: ""
|
||||||
|
|
||||||
|
service:
|
||||||
|
# -- Enable a service for the code-server add-on.
|
||||||
|
enabled: true
|
||||||
|
type: ClusterIP
|
||||||
|
# Specify the default port information
|
||||||
|
ports:
|
||||||
|
codeserver:
|
||||||
|
port: 12321
|
||||||
|
enabled: true
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: codeserver
|
||||||
|
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||||
|
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||||
|
##
|
||||||
|
# nodePort:
|
||||||
|
annotations: {}
|
||||||
|
labels: {}
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
# -- Enable an ingress for the code-server add-on.
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
annotations: {}
|
||||||
|
# kubernetes.io/ingress.class: nginx
|
||||||
|
# kubernetes.io/tls-acme: "true"
|
||||||
|
|
||||||
|
labels: {}
|
||||||
|
|
||||||
|
# -- Set the ingressClass that is used for this ingress.
|
||||||
|
# Requires Kubernetes >=1.19
|
||||||
|
ingressClassName: # "nginx"
|
||||||
|
|
||||||
|
hosts:
|
||||||
|
- host: code.chart-example.local
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
# Ignored if not kubeVersion >= 1.14-0
|
||||||
|
pathType: Prefix
|
||||||
|
tls: []
|
||||||
|
# - secretName: chart-example-tls
|
||||||
|
# hosts:
|
||||||
|
# - code.chart-example.local
|
||||||
|
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
|
|
||||||
|
# -- The common library supports adding a promtail add-on to to access logs and ship them to loki. It can be configured under this key.
|
||||||
|
# @default -- See values.yaml
|
||||||
|
promtail:
|
||||||
|
# -- Enable running a promtail container in the pod
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
image:
|
||||||
|
# -- Specify the promtail image
|
||||||
|
repository: docker.io/grafana/promtail
|
||||||
|
# -- Specify the promtail image tag
|
||||||
|
tag: 2.6.1
|
||||||
|
# -- Specify the promtail image pull policy
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
# -- Set any environment variables for promtail here
|
||||||
|
env: {}
|
||||||
|
|
||||||
|
# -- Set promtail command line arguments
|
||||||
|
args: []
|
||||||
|
|
||||||
|
# -- The URL to Loki
|
||||||
|
loki: ""
|
||||||
|
|
||||||
|
# -- The paths to logs on the volume
|
||||||
|
logs: []
|
||||||
|
# - name: log
|
||||||
|
# path: /config/logs/*.log
|
||||||
|
|
||||||
|
# -- Specify a list of volumes that get mounted in the promtail container.
|
||||||
|
# At least 1 volumeMount is required!
|
||||||
|
volumeMounts: []
|
||||||
|
# - name: config
|
||||||
|
# mountPath: /config
|
||||||
|
# readOnly: true
|
||||||
|
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
|
|
||||||
|
# -- The common library supports adding a netshoot add-on to troubleshoot network issues within a Pod. It can be configured under this key.
|
||||||
|
# @default -- See values.yaml
|
||||||
|
netshoot:
|
||||||
|
# -- Enable running a netshoot container in the pod
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
image:
|
||||||
|
# -- Specify the netshoot image
|
||||||
|
repository: ghcr.io/nicolaka/netshoot
|
||||||
|
# -- Specify the netshoot image tag
|
||||||
|
tag: v0.7
|
||||||
|
# -- Specify the netshoot image pull policy
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
# -- Set any environment variables for netshoot here
|
||||||
|
env: {}
|
||||||
|
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
@@ -2,17 +2,17 @@ apiVersion: v2
|
|||||||
appVersion: 0.1.2
|
appVersion: 0.1.2
|
||||||
description: A prometheus exporter for the HG612 modem
|
description: A prometheus exporter for the HG612 modem
|
||||||
name: hg612-exporter
|
name: hg612-exporter
|
||||||
version: 1.2.0
|
version: 1.2.3
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- hg612-exporter
|
- hg612-exporter
|
||||||
home: https://github.com/nikdoof/helm-charts/tree/master/charts/hg612-exporter
|
home: https://github.com/nikdoof/helm-charts/tree/master/charts/hg612-exporter
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/nikdoof/hg612-exporter
|
- https://github.com/nikdoof/hg612-exporter
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: nikdoof
|
- name: nikdoof
|
||||||
email: andy@tensixtyone.com
|
email: andy@tensixtyone.com
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: https://library-charts.k8s-at-home.com
|
repository: https://nikdoof.github.io/helm-charts/
|
||||||
version: 4.3.0
|
version: 4.5.3
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{{- if and .Values.metrics.enabled .Values.metrics.dashboards.create }}
|
{{- if and .Values.metrics.enabled .Values.metrics.dashboards.create }}
|
||||||
|
{{- include "common.values.setup" . -}}
|
||||||
{{- $namespace := .Values.metrics.dashboards.namespace | default $.Release.Namespace }}
|
{{- $namespace := .Values.metrics.dashboards.namespace | default $.Release.Namespace }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
|
||||||
apiVersion: monitoring.coreos.com/v1
|
|
||||||
kind: PrometheusRule
|
|
||||||
metadata:
|
|
||||||
name: {{ include "common.names.fullname" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.metrics.prometheusRule.labels }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
groups:
|
|
||||||
- name: {{ include "common.names.fullname" . }}
|
|
||||||
rules:
|
|
||||||
- alert: HG612ExporterAbsent
|
|
||||||
annotations:
|
|
||||||
description: HG612 Exporter has disappeared from Prometheus service discovery.
|
|
||||||
summary: HG612 Exporter is down.
|
|
||||||
expr: |
|
|
||||||
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
|
|
||||||
for: 5m
|
|
||||||
labels:
|
|
||||||
severity: critical
|
|
||||||
{{- with .Values.metrics.prometheusRule.rules }}
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{{- if .Values.metrics.enabled }}
|
|
||||||
apiVersion: monitoring.coreos.com/v1
|
|
||||||
kind: ServiceMonitor
|
|
||||||
metadata:
|
|
||||||
name: {{ include "common.names.fullname" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.metrics.serviceMonitor.labels }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
|
||||||
endpoints:
|
|
||||||
- port: metrics
|
|
||||||
{{- with .Values.metrics.serviceMonitor.interval }}
|
|
||||||
interval: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
|
|
||||||
scrapeTimeout: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
path: /metrics
|
|
||||||
{{- end }}
|
|
||||||
@@ -60,16 +60,16 @@ metrics:
|
|||||||
labels: {}
|
labels: {}
|
||||||
# -- Configure additionial rules for the chart under this key.
|
# -- Configure additionial rules for the chart under this key.
|
||||||
# @default -- See prometheusrules.yaml
|
# @default -- See prometheusrules.yaml
|
||||||
rules: []
|
rules:
|
||||||
# - alert: HG612ExporterAbsent
|
- alert: HG612ExporterAbsent
|
||||||
# annotations:
|
annotations:
|
||||||
# description: HG612 Exporter has disappeared from Prometheus service discovery.
|
description: HG612 Exporter has disappeared from Prometheus service discovery.
|
||||||
# summary: HG612 Exporter is down.
|
summary: HG612 Exporter is down.
|
||||||
# expr: |
|
expr: |
|
||||||
# absent(up{job=~".*hg612exporter.*"} == 1)
|
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
|
||||||
# for: 5m
|
for: 5m
|
||||||
# labels:
|
labels:
|
||||||
# severity: critical
|
severity: critical
|
||||||
# -- Enable and configure Grafana dashboard ConfigMaps for the chart under this key.
|
# -- Enable and configure Grafana dashboard ConfigMaps for the chart under this key.
|
||||||
# @default -- See values.yaml
|
# @default -- See values.yaml
|
||||||
dashboards:
|
dashboards:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: v2
|
|||||||
appVersion: "0.5.0"
|
appVersion: "0.5.0"
|
||||||
description: iDRAC 6 web interface and VNC proxy
|
description: iDRAC 6 web interface and VNC proxy
|
||||||
name: idrac6
|
name: idrac6
|
||||||
version: 1.1.0
|
version: 1.1.2
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- idrac6
|
- idrac6
|
||||||
@@ -14,5 +14,5 @@ maintainers:
|
|||||||
email: andy@tensixtyone.com
|
email: andy@tensixtyone.com
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: https://library-charts.k8s-at-home.com
|
repository: https://nikdoof.github.io/helm-charts/
|
||||||
version: 4.3.0
|
version: 4.5.3
|
||||||
|
|||||||
@@ -2,17 +2,17 @@ apiVersion: v2
|
|||||||
appVersion: 1.0.0
|
appVersion: 1.0.0
|
||||||
description: A prometheus exporter for generic MQTT metrics
|
description: A prometheus exporter for generic MQTT metrics
|
||||||
name: mqtt-exporter
|
name: mqtt-exporter
|
||||||
version: 1.1.0
|
version: 1.1.2
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- mqtt-exporter
|
- mqtt-exporter
|
||||||
home: https://github.com/nikdoof/helm-charts/tree/master/charts/mqtt-exporter
|
home: https://github.com/nikdoof/helm-charts/tree/master/charts/mqtt-exporter
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/kpetremann/mqtt-exporter
|
- https://github.com/kpetremann/mqtt-exporter
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: nikdoof
|
- name: nikdoof
|
||||||
email: andy@tensixtyone.com
|
email: andy@tensixtyone.com
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: https://library-charts.k8s-at-home.com
|
repository: https://nikdoof.github.io/helm-charts/
|
||||||
version: 4.3.0
|
version: 4.5.2
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
||||||
|
{{- include "common.values.setup" . -}}
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: PrometheusRule
|
kind: PrometheusRule
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{{- if .Values.metrics.enabled }}
|
{{- if .Values.metrics.enabled }}
|
||||||
|
{{- include "common.values.setup" . -}}
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
appVersion: 0.2.2
|
appVersion: 0.2.3
|
||||||
description: A prometheus exporter for Plex Media Server
|
description: A prometheus exporter for Plex Media Server
|
||||||
name: plex-exporter
|
name: plex-exporter
|
||||||
version: 0.1.0
|
version: 0.1.3
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- plex-exporter
|
- plex-exporter
|
||||||
@@ -15,5 +15,5 @@ maintainers:
|
|||||||
email: andy@tensixtyone.com
|
email: andy@tensixtyone.com
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: https://library-charts.k8s-at-home.com
|
repository: https://nikdoof.github.io/helm-charts/
|
||||||
version: 4.3.0
|
version: 4.5.3
|
||||||
|
|||||||
5
charts/plex-exporter/ci/loglevel.yml
Normal file
5
charts/plex-exporter/ci/loglevel.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
plex:
|
||||||
|
autodiscover: true
|
||||||
|
token: a0a0a0a0a0
|
||||||
|
loglevel: debug
|
||||||
@@ -14,6 +14,10 @@ args:
|
|||||||
- "--token"
|
- "--token"
|
||||||
- "{{ .Values.plex.token }}"
|
- "{{ .Values.plex.token }}"
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ if .Values.plex.loglevel }}
|
||||||
|
- "--log-level"
|
||||||
|
- "{{ .Values.plex.loglevel }}"
|
||||||
|
{{ end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $_ := mergeOverwrite .Values (include "plex-exporter.harcodedValues" . | fromYaml) -}}
|
{{- $_ := mergeOverwrite .Values (include "plex-exporter.harcodedValues" . | fromYaml) -}}
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
{{- if .Values.metrics.enabled }}
|
|
||||||
apiVersion: monitoring.coreos.com/v1
|
|
||||||
kind: ServiceMonitor
|
|
||||||
metadata:
|
|
||||||
name: {{ include "common.names.fullname" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.metrics.serviceMonitor.labels }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
{{- include "common.labels.selectorLabels" . | nindent 6 }}
|
|
||||||
endpoints:
|
|
||||||
- port: metrics
|
|
||||||
{{- with .Values.metrics.serviceMonitor.interval }}
|
|
||||||
interval: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
|
|
||||||
scrapeTimeout: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
path: /metrics
|
|
||||||
{{- end }}
|
|
||||||
@@ -9,7 +9,7 @@ image:
|
|||||||
# -- image repository
|
# -- image repository
|
||||||
repository: granra/plex_exporter
|
repository: granra/plex_exporter
|
||||||
# -- image tag
|
# -- image tag
|
||||||
tag: v0.2.2
|
tag: v0.2.3
|
||||||
# -- image pull policy
|
# -- image pull policy
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
@@ -42,6 +42,8 @@ plex:
|
|||||||
token:
|
token:
|
||||||
# -- Enable autodiscover using plex.tv
|
# -- Enable autodiscover using plex.tv
|
||||||
autodiscover: true
|
autodiscover: true
|
||||||
|
# -- Logging level
|
||||||
|
# loglevel: info
|
||||||
|
|
||||||
metrics:
|
metrics:
|
||||||
# -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
|
# -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
|
||||||
@@ -58,13 +60,13 @@ metrics:
|
|||||||
labels: {}
|
labels: {}
|
||||||
# -- Configure additionial rules for the chart under this key.
|
# -- Configure additionial rules for the chart under this key.
|
||||||
# @default -- See prometheusrules.yaml
|
# @default -- See prometheusrules.yaml
|
||||||
rules: []
|
rules:
|
||||||
# - alert: plexExporterAbsent
|
- alert: PlexExporterAbsent
|
||||||
# annotations:
|
annotations:
|
||||||
# description: plex Exporter has disappeared from Prometheus service discovery.
|
description: Plex Exporter has disappeared from Prometheus service discovery.
|
||||||
# summary: plex Exporter is down.
|
summary: Plex Exporter is down.
|
||||||
# expr: |
|
expr: |
|
||||||
# absent(up{job=~".*plexexporter.*"} == 1)
|
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
|
||||||
# for: 5m
|
for: 5m
|
||||||
# labels:
|
labels:
|
||||||
# severity: critical
|
severity: critical
|
||||||
|
|||||||
@@ -2,18 +2,18 @@ apiVersion: v2
|
|||||||
appVersion: 0.18.2
|
appVersion: 0.18.2
|
||||||
description: A prometheus exporter for vSphere vCenter
|
description: A prometheus exporter for vSphere vCenter
|
||||||
name: vmware-exporter
|
name: vmware-exporter
|
||||||
version: 0.2.0
|
version: 0.2.3
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- vmware-exporter
|
- vmware-exporter
|
||||||
home: https://github.com/nikdoof/helm-charts/tree/master/charts/vmware-exporter
|
home: https://github.com/nikdoof/helm-charts/tree/master/charts/vmware-exporter
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/pryorda/vmware_exporter
|
- https://github.com/pryorda/vmware_exporter
|
||||||
- https://hub.docker.com/r/pryorda/vmware_exporter/tags
|
- https://hub.docker.com/r/pryorda/vmware_exporter/tags
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: nikdoof
|
- name: nikdoof
|
||||||
email: andy@tensixtyone.com
|
email: andy@tensixtyone.com
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: common
|
- name: common
|
||||||
repository: https://library-charts.k8s-at-home.com
|
repository: https://nikdoof.github.io/helm-charts/
|
||||||
version: 4.3.0
|
version: 4.5.3
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{{- if and .Values.metrics.enabled .Values.metrics.dashboards.create }}
|
{{- if and .Values.metrics.enabled .Values.metrics.dashboards.create }}
|
||||||
|
{{- include "common.values.setup" . -}}
|
||||||
{{- $namespace := .Values.metrics.dashboards.namespace | default $.Release.Namespace }}
|
{{- $namespace := .Values.metrics.dashboards.namespace | default $.Release.Namespace }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
|
|
||||||
apiVersion: monitoring.coreos.com/v1
|
|
||||||
kind: PrometheusRule
|
|
||||||
metadata:
|
|
||||||
name: {{ include "common.names.fullname" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "common.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.metrics.prometheusRule.labels }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
groups:
|
|
||||||
- name: {{ include "common.names.fullname" . }}
|
|
||||||
rules:
|
|
||||||
- alert: VmwareExporterAbsent
|
|
||||||
annotations:
|
|
||||||
description: Vmware Exporter has disappeared from Prometheus service discovery.
|
|
||||||
summary: Vmware Exporter is down.
|
|
||||||
expr: |
|
|
||||||
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
|
|
||||||
for: 5m
|
|
||||||
labels:
|
|
||||||
severity: critical
|
|
||||||
{{- with .Values.metrics.prometheusRule.rules }}
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -54,16 +54,16 @@ metrics:
|
|||||||
labels: {}
|
labels: {}
|
||||||
# -- Configure additionial rules for the chart under this key.
|
# -- Configure additionial rules for the chart under this key.
|
||||||
# @default -- See prometheusrules.yaml
|
# @default -- See prometheusrules.yaml
|
||||||
rules: []
|
rules:
|
||||||
# - alert: vmwareExporterAbsent
|
- alert: VmwareExporterAbsent
|
||||||
# annotations:
|
annotations:
|
||||||
# description: vmware Exporter has disappeared from Prometheus service discovery.
|
description: Vmware Exporter has disappeared from Prometheus service discovery.
|
||||||
# summary: vmware Exporter is down.
|
summary: Vmware Exporter is down.
|
||||||
# expr: |
|
expr: |
|
||||||
# absent(up{job=~".*vmwareexporter.*"} == 1)
|
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
|
||||||
# for: 5m
|
for: 5m
|
||||||
# labels:
|
labels:
|
||||||
# severity: critical
|
severity: critical
|
||||||
# -- Enable and configure Grafana dashboard ConfigMaps for the chart under this key.
|
# -- Enable and configure Grafana dashboard ConfigMaps for the chart under this key.
|
||||||
# @default -- See values.yaml
|
# @default -- See values.yaml
|
||||||
dashboards:
|
dashboards:
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
appVersion: "0.8.5"
|
|
||||||
description: Collect VMware vCenter and ESXi performance metrics and send them to InfluxDB
|
|
||||||
name: vsphere-influxdb-go
|
|
||||||
version: 0.2.3
|
|
||||||
keywords:
|
|
||||||
- vsphere
|
|
||||||
- influxdb
|
|
||||||
- esx
|
|
||||||
home: https://github.com/Oxalide/vsphere-influxdb-go
|
|
||||||
sources:
|
|
||||||
- https://hub.docker.com/r/nikdoof/vsphere-influxdb-go/
|
|
||||||
- https://github.com/janeczku/calibre-web
|
|
||||||
maintainers:
|
|
||||||
- name: nikdoof
|
|
||||||
email: andy@tensixtyone.com
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user