From 126a50b506dde320e08d7612557334c2f998cfbd Mon Sep 17 00:00:00 2001 From: bp99 Date: Sun, 25 Aug 2024 21:52:08 +0200 Subject: [PATCH] chart-unifi_network_application: add --- charts/unifi-network-application/.helmignore | 23 +++ charts/unifi-network-application/Chart.yaml | 18 +++ charts/unifi-network-application/LICENSE | 22 +++ charts/unifi-network-application/README.md | 62 +++++++ .../templates/_helpers.tpl | 72 +++++++++ .../templates/configmap.yaml | 24 +++ .../templates/deployment.yaml | 152 ++++++++++++++++++ .../templates/ingress.yaml | 45 ++++++ .../templates/pvc.yaml | 54 +++++++ .../templates/service.yaml | 86 ++++++++++ charts/unifi-network-application/values.yaml | 104 ++++++++++++ 11 files changed, 662 insertions(+) create mode 100644 charts/unifi-network-application/.helmignore create mode 100644 charts/unifi-network-application/Chart.yaml create mode 100644 charts/unifi-network-application/LICENSE create mode 100644 charts/unifi-network-application/README.md create mode 100644 charts/unifi-network-application/templates/_helpers.tpl create mode 100644 charts/unifi-network-application/templates/configmap.yaml create mode 100644 charts/unifi-network-application/templates/deployment.yaml create mode 100644 charts/unifi-network-application/templates/ingress.yaml create mode 100644 charts/unifi-network-application/templates/pvc.yaml create mode 100644 charts/unifi-network-application/templates/service.yaml create mode 100644 charts/unifi-network-application/values.yaml diff --git a/charts/unifi-network-application/.helmignore b/charts/unifi-network-application/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/unifi-network-application/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/unifi-network-application/Chart.yaml b/charts/unifi-network-application/Chart.yaml new file mode 100644 index 0000000..5e4d5cb --- /dev/null +++ b/charts/unifi-network-application/Chart.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: v2 +name: unifi-network-application +description: > + Unifi Controller application using linuxservers Docker image. This + chart was originally created by Balazs Petrikovics and is available at + https://github.com/bpetrikovics/unifi-network-application. The chart + was modified and improved by Bertalan Z. Péter for personal use. +home: https://ui.com +type: application +version: 0.1.0 +appVersion: 8.3.32-ls61 + + +maintainers: + - name: Bertalan Zoltán Péter + email: bertalan.peter@bp99.eu + url: https://bp99.eu diff --git a/charts/unifi-network-application/LICENSE b/charts/unifi-network-application/LICENSE new file mode 100644 index 0000000..904fb2c --- /dev/null +++ b/charts/unifi-network-application/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2024 Balázs Petrikovics +Copyright (c) 2024 Bertalan Zoltán Péter + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/charts/unifi-network-application/README.md b/charts/unifi-network-application/README.md new file mode 100644 index 0000000..f660797 --- /dev/null +++ b/charts/unifi-network-application/README.md @@ -0,0 +1,62 @@ +# unifi-network-application + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 8.3.32-ls61](https://img.shields.io/badge/AppVersion-8.3.32--ls61-informational?style=flat-square) + +Unifi Controller application using linuxservers Docker image. This chart was originally created by Balazs Petrikovics and is available at https://github.com/bpetrikovics/unifi-network-application. The chart was modified and improved by Bertalan Z. Péter for personal use. + +**Homepage:** + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Bertalan Zoltán Péter | | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| fullnameOverride | string | `""` | can be used to override the main app name; incorporates release name by default | +| global.storageClass | string | `""` | globally set the storage class for PVCs | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"linuxserver/unifi-network-application"` | | +| image.tag | string | `""` | overrides the image tag whose default is the chart appVersion | +| ingress.annotations | object | `{}` | | +| ingress.hostname | string | `"unifi.local"` | | +| ingress.redirect.annotations | object | `{}` | | +| ingress.redirect.enabled | bool | `true` | deploys an additional ingress for http to https redirection, if needed | +| mongodb.adminpassword | string | `""` | | +| mongodb.adminuser | string | `""` | | +| mongodb.cacheSizeGB | string | `"0.25"` | | +| mongodb.dbname | string | `"unifi"` | main database name | +| mongodb.dbname_stat | string | `"unifi_stat"` | stat database name | +| mongodb.image | string | `"mongo"` | image to pull and use; for arm64 (eg Raspberry Pi 4), use "arm64v8/mongo" | +| mongodb.imageTag | string | `"7.0"` | | +| mongodb.password | string | `""` | | +| mongodb.persistence.accessModes | object | `{}` | | +| mongodb.persistence.annotations | object | `{}` | | +| mongodb.persistence.claimSuffix | string | `"config-claim"` | suffix string that will be appended to fullname | +| mongodb.persistence.create | bool | `true` | whether to create PVCs | +| mongodb.persistence.enabled | bool | `true` | whether to deal with persistence at all | +| mongodb.persistence.labels | object | `{}` | | +| mongodb.persistence.size | string | `"128Mi"` | size limit for the PVC | +| mongodb.persistence.storageClass | string | `""` | override storage class | +| mongodb.persistence.volumeName | string | `""` | | +| mongodb.podSecurityContext | object | `{}` | | +| mongodb.username | string | `""` | credentials for "normal" and admin user; MUST BE SET! | +| nameOverride | string | `""` | | +| persistence.accessModes | object | `{}` | | +| persistence.annotations | object | `{}` | | +| persistence.claimSuffix | string | `"config-claim"` | suffix string that will be appended to fullname | +| persistence.create | bool | `true` | whether to create PVCs | +| persistence.enabled | bool | `true` | whether to deal with persistence at all | +| persistence.labels | object | `{}` | | +| persistence.size | string | `"128Mi"` | size limit for the PVC | +| persistence.storageClass | string | `""` | override storage class | +| persistence.volumeName | string | `""` | | +| replicaCount | int | `1` | how many app replicas to run; only ever tested with 1 | +| resources | object | `{}` | | +| service.annotations | object | `{}` | | +| service.loadBalancerIp | string | `nil` | | +| service.type | string | `nil` | | + diff --git a/charts/unifi-network-application/templates/_helpers.tpl b/charts/unifi-network-application/templates/_helpers.tpl new file mode 100644 index 0000000..427262d --- /dev/null +++ b/charts/unifi-network-application/templates/_helpers.tpl @@ -0,0 +1,72 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "template.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 "template.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 "template.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "template.labels" -}} +helm.sh/chart: {{ include "template.chart" . }} +{{ include "template.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "template.selectorLabels" -}} +app.kubernetes.io/name: {{ include "template.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "template.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "template.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Storage Class +*/}} +{{- define "template.persistence.storageClass" -}} +{{- $storageClass := (tpl ( default "" .Values.persistence.storageClass) .) | default (tpl ( default "" .Values.global.storageClass) .) }} +{{- if $storageClass }} +storageClassName: {{ $storageClass | quote }} +{{- end }} +{{- end -}} diff --git a/charts/unifi-network-application/templates/configmap.yaml b/charts/unifi-network-application/templates/configmap.yaml new file mode 100644 index 0000000..eaac60c --- /dev/null +++ b/charts/unifi-network-application/templates/configmap.yaml @@ -0,0 +1,24 @@ +--- +kind: ConfigMap +apiVersion: v1 +metadata: + name: {{ include "template.fullname" . }}-mongodb-init-sh +data: + init-mongo.sh: | + if which mongosh > /dev/null 2>&1; then + mongo_init_bin='mongosh' + else + mongo_init_bin='mongo' + fi + "${mongo_init_bin}" <