Skip to content

Commit

Permalink
Add homebridge to community train
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k committed Mar 16, 2023
1 parent 928a420 commit 6b208e9
Show file tree
Hide file tree
Showing 13 changed files with 308 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/ix-dev/community/homebridge/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: file://../../../common
version: 1.0.0
digest: sha256:f90dc95623b075f1d9ec4c4ba12464e2e789176ce7282a3aede37222201763b6
generated: "2023-03-16T16:56:09.526562427+02:00"
25 changes: 25 additions & 0 deletions library/ix-dev/community/homebridge/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: homebridge
description: Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API.
annotations:
title: Homebridge
type: application
version: 1.0.0
apiVersion: v2
appVersion: '2023-01-08'
kubeVersion: '>=1.16.0-0'
maintainers:
- name: truenas
url: https://www.truenas.com/
dependencies:
- name: common
repository: file://../../../common
version: 1.0.0
home: https://github.com/homebridge/homebridge
icon: https://raw.githubusercontent.com/homebridge/branding/master/logos/homebridge-color-round-stylized.png
sources:
- https://github.com/oznu/docker-homebridge
- https://github.com/truenas/charts/tree/master/library/ix-dev/community/homebridge
- https://github.com/homebridge/homebridge
keywords:
- homekit
- homebridge
4 changes: 4 additions & 0 deletions library/ix-dev/community/homebridge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Homebridge

- This container runs as `root` user.
- HostNetwork is always enabled.
4 changes: 4 additions & 0 deletions library/ix-dev/community/homebridge/app-readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Homebridge

- This container runs as `root` user.
- HostNetwork is always enabled.
Binary file not shown.
7 changes: 7 additions & 0 deletions library/ix-dev/community/homebridge/ci/basic-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
hbStorage:
data:
type: hostPath
hostPath: /mnt/{{ .Release.Name }}/data

hbNetwork:
webPort: 38000
4 changes: 4 additions & 0 deletions library/ix-dev/community/homebridge/item.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
icon: https://raw.githubusercontent.com/homebridge/branding/master/logos/homebridge-color-round-stylized.png
categories:
- homekit
- homebridge
135 changes: 135 additions & 0 deletions library/ix-dev/community/homebridge/questions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
groups:
- name: Homebridge Configuration
description: Configure Homebridge
- name: Network Configuration
description: Configure Network for Homebridge
- name: Storage Configuration
description: Configure Storage for Homebridge
- name: Resources Configuration
description: Configure Resources for Homebridge

questions:

- variable: TZ
group: Homebridge Configuration
label: Timezone
schema:
type: string
default: Etc/UTC
required: true
$ref:
- definitions/timezone

- variable: hbConfig
label: ""
group: Homebridge Configuration
schema:
type: dict
attrs:
- variable: enableAvahi
label: Enable Avahi
description: Enable Avahi for Homebridge.
schema:
type: boolean
default: true
- variable: additionalEnvs
label: Additional Environment Variables
description: Configure additional environment variables for Homebridge.
schema:
type: list
default: []
items:
- variable: env
label: Environment Variable
schema:
type: dict
attrs:
- variable: name
label: Name
schema:
type: string
required: true
- variable: value
label: Value
schema:
type: string
required: true

- variable: hbNetwork
group: Network Configuration
label: ""
schema:
type: dict
attrs:
- variable: webPort
label: Web UI Port
schema:
type: int
min: 9000
max: 65535
required: true
default: 30000

- variable: hbStorage
group: Storage Configuration
label: ""
schema:
type: dict
attrs:
- variable: data
label: Data
schema:
type: dict
attrs:
- variable: type
label: Type
schema:
type: string
default: ixVolume
required: true
enum:
- value: ixVolume
description: ixVolume
- value: hostPath
description: hostPath
- variable: hostPath
label: Host Path
schema:
type: hostpath
show_if: [["type", "=", "hostPath"]]
default: ""
- variable: datasetName
label: Dataset Name
schema:
type: string
default: data
show_if: [["type", "=", "ixVolume"]]
hidden: true
$ref:
- "normalize/ixVolume"

