Compare commits

...

101 Commits

Author SHA1 Message Date
renovate[bot]
8283b1f395 Update Helm chart common to v4.5.3 2025-08-10 13:04:31 +00:00
f3cc3e190c Merge pull request #65 from nikdoof/renovate/external-minor-dep
Update external minor dep
2025-03-03 09:43:37 +00:00
renovate[bot]
b176c1baa1 Update external minor dep 2025-03-01 01:38:04 +00:00
3c73ffec61 Merge pull request #64 from nikdoof/renovate/external-minor-dep
Update helm/kind-action action to v1.12.0
2025-01-04 10:06:49 +00:00
renovate[bot]
854de227c6 Update helm/kind-action action to v1.12.0 2025-01-01 01:16:59 +00:00
9e7e126e3b Merge pull request #63 from nikdoof/renovate/external-minor-dep
Update helm/kind-action action to v1.10.0
2024-05-02 15:49:12 +01:00
renovate[bot]
3477414580 Update helm/kind-action action to v1.10.0 2024-05-01 00:28:16 +00:00
7c9da31698 Merge pull request #62 from nikdoof/renovate/workflows-azure-setup-helm-4.x
[workflows] Update azure/setup-helm action to v4
2024-04-01 09:22:16 +01:00
renovate[bot]
68bac6536f [workflows] Update azure/setup-helm action to v4 2024-04-01 01:29:53 +00:00
7c8fec46d2 Merge pull request #61 from nikdoof/renovate/external-minor-dep
Update helm/kind-action action to v1.9.0
2024-03-03 07:52:22 +00:00
renovate[bot]
057cff3c53 Update helm/kind-action action to v1.9.0 2024-03-01 02:39:13 +00:00
9e381e07bf Merge pull request #60 from nikdoof/renovate/workflows-actions-setup-python-5.x
[workflows] Update actions/setup-python action to v5
2024-01-11 18:21:54 +00:00
28b2e73a1c Merge pull request #59 from nikdoof/renovate/external-minor-dep
Update helm/chart-releaser-action action to v1.6.0
2024-01-11 18:21:45 +00:00
renovate[bot]
49aead8392 [workflows] Update actions/setup-python action to v5 2024-01-01 00:43:52 +00:00
renovate[bot]
5736e631b1 Update helm/chart-releaser-action action to v1.6.0 2024-01-01 00:43:49 +00:00
0cb9253cf2 Merge pull request #58 from nikdoof/renovate/external-patch-dep
Update helm/chart-testing-action action to v2.6.1
2023-12-03 13:19:31 +00:00
renovate[bot]
ae4baa5a8d Update helm/chart-testing-action action to v2.6.1 2023-12-01 02:10:23 +00:00
ad896bfc25 Merge pull request #57 from nikdoof/renovate/external-minor-dep
Update helm/chart-testing-action action to v2.6.0
2023-11-01 10:06:24 +00:00
renovate[bot]
c3f4320bc9 Update helm/chart-testing-action action to v2.6.0 2023-11-01 01:29:18 +00:00
e577d114a0 Merge pull request #56 from nikdoof/renovate/workflows-actions-checkout-4.x
[workflows] Update actions/checkout action to v4
2023-10-03 09:43:47 +01:00
renovate[bot]
ee0dc43acb [workflows] Update actions/checkout action to v4 2023-10-01 01:16:45 +00:00
12d667302d Merge pull request #55 from nikdoof/renovate/external-minor-dep
Update helm/kind-action action to v1.8.0
2023-09-01 13:56:38 +01:00
71a2a2a3fe Don't attempt to install the CRDs if we have no changes 2023-09-01 13:55:53 +01:00
renovate[bot]
a2cfdc0fa5 Update helm/kind-action action to v1.8.0 2023-09-01 00:40:21 +00:00
cc49faf2f2 Merge pull request #54 from nikdoof/renovate/external-minor-dep
Update helm/kind-action action to v1.7.0
2023-07-06 09:59:48 +01:00
renovate[bot]
7d49c188c9 Update helm/kind-action action to v1.7.0 2023-07-01 07:29:50 +00:00
9a201834c3 Merge pull request #53 from nikdoof/renovate/external-minor-dep
Update external minor dep
2023-05-01 07:19:01 +01:00
renovate[bot]
ee8767e7a6 Update external minor dep 2023-05-01 02:27:29 +00:00
b7dc73097a [all] Update README 2023-03-06 11:05:51 +00:00
408afd720f Merge pull request #50 from nikdoof/common-update
[all] Update Common to 4.5.3
2023-03-06 10:46:35 +00:00
c1fc20c281 [all] Remove uneeded CRDs 2023-03-06 10:42:21 +00:00
3d3535cb3b [all] Install CRDs for testing 2023-03-06 10:38:14 +00:00
cc91cc2f98 [all] Switch to kind for testing cluster 2023-03-06 10:28:21 +00:00
37615237d6 [hg612-exporter] Fix dashboard configmap 2023-03-06 10:25:58 +00:00
30256c3ae5 [vmware-exporter] Fix dashboard configmap 2023-03-06 10:24:52 +00:00
2f3d052cd5 [vmware-exporter] Update common to 4.5.3 2023-03-06 10:18:51 +00:00
e091d3adbc [idrac6] Update common to 4.5.3 2023-03-06 10:17:28 +00:00
bd0a2d1155 [hg612-exporter] Update common to 4.5.3 2023-03-06 10:16:40 +00:00
e2bd3ff0b8 [antennas] Update common to 4.5.3 2023-03-06 10:14:13 +00:00
4436e99f22 [all] Fix lint-test workflow 2023-03-06 10:06:33 +00:00
41eeb4795d [aaisp-exporter] Update to common 4.5.3 2023-03-06 10:04:22 +00:00
acb65e778e Update testing (#49) 2023-03-06 10:01:35 +00:00
3e65c6aff7 [plex-exporter] Update to common, add loglevel argument (#48)
* [plex-exporter] Update to common, add loglevel argument

* Fix empty lines

* Clean linting

* Add missing repo to ct
2023-03-06 09:28:09 +00:00
d9ed2b2bed Bump common-chart to newest common version 2023-03-05 08:31:59 +00:00
855c04e7f3 Add PrometheusRule and ServiceMonitor to common (#47)
* Add PrometheusRule and ServiceMonitor to common

* Bump Kind version
2023-03-05 08:29:38 +00:00
renovate[bot]
067d636a28 Update external patch dep (#46)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-06 11:15:55 +01:00
renovate[bot]
37bfd4bdd5 Update helm/chart-testing-action action to v2.3.0 (#45)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-01 07:50:30 +01:00
396816c4a0 [all] Fix PrometheusRule and ServiceMonitor after Common upgrade 2022-08-29 08:07:11 +01:00
1b7d8fd3e2 [all] Switch to our common chart version 2022-08-22 16:51:13 +01:00
3e2b990951 Remove old, unsupported charts 2022-08-22 16:48:00 +01:00
2dc6067e10 [common-chart] Add common-chart 2022-08-22 16:36:31 +01:00
0565593931 [common] Add common chart from KaH 2022-08-22 16:34:31 +01:00
3c7c7ed7a1 [antennas] Fix configmap render issue (#44) 2022-08-10 17:29:19 +01:00
39411f2306 [antennas] Update dependencies 2022-08-10 17:14:57 +01:00
renovate[bot]
582b08a1a7 [workflows] Update azure/setup-helm action to v3 (#43)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-02 07:09:00 +01:00
renovate[bot]
e595c03ce3 [workflows] Update actions/setup-python action to v4 (#42)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-02 07:08:46 +01:00
renovate[bot]
4a07da46b7 Update helm/chart-releaser-action action to v1.4.0 (#41)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-05 14:00:45 +01:00
renovate[bot]
041349a168 Update helm/chart-testing-action action to v2.2.1 (#37)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-04 13:58:36 +01:00
renovate[bot]
9992558871 [workflows] Update actions/setup-python action to v3 (#39)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-04 13:58:27 +01:00
renovate[bot]
7982f72173 [workflows] Update actions/checkout action to v3 (#38)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-04 13:58:15 +01:00
renovate[bot]
44f292950f Update external minor dep (#36)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-02 07:00:57 +00:00
renovate[bot]
09cc013ed2 Update Helm chart common to v4.3.0 (#35)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-08 13:17:44 +00:00
f56333793d Update renovate config 2022-01-08 13:05:22 +00:00
0f3d646141 [antennas] New Chart (#34)
* [antennas] New Chart

* [antennas] Add options for host networking

* [antennas] Version 1.0.0

* [antennas] Fix lint issues
2022-01-07 17:56:07 +00:00
e6f88c5ddd [mqtt-exporter] New chart (#33)
* [mqtt-exporter] New chart

* Don't enable Metrics for testing

* Fix linting issues
2021-12-18 18:01:40 +00:00
7b047c4552 [hg612-exporter] Improve dashboard to handle pod restarts better 2021-12-18 13:46:55 +00:00
fc2c3cbcf2 [hg612-exporter] Fix container startup 2021-12-18 13:23:52 +00:00
824c0ff326 [hg612-exporter] App version to 0.1.2 2021-12-18 13:16:40 +00:00
dcae5b6c3e [hg612-exporter] Add Grafana Dashboards 2021-12-18 12:58:24 +00:00
436fa77a4d [vmware-exporter] Improve Grafana dashboards 2021-12-18 12:26:29 +00:00
072341f3a0 [vmware-exporter] Add Grafana dashboards for metrics 2021-12-18 11:54:15 +00:00
63a610ccdd [vmware-exporter] New Chart (#32)
* [vmware-exporter] New Chart

* Update repo README
2021-12-09 11:29:17 +00:00
e706d4f9cd [plex-exporter] Fix issues with Autodiscovery (#31) 2021-12-08 17:23:37 +00:00
c2b9442ebc [plex-exporter] Add support for token and autodiscovery (#30) 2021-12-08 17:00:56 +00:00
30fbc3e8f7 [all] Bump chart versions for updated documentation 2021-12-08 16:31:48 +00:00
373f2ebf05 Update READMEs 2021-12-08 16:28:18 +00:00
d232507c2e [plex-exporter] New Chart 2021-12-08 16:25:38 +00:00
ec0eba80f2 [all] Update READMEs 2021-12-06 17:50:14 +00:00
52e72724a9 [aaisp-exporter] Correct chart information 2021-12-06 17:48:10 +00:00
fcb4215a5a [aaisp-exporter] New Chart 2021-12-06 17:46:42 +00:00
c454a5e074 [hg612-exporter] Switch to own container image version 2021-12-05 09:12:13 +00:00
47da657ac8 [hg612-exporter] New chart (#29)
* [hg612-export] New chart

* Remove default from identifier

* Correct maintainer

* Fix chart params
2021-12-05 08:34:04 +00:00
dd6d80ce25 Remove deluge, update README 2021-12-05 07:47:35 +00:00
d76080b813 Remove old charts 2021-12-05 07:44:50 +00:00
f05a2baf85 [idrac6] Remove default env values (#28)
* Remove default env values

* Fix lint issues
2021-12-05 06:31:57 +00:00
e259457f30 Switch iDRAC6 chart to k8s-at-home common chart (#27)
* Switch iDRAC6 chart to k8s-at-home common chart base

* Add test values and CT updates

* Update build workflows

* Switch to k3d

* Try and work out testing issue

* Try hard specifying the config

* Move ct to github folder

* Remove timeout

* Correct config file path
2021-12-04 20:17:00 +00:00
bc3c1fa17b Remove NFS provisioner chart (#15)
Use https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner instead.
2021-12-04 18:52:53 +00:00
57fa6e21b1 [vsphere-influxdb-go] Fix default config, remove domain 2021-07-13 10:57:24 +01:00
cc9c5c6652 Add docker deps to Renovate 2021-07-02 16:44:56 +01:00
renovate[bot]
f99101d00b [zigbee2mqttassistant] Update to v0.3.178 (#19)
* Update carldebilly/zigbee2mqttassistant Docker tag to v0.3.178

* [zigbee2mqttassistant] Bump chart version

* Fix secret name

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Andrew Williams <andy@tensixtyone.com>
2021-07-02 16:38:23 +01:00
renovate[bot]
1548f606e7 Update external minor dep (#24)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-02 16:15:21 +01:00
f33c104b1f Update renovate config 2021-07-02 16:14:07 +01:00
1007982a78 [vsphere-influxdb-go] Fix default configmap (#23) 2021-07-02 14:09:40 +01:00
renovate[bot]
bea73339d5 Update helm/chart-releaser-action action to v1.2.1 (#20)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-02 09:24:41 +01:00
renovate[bot]
644cf70b31 Add renovate.json (#18)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-02 09:23:27 +01:00
d929f18571 [idrac6] Use secrets for iDRAC login details (#16) 2021-05-21 12:31:30 +01:00
ff5fb746ad Add 'idrac6' chart (#14)
* Add idrac6 chart

* Add test values
2021-05-21 11:39:37 +01:00
6aec140b79 [nfs-client-provisioner] Remove depreciation tag (#13)
* [nfs-client-provisioner] Remove depreciation tag

* [nfs-client-provisioner] Add maintainers
2021-01-01 16:18:57 +00:00
2bb2c4a7d3 Update release.yaml 2021-01-01 13:47:48 +00:00
a29c9d7cff [nfs-client-provisioner] Import from helm/stable repo (#11)
* Import nfs-client-provisioner from helm/stable repo

* Update chart testing

* Correct testing
2021-01-01 13:46:14 +00:00
343a41b2e7 [aaisp2mqtt] Bump default version (#10) 2020-10-01 07:20:40 +01:00
210 changed files with 13438 additions and 2626 deletions

11
.github/ct.yaml vendored Normal file
View File

@@ -0,0 +1,11 @@
remote: origin
target-branch: master
chart-dirs:
- charts
excluded-charts:
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
- k8s-at-home-libraries=https://library-charts.k8s-at-home.com
- k8s-at-home=https://k8s-at-home.com/charts
- jetstack=https://charts.jetstack.io
- nikdoof=https://nikdoof.github.io/helm-charts/

90
.github/renovate.json5 vendored Normal file
View File

@@ -0,0 +1,90 @@
{
"enabled": true,
"dependencyDashboard": true,
"dependencyDashboardTitle": "Renovate Dashboard",
"assigneesFromCodeOwners": true,
"reviewersFromCodeOwners": true,
"suppressNotifications": ["prIgnoreNotification"],
"rebaseWhen": "conflicted",
"prConcurrentLimit": 5,
"helm-values": {
"enabled": false
},
"helmv3": {
"fileMatch": ["charts/.+/Chart\\.yaml$"]
},
"packageRules": [
// Setup datasources
{
"matchDatasources": ["helm"],
"commitMessageTopic": "Helm chart {{depName}}",
"separateMinorPatch": true
},
// Custom version schemes
{
"matchDatasources": ["github-tags"],
"matchPackageNames": ["potiuk/get-workflow-origin"],
"versioning": "regex:^v(?<major>\\d+)_(?<minor>\\d+)(_(?<patch>\\d+))?$"
},
//
// Common library dep
//
{
"commitMessagePrefix": "[{{{parentDir}}}]",
"branchTopic": "{{{parentDir}}}-{{{depNameSanitized}}}-{{{newMajor}}}{{#if isPatch}}.{{{newMinor}}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}",
"updateTypes": ["major"],
"bumpVersion": "major",
"labels": ["dependency/major"],
"packageNames": ["common"],
"groupName": ["internal major dep"]
},
{
"updateTypes": ["minor"],
"bumpVersion": "minor",
"labels": ["dependency/minor"],
"packageNames": ["common"],
"groupName": ["internal minor dep"]
},
{
"updateTypes": ["patch"],
"bumpVersion": "patch",
"labels": ["dependency/patch"],
"packageNames": ["common"],
"groupName": ["internal patch dep"]
},
//
// Other library deps
//
{
"commitMessagePrefix": "[{{{parentDir}}}]",
"branchTopic": "{{{parentDir}}}-{{{depNameSanitized}}}-{{{newMajor}}}{{#if isPatch}}.{{{newMinor}}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}",
"updateTypes": ["major"],
"bumpVersion": "major",
"labels": ["dependency/major"],
"excludePackageNames": ["common"],
"schedule": [
"every 3 months on the first day of the month"
]
},
{
"updateTypes": ["minor"],
"bumpVersion": "minor",
"labels": ["dependency/minor"],
"excludePackageNames": ["common"],
"groupName": ["external minor dep"],
"schedule": [
"every 2 months on the first day of the month"
]
},
{
"updateTypes": ["patch"],
"bumpVersion": "patch",
"labels": ["dependency/patch"],
"excludePackageNames": ["common"],
"groupName": ["external patch dep"],
"schedule": [
"every 1 months on the first day of the month"
]
}
]
}

View File

@@ -2,26 +2,57 @@ name: Lint and Test Charts
on: pull_request
env:
K8S_VERSION: 1.22
HELM_VERSION: 3.9.2
PYTHON_VERSION: 3.11
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: "v${{ env.HELM_VERSION }}"
- uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.7.0
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
id: lint
uses: helm/chart-testing-action@v1.0.0-alpha.3
with:
command: lint
run: ct lint --config .github/ct.yaml
- name: Create kind cluster
uses: helm/kind-action@v1.0.0-alpha.3
with:
install_local_path_provisioner: true
if: steps.lint.outputs.changed == 'true'
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.12.0
if: steps.list-changed.outputs.changed == 'true'
- name: Remove node taints
run: |
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)
uses: helm/chart-testing-action@v1.0.0-alpha.3
with:
command: install
run: ct install --config .github/ct.yaml
if: steps.list-changed.outputs.changed == 'true'

View File

@@ -10,28 +10,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
# See https://github.com/helm/chart-releaser-action/issues/6
- name: Install Helm
run: |
curl -sSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get
chmod 700 get_helm.sh
./get_helm.sh
helm init --client-only
- name: Add dependency chart repos
run: |
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
uses: azure/setup-helm@v4
with:
version: v3.4.0
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.0.0-alpha.2
uses: helm/chart-releaser-action@v1.7.0
with:
charts_repo_url: https://nikdoof.github.io/helm-charts
env:

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
charts/*/charts/*.tgz
Chart.lock

View File

@@ -22,10 +22,13 @@ You can then run `helm search nikdoof` to see the charts.
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
* [calibre-web](./charts/calibre-web) - Web app for browsing, reading and downloading eBooks stored in a Calibre database
* [deluge](./charts/deluge) - Deluge torrent client
* [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.
* [vmware-exporter](./charts/vmware-exporter) - A Prometheus exporter for VMware vSphere.
## License

View File

@@ -19,5 +19,8 @@
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl

View File

@@ -0,0 +1,18 @@
apiVersion: v2
appVersion: 0.2.1
description: A prometheus exporter for the Andrew & Arnold CHAOS API
name: aaisp-exporter
version: 0.2.3
kubeVersion: ">=1.16.0-0"
keywords:
- aaisp-exporter
home: https://github.com/nikdoof/helm-charts/tree/master/charts/aaisp-exporter
sources:
- https://github.com/nikdoof/aaisp-chaos
maintainers:
- name: nikdoof
email: andy@tensixtyone.com
dependencies:
- name: common
repository: https://nikdoof.github.io/helm-charts/
version: 4.5.3

View File

@@ -0,0 +1,118 @@
# aaisp-exporter
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: 0.2.1](https://img.shields.io/badge/AppVersion-0.2.1-informational?style=flat-square)
A prometheus exporter for the Andrew & Arnold CHAOS API
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/nikdoof/helm-charts/issues/new/choose)**
## Source Code
* <https://github.com/nikdoof/aaisp-chaos>
## Requirements
Kubernetes: `>=1.16.0-0`
## Dependencies
| Repository | Name | Version |
|------------|------|---------|
| https://library-charts.k8s-at-home.com | common | 4.2.0 |
## TL;DR
```console
helm repo add nikdoof-helm-charts https://nikdoof.github.io/helm-charts/
helm repo update
helm install aaisp-exporter nikdoof-helm-charts/aaisp-exporter
```
## Installing the Chart
To install the chart with the release name `aaisp-exporter`
```console
helm install aaisp-exporter nikdoof-helm-charts/aaisp-exporter
```
## Uninstalling the Chart
To uninstall the `aaisp-exporter` deployment
```console
helm uninstall aaisp-exporter
```
The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release.
## Configuration
Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values.
Other values may be used from the [values.yaml](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml) from the [common library](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common).
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
```console
helm install aaisp-exporter \
--set modem.host="192.168.1.1"\
nikdoof-helm-charts/aaisp-exporter
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.
```console
helm install aaisp-exporter nikdoof-helm-charts/aaisp-exporter -f values.yaml
```
## Custom configuration
N/A
## Values
**Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common)
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| env | object | See below | environment variables. See more environment variables in the [aaisp-exporter documentation](https://github.com/nikdoof/aaisp-chaos/tree/master/cmd/aaisp_exporter). |
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| image.repository | string | `"ghcr.io/nikdoof/aaisp-exporter"` | image repository |
| image.tag | string | `"0.2.1"` | image tag |
| ingress.main | object | See values.yaml | Enable and configure ingress settings for the chart under this key. |
| metrics.enabled | bool | See values.yaml | Enable and configure a Prometheus serviceMonitor for the chart under this key. |
| metrics.prometheusRule | object | See values.yaml | Enable and configure Prometheus Rules for the chart under this key. |
| metrics.prometheusRule.rules | list | See prometheusrules.yaml | Configure additionial rules for the chart under this key. |
| metrics.serviceMonitor.interval | string | `"1m"` | |
| metrics.serviceMonitor.labels | object | `{}` | |
| metrics.serviceMonitor.scrapeTimeout | string | `"30s"` | |
| service | object | See values.yaml | Configures service settings for the chart. |
## Changelog
All notable changes to this application Helm chart will be documented in this file but does not include changes from our common library. To read those click [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common#changelog).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [1.0.0]
#### Added
- Initial version
#### Changed
- N/A
#### Removed
- N/A
[1.0.0]: #100
## Support
- Open an [issue](https://github.com/nikdoof/helm-charts/issues/new/choose)
----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0)

View File

@@ -0,0 +1,143 @@
{{- define "custom.repository.organization" -}}
nikdoof-helm-charts
{{- end -}}
{{- define "custom.repository.url" -}}
https://github.com/nikdoof/helm-charts
{{- end -}}
{{- define "custom.helm.url" -}}
https://nikdoof.github.io/helm-charts/
{{- end -}}
{{- define "custom.helm.path" -}}
{{ template "custom.repository.organization" . }}/{{ template "chart.name" . }}
{{- end -}}
{{- define "custom.notes" -}}
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/nikdoof/helm-charts/issues/new/choose)**
{{- end -}}
{{- define "custom.requirements" -}}
## Requirements
{{ template "chart.kubeVersionLine" . }}
{{- end -}}
{{- define "custom.dependencies" -}}
## Dependencies
{{ template "chart.requirementsTable" . }}
{{- end -}}
{{- define "custom.install.tldr" -}}
## TL;DR
```console
helm repo add {{ template "custom.repository.organization" . }} {{ template "custom.helm.url" . }}
helm repo update
helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }}
```
{{- end -}}
{{- define "custom.install" -}}
## Installing the Chart
To install the chart with the release name `{{ template "chart.name" . }}`
```console
helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }}
```
{{- end -}}
{{- define "custom.uninstall" -}}
## Uninstalling the Chart
To uninstall the `{{ template "chart.name" . }}` deployment
```console
helm uninstall {{ template "chart.name" . }}
```
The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release.
{{- end -}}
{{- define "custom.configuration.header" -}}
## Configuration
{{- end -}}
{{- define "custom.configuration.readValues" -}}
Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values.
Other values may be used from the [values.yaml](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml) from the [common library](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common).
{{- end -}}
{{- define "custom.configuration.example.set" -}}
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
```console
helm install {{ template "chart.name" . }} \
--set modem.host="192.168.1.1"\
{{ template "custom.helm.path" . }}
```
{{- end -}}
{{- define "custom.configuration.example.file" -}}
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.
```console
helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} -f values.yaml
```
{{- end -}}
{{- define "custom.valuesSection" -}}
## Values
**Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common)
{{ template "chart.valuesTable" . }}
{{- end -}}
{{- define "custom.support" -}}
## Support
- Open an [issue](https://github.com/nikdoof/helm-charts/issues/new/choose)
{{- end -}}
{{ template "chart.header" . }}
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
{{ template "chart.description" . }}
{{ template "custom.notes" . }}
{{ template "chart.sourcesSection" . }}
{{ template "custom.requirements" . }}
{{ template "custom.dependencies" . }}
{{ template "custom.install.tldr" . }}
{{ template "custom.install" . }}
{{ template "custom.uninstall" . }}
{{ template "custom.configuration.header" . }}
{{ template "custom.configuration.readValues" . }}
{{ template "custom.configuration.example.set" . }}
{{ template "custom.configuration.example.file" . }}
{{ template "custom.custom.configuration" . }}
{{ template "custom.valuesSection" . }}
{{ template "custom.changelog" . }}
{{ template "custom.support" . }}
{{ template "helm-docs.versionFooter" . }}
{{ "" }}

View File

@@ -0,0 +1,27 @@
{{- define "custom.changelog.header" -}}
## Changelog
{{- end -}}
{{- define "custom.changelog" -}}
{{ template "custom.changelog.header" . }}
All notable changes to this application Helm chart will be documented in this file but does not include changes from our common library. To read those click [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common#changelog).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [1.0.0]
#### Added
- Initial version
#### Changed
- N/A
#### Removed
- N/A
[1.0.0]: #100
{{- end -}}

View File

@@ -0,0 +1,9 @@
{{- define "custom.custom.configuration.header" -}}
## Custom configuration
{{- end -}}
{{- define "custom.custom.configuration" -}}
{{ template "custom.custom.configuration.header" . }}
N/A
{{- end -}}

View File

@@ -0,0 +1,4 @@
---
env:
CHAOS_CONTROL_LOGIN: test
CHAOS_CONTROL_PASSWORD: test

View File

@@ -0,0 +1 @@
{{- include "common.notes.defaultNotes" . -}}

View File

@@ -0,0 +1 @@
{{ include "common.all" . }}

View File

@@ -0,0 +1,62 @@
#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
#
image:
# -- image repository
repository: ghcr.io/nikdoof/aaisp-exporter
# -- image tag
tag: 0.2.1
# -- image pull policy
pullPolicy: IfNotPresent
# -- environment variables. See more environment variables in the [aaisp-exporter documentation](https://github.com/nikdoof/aaisp-chaos/tree/master/cmd/aaisp_exporter).
# @default -- See below
env: {}
# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
main:
ports:
http:
enabled: false
metrics:
enabled: true
protocol: TCP
port: 8080
ingress:
# -- Enable and configure ingress settings for the chart under this key.
# @default -- See values.yaml
main:
enabled: false
metrics:
# -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
# @default -- See values.yaml
enabled: false
serviceMonitor:
interval: 1m
scrapeTimeout: 30s
labels: {}
# -- Enable and configure Prometheus Rules for the chart under this key.
# @default -- See values.yaml
prometheusRule:
enabled: false
labels: {}
# -- Configure additional rules for the chart under this key.
# @default -- See prometheusrules.yaml
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

View File

@@ -1,15 +0,0 @@
apiVersion: v1
appVersion: "0.2"
description: Pulls data from the AAISP CHAOSv2 API into MQTT
name: aaisp-to-mqtt
version: 0.2.5
keywords:
- aaisp
- mqtt
home: https://github.com/nikdoof/aaisp-to-mqtt
sources:
- https://hub.docker.com/r/nikdoof/aaisp-to-mqtt/
- https://github.com/natm/aaisp-to-mqtt
maintainers:
- name: nikdoof
email: andy@tensixtyone.com

View File

@@ -1,4 +0,0 @@
mqtt:
broker: localhost
existingSecretName: aaisp-to-mqtt-secret

View File

@@ -1,6 +0,0 @@
aaisp:
username: test1@a
password: TesttestTest
mqtt:
broker: localhost

View File

@@ -1,56 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "aaisp-to-mqtt.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 "aaisp-to-mqtt.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 "aaisp-to-mqtt.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "aaisp-to-mqtt.labels" -}}
app.kubernetes.io/name: {{ include "aaisp-to-mqtt.name" . }}
helm.sh/chart: {{ include "aaisp-to-mqtt.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 "aaisp-to-mqtt.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "aaisp-to-mqtt.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

View File

@@ -1,89 +0,0 @@
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ include "aaisp-to-mqtt.fullname" . }}-cronjob
{{- if .Values.deploymentAnnotations }}
annotations:
{{- range $key, $value := .Values.deploymentAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "aaisp-to-mqtt.name" . }}
helm.sh/chart: {{ include "aaisp-to-mqtt.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ include "aaisp-to-mqtt.name" . }}
spec:
schedule: {{ .Values.cronjob.schedule | quote }}
successfulJobsHistoryLimit: {{ .Values.cronjob.successfulJobsHistoryLimit }}
failedJobsHistoryLimit: {{ .Values.cronjob.failedJobsHistoryLimit }}
concurrencyPolicy: Forbid
{{- if .Values.cronjob.startingDeadlineSeconds }}
startingDeadlineSeconds: {{ .Values.cronjob.startingDeadlineSeconds }}
{{- end }}
jobTemplate:
spec:
backoffLimit: 0
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "aaisp-to-mqtt.name" . }}
helm.sh/chart: {{ include "aaisp-to-mqtt.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ include "aaisp-to-mqtt.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 "aaisp-to-mqtt-secret" .Values.existingSecretName }}
key: aaisp.username
- name: AAISP_PASSWORD
valueFrom:
secretKeyRef:
name: {{ default "aaisp-to-mqtt-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 "aaisp-to-mqtt-secret" .Values.existingSecretName }}
key: mqtt.username
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ default "aaisp-to-mqtt-secret" .Values.existingSecretName }}
key: mqtt.password
{{- end }}
- name: MQTT_TOPIC_PREFIX
value: {{ default "aaisp" .Values.mqtt.topicPrefix }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 12 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 12 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 12 }}:
{{- end }}

View File

@@ -1,20 +0,0 @@
---
{{- if not (.Values.existingSecretName) }}
apiVersion: v1
kind: Secret
metadata:
name: aaisp-to-mqtt-secret
labels:
app.kubernetes.io/name: {{ include "aaisp-to-mqtt.name" . }}
helm.sh/chart: {{ include "aaisp-to-mqtt.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ include "aaisp-to-mqtt.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 }}

View File

@@ -1,56 +0,0 @@
# Default values for aaisp-to-mqtt.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nikdoof/aaisp-to-mqtt
tag: 0.2.3
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
cronjob:
schedule: "*/10 * * * *"
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 1
# startingDeadlineSeconds: 10
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: {}

View File

@@ -1,15 +0,0 @@
apiVersion: v1
appVersion: "0.3.0"
description: Pulls data from the AAISP CHAOSv2 API into MQTT
name: aaisp2mqtt
version: 0.3.1
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

View File

@@ -1,4 +0,0 @@
mqtt:
broker: localhost
existingSecretName: aaisp2mqtt-secret

View File

@@ -1,9 +0,0 @@
aaisp:
username: test1@a
password: TesttestTest
mqtt:
broker: localhost
homeassistant:
enabled: true

View File

@@ -1,6 +0,0 @@
aaisp:
username: test1@a
password: TesttestTest
mqtt:
broker: localhost

View File

@@ -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 -}}

View File

@@ -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 }}

View File

@@ -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 }}

View File

@@ -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.0
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: {}

View File

@@ -20,3 +20,7 @@
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl

View File

@@ -0,0 +1,21 @@
apiVersion: v2
appVersion: "4.2.0"
description: Antennas
name: antennas
version: 1.1.4
kubeVersion: ">=1.16.0-0"
keywords:
- tvheadend
- antennas
- iptv
home: https://github.com/nikdoof/helm-charts/tree/master/charts/antennas/
sources:
- https://github.com/jfarseneau/antennas
- https://hub.docker.com/r/thejf/antennas
maintainers:
- name: nikdoof
email: andy@tensixtyone.com
dependencies:
- name: common
repository: https://nikdoof.github.io/helm-charts/
version: 4.5.3

120
charts/antennas/README.md Normal file
View File

@@ -0,0 +1,120 @@
# antennas
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![AppVersion: 4.1.0](https://img.shields.io/badge/AppVersion-4.1.0-informational?style=flat-square)
Antennas
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/nikdoof/helm-charts/issues/new/choose)**
## Source Code
* <https://github.com/jfarseneau/antennas>
* <https://hub.docker.com/r/thejf/antennas>
## Requirements
Kubernetes: `>=1.16.0-0`
## Dependencies
| Repository | Name | Version |
|------------|------|---------|
| https://library-charts.k8s-at-home.com | common | 4.2.0 |
## TL;DR
```console
helm repo add nikdoof-helm-charts https://nikdoof.github.io/helm-charts/
helm repo update
helm install antennas nikdoof-helm-charts/antennas
```
## Installing the Chart
To install the chart with the release name `antennas`
```console
helm install antennas nikdoof-helm-charts/antennas
```
## Uninstalling the Chart
To uninstall the `antennas` deployment
```console
helm uninstall antennas
```
The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release.
## Configuration
Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values.
Other values may be used from the [values.yaml](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml) from the [common library](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common).
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
```console
helm install antennas \
--set antennas.tvheadend_url="http://tvheadend:9981"\
nikdoof-helm-charts/antennas
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.
```console
helm install antennas nikdoof-helm-charts/antennas -f values.yaml
```
## Custom configuration
N/A
## Values
**Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common)
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| antennas | object | See below | Antennas configuration options. See more environment variables in the [antennas documentation](https://github.com/jfarseneau/antennas). |
| antennas.antennas_url | string | `nil` | Externally accessible URL for this antennas instance, defaults to the main service http port. |
| antennas.stream_url | string | `nil` | Optional stream URL, used for situations where the internal and external URL for TVHeadend is different. |
| antennas.tuner_count | int | `4` | Number of tuners to present to Plex |
| antennas.tvheadend_url | string | `nil` | URL of the TVHeadend instance. |
| dnsPolicy | string | `nil` | When hostNetwork is true set dnsPolicy to ClusterFirstWithHostNet |
| env | object | See below | environment variables. See more environment variables in the [antennas documentation](https://github.com/jfarseneau/antennas). |
| hostNetwork | bool | `false` | Enable Antennas to be discoverable via SSDP |
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| image.repository | string | `"thejf/antennas"` | image repository |
| image.tag | string | `"4.1.0"` | image tag |
| ingress.main | object | See values.yaml | Enable and configure ingress settings for the chart under this key. |
| service | object | See values.yaml | Configures service settings for the chart. |
## Changelog
All notable changes to this application Helm chart will be documented in this file but does not include changes from our common library. To read those click [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common#changelog).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [1.0.0]
#### Added
- Initial version
#### Changed
- N/A
#### Removed
- N/A
[1.0.0]: #100
## Support
- Open an [issue](https://github.com/nikdoof/helm-charts/issues/new/choose)
----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0)

View File

@@ -0,0 +1,143 @@
{{- define "custom.repository.organization" -}}
nikdoof-helm-charts
{{- end -}}
{{- define "custom.repository.url" -}}
https://github.com/nikdoof/helm-charts
{{- end -}}
{{- define "custom.helm.url" -}}
https://nikdoof.github.io/helm-charts/
{{- end -}}
{{- define "custom.helm.path" -}}
{{ template "custom.repository.organization" . }}/{{ template "chart.name" . }}
{{- end -}}
{{- define "custom.notes" -}}
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/nikdoof/helm-charts/issues/new/choose)**
{{- end -}}
{{- define "custom.requirements" -}}
## Requirements
{{ template "chart.kubeVersionLine" . }}
{{- end -}}
{{- define "custom.dependencies" -}}
## Dependencies
{{ template "chart.requirementsTable" . }}
{{- end -}}
{{- define "custom.install.tldr" -}}
## TL;DR
```console
helm repo add {{ template "custom.repository.organization" . }} {{ template "custom.helm.url" . }}
helm repo update
helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }}
```
{{- end -}}
{{- define "custom.install" -}}
## Installing the Chart
To install the chart with the release name `{{ template "chart.name" . }}`
```console
helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }}
```
{{- end -}}
{{- define "custom.uninstall" -}}
## Uninstalling the Chart
To uninstall the `{{ template "chart.name" . }}` deployment
```console
helm uninstall {{ template "chart.name" . }}
```
The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release.
{{- end -}}
{{- define "custom.configuration.header" -}}
## Configuration
{{- end -}}
{{- define "custom.configuration.readValues" -}}
Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values.
Other values may be used from the [values.yaml](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml) from the [common library](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common).
{{- end -}}
{{- define "custom.configuration.example.set" -}}
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
```console
helm install {{ template "chart.name" . }} \
--set antennas.tvheadend_url="http://tvheadend:9981"\
{{ template "custom.helm.path" . }}
```
{{- end -}}
{{- define "custom.configuration.example.file" -}}
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.
```console
helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} -f values.yaml
```
{{- end -}}
{{- define "custom.valuesSection" -}}
## Values
**Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common)
{{ template "chart.valuesTable" . }}
{{- end -}}
{{- define "custom.support" -}}
## Support
- Open an [issue](https://github.com/nikdoof/helm-charts/issues/new/choose)
{{- end -}}
{{ template "chart.header" . }}
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
{{ template "chart.description" . }}
{{ template "custom.notes" . }}
{{ template "chart.sourcesSection" . }}
{{ template "custom.requirements" . }}
{{ template "custom.dependencies" . }}
{{ template "custom.install.tldr" . }}
{{ template "custom.install" . }}
{{ template "custom.uninstall" . }}
{{ template "custom.configuration.header" . }}
{{ template "custom.configuration.readValues" . }}
{{ template "custom.configuration.example.set" . }}
{{ template "custom.configuration.example.file" . }}
{{ template "custom.custom.configuration" . }}
{{ template "custom.valuesSection" . }}
{{ template "custom.changelog" . }}
{{ template "custom.support" . }}
{{ template "helm-docs.versionFooter" . }}
{{ "" }}

View File

@@ -0,0 +1,27 @@
{{- define "custom.changelog.header" -}}
## Changelog
{{- end -}}
{{- define "custom.changelog" -}}
{{ template "custom.changelog.header" . }}
All notable changes to this application Helm chart will be documented in this file but does not include changes from our common library. To read those click [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common#changelog).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [1.0.0]
#### Added
- Initial version
#### Changed
- N/A
#### Removed
- N/A
[1.0.0]: #100
{{- end -}}

View File

@@ -0,0 +1,9 @@
{{- define "custom.custom.configuration.header" -}}
## Custom configuration
{{- end -}}
{{- define "custom.custom.configuration" -}}
{{ template "custom.custom.configuration.header" . }}
N/A
{{- end -}}

View File

@@ -0,0 +1,3 @@
---
antennas:
tvheadend_url: http://tvheadend:9981

View File

@@ -0,0 +1 @@
{{- include "common.notes.defaultNotes" . -}}

View File

@@ -0,0 +1,18 @@
{{/* Make sure all variables are set properly */}}
{{- include "common.values.setup" . }}
{{/* Append the hardcoded settings */}}
{{- define "antennas.harcodedValues" -}}
{{/* Append the configMap volume to the volumes */}}
persistence:
antennas-config:
enabled: true
type: "configMap"
name: "{{ include "common.names.fullname" . }}-config"
mountPath: "/antennas/config/config.yml"
subPath: "config.yml"
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "antennas.harcodedValues" . | fromYaml) -}}
{{ include "common.all" . }}

View File

@@ -0,0 +1,22 @@
{{- include "common.values.setup" . -}}
{{- $values := .Values.service -}}
{{- $serviceName := include "common.names.fullname" . -}}
{{- if and (hasKey $values "nameOverride") $values.nameOverride -}}
{{- $serviceName = printf "%v-%v" $serviceName $values.nameOverride -}}
{{ end -}}
{{- $defaultAntennasURL := printf "http://%v:%v" $serviceName .Values.service.main.ports.http.port -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}-config
labels:
{{- include "common.labels" . | nindent 4 }}
data:
config.yml: |-
tvheadend_url: {{ required "A TVHeadend URL is required!" .Values.antennas.tvheadend_url }}
antennas_url: {{ .Values.antennas.antennas_url | default $defaultAntennasURL }}
tuner_count: {{ .Values.antennas.tuner_count }}
{{ if .Values.antennas.stream_url }}
stream_url: {{ .Values.antennas.stream_url }}
{{ end }}

View File

@@ -0,0 +1,50 @@
#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
#
image:
# -- image repository
repository: thejf/antennas
# -- image tag
tag: 4.2.0
# -- image pull policy
pullPolicy: IfNotPresent
# -- environment variables. See more environment variables in the [antennas documentation](https://github.com/jfarseneau/antennas).
# @default -- See below
env: {}
# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
main:
ports:
http:
port: 5004
ingress:
# -- Enable and configure ingress settings for the chart under this key.
# @default -- See values.yaml
main:
enabled: false
# -- Enable Antennas to be discoverable via SSDP
hostNetwork: false
# -- When hostNetwork is true set dnsPolicy to ClusterFirstWithHostNet
dnsPolicy: # ClusterFirstWithHostNet
# -- Antennas configuration options. See more environment variables in the [antennas documentation](https://github.com/jfarseneau/antennas).
# @default -- See below
antennas:
# -- URL of the TVHeadend instance.
tvheadend_url:
# -- Optional stream URL, used for situations where the internal and external URL for TVHeadend is different.
stream_url:
# -- Number of tuners to present to Plex
tuner_count: 4
# -- Externally accessible URL for this antennas instance, defaults to the main service http port.
antennas_url:

View File

@@ -1,15 +0,0 @@
apiVersion: v1
appVersion: 0.6.6-ls58
description: A simple web viewer for Calibre libraries
name: calibre-web
version: 1.1.3
keywords:
- calibre-web
- calibre
home: https://github.com/janeczku/calibre-web
icon: https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/calibre-web-icon.png
sources:
- https://hub.docker.com/r/linuxserver/calibre-web/
maintainers:
- name: nikdoof
email: andy@tensixtyone.com

View File

@@ -1,4 +0,0 @@
approvers:
- nikdoof
reviewers:
- nikdoof

View File

@@ -1,105 +0,0 @@
# calibre-web
This is a helm chart for [calibre-web](https://calibre-web.com/) leveraging the [Linuxserver.io image](https://hub.docker.com/r/linuxserver/calibre-web/). This Chart is heavily based on the format used by [billimek](https://github.com/billimek/) for his collection of media related [charts](https://github.com/billimek/billimek-charts/).
## TL;DR;
```shell
$ helm repo add nikdoof https://nikdoof.github.io/helm-charts/
$ helm install calibre-web
```
## Installing the Chart
To install the chart with the release name `my-release`:
```console
helm install --name my-release calibre-web
```
## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```console
helm delete my-release --purge
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
## Configuration
The following tables lists the configurable parameters of the Sentry chart and their default values.
| Parameter | Description | Default |
|----------------------------|-------------------------------------|---------------------------------------------------------|
| `image.repository` | Image repository | `linuxserver/calibre-web` |
| `image.tag` | Image tag. Possible values listed [here](https://hub.docker.com/r/linuxserver/calibre-web/tags/).| `v2.1.39-ls32`|
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
| `timezone` | Timezone the calibre-web instance should run as, e.g. 'America/New_York' | `UTC` |
| `puid` | process userID the calibre-web instance should run as | `1001` |
| `pgid` | process groupID the calibre-web instance should run as | `1001` |
`dockerMods` | Enable "Docker Mods" for the Calibre-Web container | `nil` |
| `probes.liveness.initialDelaySeconds` | Specify liveness `initialDelaySeconds` parameter for the deployment | `60` |
| `probes.liveness.failureThreshold` | Specify liveness `failureThreshold` parameter for the deployment | `5` |
| `probes.liveness.timeoutSeconds` | Specify liveness `timeoutSeconds` parameter for the deployment | `10` |
| `probes.readiness.initialDelaySeconds` | Specify readiness `initialDelaySeconds` parameter for the deployment | `60` |
| `probes.readiness.failureThreshold` | Specify readiness `failureThreshold` parameter for the deployment | `5` |
| `probes.readiness.timeoutSeconds` | Specify readiness `timeoutSeconds` parameter for the deployment | `10` |
| `Service.type` | Kubernetes service type for the calibre-web GUI | `ClusterIP` |
| `Service.port` | Kubernetes port where the calibre-web GUI is exposed| `8083` |
| `Service.annotations` | Service annotations for the calibre-web GUI | `{}` |
| `Service.labels` | Custom labels | `{}` |
| `Service.loadBalancerIP` | Loadbalance IP for the calibre-web GUI | `{}` |
| `Service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None
| `ingress.enabled` | Enables Ingress | `false` |
| `ingress.annotations` | Ingress annotations | `{}` |
| `ingress.labels` | Custom labels | `{}`
| `ingress.path` | Ingress path | `/` |
| `ingress.hosts` | Ingress accepted hostnames | `chart-example.local` |
| `ingress.tls` | Ingress TLS configuration | `[]` |
| `persistence.config.enabled` | Use persistent volume to store configuration data | `true` |
| `persistence.config.size` | Size of persistent volume claim | `1Gi` |
| `persistence.config.existingClaim`| Use an existing PVC to persist data | `nil` |
| `persistence.config.subPath` | Mount a sub directory of the persistent volume if set | `""` |
| `persistence.config.storageClass` | Type of persistent volume claim | `-` |
| `persistence.config.accessMode` | Persistence access mode | `ReadWriteOnce` |
| `persistence.config.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` |
| `persistence.books.enabled` | Use persistent volume to store books | `true` |
| `persistence.books.size` | Size of persistent volume claim | `1Gi` |
| `persistence.books.existingClaim`| Use an existing PVC to persist data | `nil` |
| `persistence.books.subPath` | Mount a sub directory of the persistent volume if set | `""` |
| `persistence.books.storageClass` | Type of persistent volume claim | `-` |
| `persistence.books.accessMode` | Persistence access mode | `ReadWriteOnce` |
| `persistence.books.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` |
| `persistence.extraExistingClaimMounts` | Optionally add multiple existing claims to the container | `[]` |
| `resources` | CPU/Memory resource requests/limits | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | Toleration labels for pod assignment | `[]` |
| `affinity` | Affinity settings for pod assignment | `{}` |
| `podAnnotations` | Key-value pairs to add as pod annotations | `{}` |
| `deploymentAnnotations` | Key-value pairs to add as deployment annotations | `{}` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```console
helm install --name my-release \
--set timezone="America/New York" \
./calibre-web
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
```console
helm install --name my-release -f values.yaml ./calibre-web
```
---
**NOTE**
If you get `Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: ...` it may be because you uninstalled the chart with `skipuninstall` enabled, you need to manually delete the pvc or use `existingClaim`.
---
Read through the [values.yaml](https://github.com/nikdoof/helm-charts/tree/master/charts/calibre-web/values.yaml) file. It has several commented out suggested values.

View File

@@ -1,19 +0,0 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "calibre-web.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.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 "calibre-web.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "calibre-web.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "calibre-web.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8083 to use your application"
kubectl port-forward $POD_NAME 8083:80
{{- end }}

View File

@@ -1,32 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "calibre-web.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 "calibre-web.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 "calibre-web.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@@ -1,28 +0,0 @@
{{- if and .Values.persistence.books.enabled (not .Values.persistence.books.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "calibre-web.fullname" . }}-books
{{- if .Values.persistence.books.skipuninstall }}
annotations:
"helm.sh/resource-policy": keep
{{- end }}
labels:
app.kubernetes.io/name: {{ include "calibre-web.name" . }}
helm.sh/chart: {{ include "calibre-web.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
accessModes:
- {{ .Values.persistence.books.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.books.size | quote }}
{{- if .Values.persistence.books.storageClass }}
{{- if (eq "-" .Values.persistence.books.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.books.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -1,29 +0,0 @@
{{- if and .Values.persistence.config.enabled (not .Values.persistence.config.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "calibre-web.fullname" . }}-config
{{- if .Values.persistence.config.skipuninstall }}
annotations:
"helm.sh/resource-policy": keep
{{- end }}
labels:
app.kubernetes.io/name: {{ include "calibre-web.name" . }}
helm.sh/chart: {{ include "calibre-web.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
accessModes:
- {{ .Values.persistence.config.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.config.size | quote }}
{{- if .Values.persistence.config.storageClass }}
{{- if (eq "-" .Values.persistence.config.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.config.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -1,117 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "calibre-web.fullname" . }}
{{- if .Values.deploymentAnnotations }}
annotations:
{{- range $key, $value := .Values.deploymentAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "calibre-web.name" . }}
helm.sh/chart: {{ include "calibre-web.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: 1
revisionHistoryLimit: 3
strategy:
type: {{ .Values.strategyType }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "calibre-web.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "calibre-web.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.podAnnotations }}
annotations:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8083
protocol: TCP
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
env:
- name: TZ
value: "{{ .Values.timezone }}"
- name: PUID
value: "{{ .Values.puid }}"
- name: PGID
value: "{{ .Values.pgid }}"
{{- if .Values.dockerMods }}
- name: DOCKER_MODS
value: {{ .Values.dockerMods }}
{{- end }}
volumeMounts:
- mountPath: /config
name: config
{{- if .Values.persistence.config.subPath }}
subPath: "{{ .Values.persistence.config.subPath }}"
{{- end }}
- mountPath: /books
name: books
{{- if .Values.persistence.books.subPath }}
subPath: {{ .Values.persistence.books.subPath }}
{{- end }}
{{- range .Values.persistence.extraExistingClaimMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
readOnly: {{ .readOnly }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
volumes:
- name: config
{{- if .Values.persistence.config.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.config.existingClaim }}{{ .Values.persistence.config.existingClaim }}{{- else }}{{ template "calibre-web.fullname" . }}-config{{- end }}
{{- else }}
emptyDir: {}
{{ end }}
- name: books
{{- if .Values.persistence.books.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.books.existingClaim }}{{ .Values.persistence.books.existingClaim }}{{- else }}{{ template "calibre-web.fullname" . }}-books{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- range .Values.persistence.extraExistingClaimMounts }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ .existingClaim }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

View File

@@ -1,38 +0,0 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "calibre-web.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "calibre-web.name" . }}
helm.sh/chart: {{ include "calibre-web.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}

View File

@@ -1,53 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "calibre-web.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "calibre-web.name" . }}
helm.sh/chart: {{ include "calibre-web.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
{{- with .Values.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }}
type: ClusterIP
{{- if .Values.service.clusterIP }}
clusterIP: {{ .Values.service.clusterIP }}
{{end}}
{{- else if eq .Values.service.type "LoadBalancer" }}
type: {{ .Values.service.type }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.service.type }}
{{- end }}
{{- if .Values.service.externalIPs }}
externalIPs:
{{ toYaml .Values.service.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
{{- end }}
ports:
- name: http
port: {{ .Values.service.port }}
protocol: TCP
targetPort: http
{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{.Values.service.nodePort}}
{{ end }}
selector:
app.kubernetes.io/name: {{ include "calibre-web.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

View File

@@ -1,140 +0,0 @@
# Default values for calibre-web.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
image:
repository: linuxserver/calibre-web
tag: 0.6.6-ls58
pullPolicy: IfNotPresent
# upgrade strategy type (e.g. Recreate or RollingUpdate)
strategyType: Recreate
# Probes configuration
probes:
liveness:
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 10
readiness:
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 10
nameOverride: ""
fullnameOverride: ""
timezone: UTC
puid: 1001
pgid: 1001
## Configure docker_mods for this container. For x86 systems you can uncomment the following
## and enable ebook conversion tools in calbire-web
##
# dockerMods: linuxserver/calibre-web:calibre
service:
type: ClusterIP
port: 8083
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort:
## Provide any additional annotations which may be required. This can be used to
## set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
annotations: {}
labels: {}
## Use loadBalancerIP to request a specific static IP,
## otherwise leave blank
##
loadBalancerIP:
# loadBalancerSourceRanges: []
## Set the externalTrafficPolicy in the Service to either Cluster or Local
# externalTrafficPolicy: Cluster
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
persistence:
config:
enabled: true
## calibre-web configuration data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
##
## If you want to reuse an existing claim, you can pass the name of the PVC using
## the existingClaim variable
# existingClaim: your-claim
accessMode: ReadWriteOnce
size: 1Gi
## If subPath is set mount a sub folder of a volume instead of the root of the volume.
## This is especially handy for volume plugins that don't natively support sub mounting (like glusterfs).
##
subPath: ""
## Do not delete the pvc upon helm uninstall
skipuninstall: false
books:
enabled: true
## Directory where movies are persisted
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
##
## If you want to reuse an existing claim, you can pass the name of the PVC using
## the existingClaim variable
# existingClaim: your-claim
# subPath: some-subpath
accessMode: ReadWriteOnce
size: 10Gi
## Do not delete the pvc upon helm uninstall
skipuninstall: false
extraExistingClaimMounts: []
# - name: external-mount
# mountPath: /srv/external-mount
## A manually managed Persistent Volume and Claim
## If defined, PVC must be created manually before volume will be bound
# existingClaim:
# readOnly: true
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: {}
podAnnotations: {}
deploymentAnnotations: {}

View File

@@ -20,3 +20,7 @@
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl

View 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

View File

@@ -0,0 +1,2 @@
---
{{ include "common.all" . }}

28
charts/common/.helmignore Normal file
View File

@@ -0,0 +1,28 @@
# 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/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl
# Test files
tests/

11
charts/common/Chart.yaml Normal file
View 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

View 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 -}}

View 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 }}

View 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 }}

View 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 }}

View 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 -}}

View 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 -}}

View File

@@ -0,0 +1,19 @@
{{- define "common.prometheusRule" }}
---
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:
{{- with .Values.metrics.prometheusRule.rules }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

View 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 }}

View 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 }}

View 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 -}}

View 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 }}

View File

@@ -0,0 +1,25 @@
{{- define "common.serviceMonitor" }}
---
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 }}

View 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 }}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 -}}

View 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 }}

View 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 }}

View 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 -}}

View 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 }}

View 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 -}}

Some files were not shown because too many files have changed in this diff Show More