diff --git a/scrypted/Chart.yaml b/scrypted/Chart.yaml new file mode 100644 index 0000000..13a12f4 --- /dev/null +++ b/scrypted/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: scrypted +description: >- + Scrypted camera platform (HomeKit Secure Video bridge). Own chart: one + Deployment + Service + PVC + Ingress. TEST chart: the image tag is set in + values and is not auto-bumped (no version-source annotation on purpose). +type: application +version: 0.1.0 +appVersion: "0.148.5" diff --git a/scrypted/templates/deployment.yaml b/scrypted/templates/deployment.yaml new file mode 100644 index 0000000..a437ba3 --- /dev/null +++ b/scrypted/templates/deployment.yaml @@ -0,0 +1,76 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/component: camera-bridge +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + {{- if .Values.hostNetwork }} + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: https + containerPort: {{ .Values.httpsPort }} + protocol: TCP + env: + - name: TZ + value: {{ .Values.timezone | quote }} + {{- if .Values.hostNetwork }} + - name: SCRYPTED_DOCKER_AVAHI + value: "true" + {{- end }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + readinessProbe: + tcpSocket: + port: https + initialDelaySeconds: 30 + periodSeconds: 15 + timeoutSeconds: 5 + failureThreshold: 10 + volumeMounts: + {{- if .Values.persistence.enabled }} + - name: data + mountPath: /server/volume + {{- end }} + volumes: + {{- if .Values.persistence.enabled }} + - name: data + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim | default (printf "%s-data" .Release.Name) }} + {{- end }} diff --git a/scrypted/templates/pvc.yaml b/scrypted/templates/pvc.yaml new file mode 100644 index 0000000..37bc230 --- /dev/null +++ b/scrypted/templates/pvc.yaml @@ -0,0 +1,16 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-data + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + accessModes: + {{- toYaml .Values.persistence.accessModes | nindent 4 }} + storageClassName: {{ .Values.persistence.storageClass }} + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- end }} diff --git a/scrypted/templates/service.yaml b/scrypted/templates/service.yaml new file mode 100644 index 0000000..a0f6517 --- /dev/null +++ b/scrypted/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + type: {{ .Values.service.type }} + selector: + app: {{ .Release.Name }} + ports: + - name: https + port: {{ .Values.service.port }} + targetPort: https + protocol: TCP diff --git a/scrypted/values.yaml b/scrypted/values.yaml new file mode 100644 index 0000000..69a7966 --- /dev/null +++ b/scrypted/values.yaml @@ -0,0 +1,41 @@ +# Default values for the Scrypted Helm chart (test deployment) +image: + repository: ghcr.io/koush/scrypted + # Docker Hub / ghcr tags: v-noble-lite, -noble-full, ... + tag: "v0.148.5-noble-lite" + pullPolicy: IfNotPresent + +timezone: "Europe/Kyiv" + +# HomeKit (mDNS) needs the node LAN address. The chart runs Scrypted's own +# avahi (SCRYPTED_DOCKER_AVAHI) because the node has no avahi-daemon. +hostNetwork: true + +httpsPort: 10443 + +service: + type: ClusterIP + port: 10443 + +env: {} + +# /server/volume: Scrypted database, plugins, HomeKit pairing state +persistence: + enabled: true + existingClaim: "" + storageClass: local-path + accessModes: + - ReadWriteOnce + size: 5Gi + +resources: + requests: + cpu: "250m" + memory: "512Mi" + limits: + cpu: "4" + memory: "2Gi" + +nodeSelector: {} +tolerations: [] +affinity: {}