- variable: resources
label: ""
group: Resources Configuration
schema:
type: dict
attrs:
- variable: limits
label: Limits
schema:
type: dict
attrs:
- variable: cpu
label: CPU
description: CPU limit for qBittorrent.
schema:
type: string
default: 4000m
required: true
- variable: memory
label: Memory
description: Memory limit for qBittorrent.
schema:
type: string
default: 8Gi
required: true
1 change: 1 addition & 0 deletions library/ix-dev/community/homebridge/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "ix.v1.common.lib.chart.notes" $ }}
79 changes: 79 additions & 0 deletions library/ix-dev/community/homebridge/templates/_homebridge.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{{- define "homebridge.workload" -}}
workload:
homebridge:
enabled: true
primary: true
type: Deployment
podSpec:
hostNetwork: true
containers:
homebridge:
enabled: true
primary: true
imageSelector: image
securityContext:
runAsUser: 0
runAsGroup: 0
runAsNonRoot: false
readOnlyRootFilesystem: false
capabilities:
add:
- SETGID
- SETUID
drop:
- NET_ADMIN
- NET_RAW
- CHOWN
# - DAC_OVERRIDE
env:
HOMEBRIDGE_CONFIG_UI_PORT: {{ .Values.hbNetwork.webPort }}
ENABLE_AVAHI: {{ ternary "1" "0" .Values.hbConfig.enableAvahi | quote }}
{{ with .Values.hbConfig.additionalEnvs }}
{{ range $env := . }}
{{ $env.name }}: {{ $env.value }}
{{ end }}
{{ end }}
probes:
liveness:
enabled: true
type: http
port: {{ .Values.hbNetwork.webPort }}
path: /
readiness:
enabled: true
type: http
port: {{ .Values.hbNetwork.webPort }}
path: /
startup:
enabled: true
type: http
port: {{ .Values.hbNetwork.webPort }}
path: /

{{/* Service */}}
service:
homebridge:
enabled: true
primary: true
type: NodePort
targetSelector: homebridge
ports:
homebridge:
enabled: true
primary: true
port: {{ .Values.hbNetwork.webPort }}
nodePort: {{ .Values.hbNetwork.webPort }}
targetSelector: homebridge

{{/* Persistence */}}
persistence:
data:
enabled: true
type: {{ .Values.hbStorage.data.type }}
datasetName: {{ .Values.hbStorage.data.datasetName | default "" }}
hostPath: {{ .Values.hbStorage.data.hostPath | default "" }}
targetSelector:
homebridge:
homebridge:
mountPath: /homebridge
{{- end -}}
12 changes: 12 additions & 0 deletions library/ix-dev/community/homebridge/templates/_portal.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- define "homebridge.portal" -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: portal
data:
path: "/"
port: {{ .Values.hbNetwork.webPort | quote }}
protocol: http
host: $node_ip
{{- end -}}
9 changes: 9 additions & 0 deletions library/ix-dev/community/homebridge/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- include "ix.v1.common.loader.init" . -}}

{{/* Merge the templates with Values */}}
{{- $_ := mustMergeOverwrite .Values (include "homebridge.workload" $ | fromYaml) -}}

{{/* Create the configmap for portal manually*/}}
{{- include "homebridge.portal" $ -}}

{{- include "ix.v1.common.loader.apply" . -}}
22 changes: 22 additions & 0 deletions library/ix-dev/community/homebridge/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
image:
repository: oznu/homebridge
tag: "2023-01-08"
pullPolicy: IfNotPresent

resources:
limits:
cpu: 4000m
memory: 8Gi

hbStorage:
data:
type: ixVolume
hostPath: ""
datasetName: data

hbNetwork:
webPort: 30000

hbConfig:
enableAvahi: true
additionalEnvs: []

0 comments on commit 6b208e9

Please sign in to comment.