Skip to content

Commit

Permalink
Merge pull request #9 from sanderv32/unifi-fixes
Browse files Browse the repository at this point in the history
unifi fixes
  • Loading branch information
sanderv32 authored Sep 7, 2024
2 parents fccf722 + f51c47d commit 246b121
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 43 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ jobs:
strategy:
matrix:
k8s:
- v1.27.10
- v1.28.6
- v1.29.1
- v1.28.13
- v1.29.8
- v1.30.4
- v1.31.0
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -69,9 +70,10 @@ jobs:
strategy:
matrix:
k8s:
- v1.27.0
- v1.28.0
- v1.29.0
- v1.28.13
- v1.29.8
- v1.30.4
- v1.31.0
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions charts/unifi-network-app/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
apiVersion: v2
name: unifi-network-app
description: A Helm chart for Kubernetes
description: A Helm chart for Unifi Network Application
icon: https://raw.githubusercontent.com/sanderv32/helm-charts/master/icons/ubiquity.svg
keywords:
- Unifi
- Controller
- Network
type: application
version: 0.1.1
appVersion: "8.3.32"
version: 0.2.0
appVersion: "8.4.59"
maintainers:
- name: sanderv32
email: [email protected]
26 changes: 13 additions & 13 deletions charts/unifi-network-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,34 @@ spec:
containers:
- env:
- name: MEM_LIMIT
value: "{{ .Values.memLimit | default "1024" }}"
value: "{{ .Values.memLimit }}"
- name: MEM_STARTUP
value: "{{ .Values.memStartup | default "1024" }}"
value: "{{ .Values.memStartup }}"
- name: MONGO_AUTHSOURCE
- name: MONGO_DBNAME
value: {{ .Values.unifi.db.name | default "unifi" }}
value: "{{ .Values.mongodb.db_name }}"
{{- if .Values.mongodb.enabled }}
- name: MONGO_HOST
value: {{ include "unifi-network-app.fullname" . }}-mongodb
# {{- else -}}
# - name: MONGO_HOST
# value: {{ .Values.unifi.db.host }}
{{- else -}}
- name: MONGO_HOST
value: "{{ .Values.mongodb.host }}"
{{- end }}
- name: MONGO_PASS
value: {{ .Values.unifi.db.password | default "unifi" }}
value: "{{ .Values.mongodb.db_password }}"
- name: MONGO_PORT
value: "{{ .Values.unifi.db.port | default "27017" }}"
value: "{{ .Values.mongodb.port }}"
- name: MONGO_TLS
- name: MONGO_USER
value: {{ .Values.unifi.db.user | default "unifi" }}
value: "{{ .Values.mongodb.db_user }}"
- name: PGID
value: "{{ .Values.unifi.pgid | default "1000" }}"
value: "{{ .Values.pgid }}"
- name: PUID
value: "{{ .Values.unifi.puid | default "1000" }}"
value: "{{ .Values.puid }}"
- name: TZ
value: {{ .Values.unifi.tz | default "Etc/UTC" }}
value: "{{ .Values.tz }}"

name: {{ .Chart.Name }}
name: "{{ .Chart.Name }}"
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/unifi-network-app/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "unifi-network-app.fullname" . -}}
{{- $svcPort := .Values.service.ports.admin.port -}}
{{- $svcPort := (index .Values.service.ports "https-admin").port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
Expand Down
4 changes: 2 additions & 2 deletions charts/unifi-network-app/templates/mongodb-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
labels: {{- include "unifi-network-app.labels" . | nindent 4 }}
data:
init-mongo.js: |-
db.getSiblingDB("{{ .Values.unifi.db.name }}").createUser({user: "{{ .Values.unifi.db.user }}", pwd: "{{ .Values.unifi.db.password }}", roles: [{role: "dbOwner", db: "{{ .Values.unifi.db.name }}"}]});
db.getSiblingDB("{{ .Values.unifi.db.name }}_stat").createUser({user: "{{ .Values.unifi.db.user }}", pwd: "{{ .Values.unifi.db.password }}", roles: [{role: "dbOwner", db: "{{ .Values.unifi.db.name }}_stat"}]});
db.getSiblingDB("{{ .Values.mongodb.db_name }}").createUser({user: "{{ .Values.mongodb.db_user }}", pwd: "{{ .Values.mongodb.db_password }}", roles: [{role: "dbOwner", db: "{{ .Values.mongodb.db_name }}"}]});
db.getSiblingDB("{{ .Values.mongodb.db_name }}_stat").createUser({user: "{{ .Values.mongodb.db_user }}", pwd: "{{ .Values.mongodb.db_password }}", roles: [{role: "dbOwner", db: "{{ .Values.mongodb.db_name }}_stat"}]});
{{- end }}
33 changes: 15 additions & 18 deletions charts/unifi-network-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

unifi:
db:
host: "unifi-mongodb"
port: 27017
name: "unifi"
user: "unifi"
password: "unifi"
memLimit: 1024
memStartup: 1024
puid: 1000
pgid: 1000
tz: "Etc/UTC"
memLimit: 1024
memStartup: 1024
puid: 1000
pgid: 1000
tz: "Etc/UTC"

mongodb:
enabled: true
db_name: "unifi-mongodb"
db_user: "unifi"
db_password: "unifi"
port: 27017
image:
repository: docker.io/mongo
Expand Down Expand Up @@ -58,10 +54,10 @@ securityContext: {}
service:
type: ClusterIP
ports:
admin:
https-admin:
port: 8443
proto: tcp
inform:
http-inform:
port: 8080
proto: tcp
stun:
Expand All @@ -73,10 +69,10 @@ service:
discovery-l2:
port: 1900
proto: udp
guestportal-https:
https-guestportal:
port: 8843
proto: tcp
guestportal-http:
http-guestportal:
port: 8880
proto: tcp
throughputtest:
Expand All @@ -87,7 +83,7 @@ service:
proto: udp

ingress:
enabled: false
enabled: true
className: ""
annotations: {}
hosts:
Expand All @@ -97,7 +93,8 @@ ingress:
pathType: ImplementationSpecific
tls: []

resources: {}
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
Expand Down
1 change: 1 addition & 0 deletions icons/ubiquiti.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 246b121

Please sign in to comment.