From f42a16765326c7804f1ab1783c28a600dd8f795b Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Sun, 4 Jan 2026 23:49:05 +0100 Subject: [PATCH] add scanopy --- apps/charts/scanopy/Chart.yaml | 7 + .../scanopy/templates/daemon-deployment.yaml | 158 ++++++++++++++++++ .../scanopy/templates/daemon-service.yaml | 26 +++ apps/charts/scanopy/templates/database.yaml | 1 + apps/charts/scanopy/templates/deployment.yaml | 1 + apps/charts/scanopy/templates/pvc.yaml | 1 + apps/charts/scanopy/templates/service.yaml | 1 + .../scanopy/templates/virtual-service.yaml | 1 + apps/charts/scanopy/values.yaml | 116 +++++++++++++ apps/charts/zot/templates/deployment.yaml | 1 - 10 files changed, 312 insertions(+), 1 deletion(-) create mode 100644 apps/charts/scanopy/Chart.yaml create mode 100644 apps/charts/scanopy/templates/daemon-deployment.yaml create mode 100644 apps/charts/scanopy/templates/daemon-service.yaml create mode 100644 apps/charts/scanopy/templates/database.yaml create mode 100644 apps/charts/scanopy/templates/deployment.yaml create mode 100644 apps/charts/scanopy/templates/pvc.yaml create mode 100644 apps/charts/scanopy/templates/service.yaml create mode 100644 apps/charts/scanopy/templates/virtual-service.yaml create mode 100644 apps/charts/scanopy/values.yaml diff --git a/apps/charts/scanopy/Chart.yaml b/apps/charts/scanopy/Chart.yaml new file mode 100644 index 0000000..afa8184 --- /dev/null +++ b/apps/charts/scanopy/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +version: 1.0.0 +name: scanopy +dependencies: + - name: common + version: 1.0.0 + repository: file://../../common diff --git a/apps/charts/scanopy/templates/daemon-deployment.yaml b/apps/charts/scanopy/templates/daemon-deployment.yaml new file mode 100644 index 0000000..37213ce --- /dev/null +++ b/apps/charts/scanopy/templates/daemon-deployment.yaml @@ -0,0 +1,158 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-daemon + labels: + {{- include "common.labels" . | nindent 4 }} + component: daemon +spec: + strategy: + type: {{ .Values.daemon.deployment.strategy | default "Recreate" }} + replicas: {{ .Values.daemon.deployment.replicas | default 1 }} + {{- if .Values.daemon.deployment.revisionHistoryLimit }} + revisionHistoryLimit: {{ .Values.daemon.deployment.revisionHistoryLimit }} + {{- end }} + selector: + matchLabels: + {{- include "common.selectorLabels" . | nindent 6 }} + component: daemon + template: + metadata: + labels: + {{- include "common.selectorLabels" . | nindent 8 }} + component: daemon + spec: + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet + containers: + - name: daemon + image: "{{ .Values.daemon.image.repository }}:{{ .Values.daemon.image.tag }}" + imagePullPolicy: {{ .Values.daemon.image.pullPolicy | default "IfNotPresent" }} + ports: + {{- if .Values.daemon.container.ports }} + {{- range .Values.daemon.container.ports }} + - name: {{ .name }} + containerPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} + {{- else if .Values.daemon.container.port }} + - name: http + containerPort: {{ .Values.daemon.container.port }} + protocol: TCP + {{- end }} + {{- if .Values.daemon.container.healthProbe }} + livenessProbe: + {{- if eq .Values.daemon.container.healthProbe.type "httpGet" }} + httpGet: + path: {{ .Values.daemon.container.healthProbe.path }} + port: {{ .Values.daemon.container.healthProbe.port }} + {{- else if eq .Values.daemon.container.healthProbe.type "tcpSocket" }} + tcpSocket: + port: {{ .Values.daemon.container.healthProbe.port }} + {{- end }} + {{- if .Values.daemon.container.healthProbe.initialDelaySeconds }} + initialDelaySeconds: {{ .Values.daemon.container.healthProbe.initialDelaySeconds }} + {{- end }} + {{- if .Values.daemon.container.healthProbe.periodSeconds }} + periodSeconds: {{ .Values.daemon.container.healthProbe.periodSeconds }} + {{- else }} + periodSeconds: 5 + {{- end }} + {{- if .Values.daemon.container.healthProbe.timeoutSeconds }} + timeoutSeconds: {{ .Values.daemon.container.healthProbe.timeoutSeconds }} + {{- else }} + timeoutSeconds: 3 + {{- end }} + {{- if .Values.daemon.container.healthProbe.failureThreshold }} + failureThreshold: {{ .Values.daemon.container.healthProbe.failureThreshold }} + {{- else }} + failureThreshold: 15 + {{- end }} + readinessProbe: + {{- if eq .Values.daemon.container.healthProbe.type "httpGet" }} + httpGet: + path: {{ .Values.daemon.container.healthProbe.path }} + port: {{ .Values.daemon.container.healthProbe.port }} + {{- else if eq .Values.daemon.container.healthProbe.type "tcpSocket" }} + tcpSocket: + port: {{ .Values.daemon.container.healthProbe.port }} + {{- end }} + {{- if .Values.daemon.container.healthProbe.initialDelaySeconds }} + initialDelaySeconds: {{ .Values.daemon.container.healthProbe.initialDelaySeconds }} + {{- end }} + {{- if .Values.daemon.container.healthProbe.periodSeconds }} + periodSeconds: {{ .Values.daemon.container.healthProbe.periodSeconds }} + {{- else }} + periodSeconds: 5 + {{- end }} + {{- if .Values.daemon.container.healthProbe.timeoutSeconds }} + timeoutSeconds: {{ .Values.daemon.container.healthProbe.timeoutSeconds }} + {{- else }} + timeoutSeconds: 3 + {{- end }} + {{- if .Values.daemon.container.healthProbe.failureThreshold }} + failureThreshold: {{ .Values.daemon.container.healthProbe.failureThreshold }} + {{- else }} + failureThreshold: 15 + {{- end }} + {{- end }} + {{- if .Values.daemon.container.securityContext }} + securityContext: + {{- toYaml .Values.daemon.container.securityContext | nindent 12 }} + {{- end }} + {{- if .Values.daemon.volumes }} + volumeMounts: + {{- range .Values.daemon.volumes }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- if .readOnly }} + readOnly: {{ .readOnly }} + {{- end }} + {{- end }} + {{- end }} + env: + {{- if .Values.daemon.env }} + {{- range $key, $value := .Values.daemon.env }} + - name: {{ $key }} + {{- if kindIs "map" $value }} + {{- if $value.value }} + value: {{ $value.value | replace "{release}" $.Release.Name | replace "{namespace}" $.Release.Namespace | replace "{subdomain}" $.Values.subdomain | replace "{domain}" $.Values.globals.domain | replace "{timezone}" $.Values.globals.timezone }} + {{- else if $value.valueFrom }} + valueFrom: + {{- if $value.valueFrom.secretKeyRef }} + secretKeyRef: + name: {{ $value.valueFrom.secretKeyRef.name | replace "{release}" $.Release.Name }} + key: {{ $value.valueFrom.secretKeyRef.key }} + {{- end }} + {{- end }} + {{- else }} + value: {{ $value | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.globals.timezone }} + - name: TZ + value: {{ .Values.globals.timezone | quote }} + {{- end }} + {{- if .Values.daemon.volumes }} + volumes: + {{- range .Values.daemon.volumes }} + - name: {{ .name }} + {{- if .persistentVolumeClaim }} + persistentVolumeClaim: + {{- if or (eq .persistentVolumeClaim "config") (eq .persistentVolumeClaim "metadata") (eq .persistentVolumeClaim "data") (eq .persistentVolumeClaim "daemon-config") }} + claimName: {{ $.Release.Name }}-{{ .persistentVolumeClaim }} + {{- else }} + claimName: {{ .persistentVolumeClaim }} + {{- end }} + {{- else if .hostPath }} + hostPath: + path: {{ .hostPath.path }} + {{- if .hostPath.type }} + type: {{ .hostPath.type }} + {{- end }} + {{- else if .emptyDir }} + emptyDir: {} + {{- end }} + {{- end }} + {{- end }} diff --git a/apps/charts/scanopy/templates/daemon-service.yaml b/apps/charts/scanopy/templates/daemon-service.yaml new file mode 100644 index 0000000..9944f24 --- /dev/null +++ b/apps/charts/scanopy/templates/daemon-service.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-daemon + labels: + {{- include "common.labels" . | nindent 4 }} + component: daemon +spec: + type: {{ .Values.daemon.service.type | default "ClusterIP" }} + ports: + {{- if .Values.daemon.service.ports }} + {{- range .Values.daemon.service.ports }} + - name: {{ .name }} + port: {{ .port }} + targetPort: {{ .targetPort | default .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} + {{- else if .Values.daemon.service.port }} + - name: http + port: {{ .Values.daemon.service.port }} + targetPort: {{ .Values.daemon.service.targetPort | default .Values.daemon.service.port }} + protocol: TCP + {{- end }} + selector: + {{- include "common.selectorLabels" . | nindent 4 }} + component: daemon diff --git a/apps/charts/scanopy/templates/database.yaml b/apps/charts/scanopy/templates/database.yaml new file mode 100644 index 0000000..8a7fad4 --- /dev/null +++ b/apps/charts/scanopy/templates/database.yaml @@ -0,0 +1 @@ +{{ include "common.database" . }} diff --git a/apps/charts/scanopy/templates/deployment.yaml b/apps/charts/scanopy/templates/deployment.yaml new file mode 100644 index 0000000..4508e33 --- /dev/null +++ b/apps/charts/scanopy/templates/deployment.yaml @@ -0,0 +1 @@ +{{ include "common.deployment" . }} diff --git a/apps/charts/scanopy/templates/pvc.yaml b/apps/charts/scanopy/templates/pvc.yaml new file mode 100644 index 0000000..379bad9 --- /dev/null +++ b/apps/charts/scanopy/templates/pvc.yaml @@ -0,0 +1 @@ +{{ include "common.pvc" . }} diff --git a/apps/charts/scanopy/templates/service.yaml b/apps/charts/scanopy/templates/service.yaml new file mode 100644 index 0000000..f024c64 --- /dev/null +++ b/apps/charts/scanopy/templates/service.yaml @@ -0,0 +1 @@ +{{ include "common.service" . }} diff --git a/apps/charts/scanopy/templates/virtual-service.yaml b/apps/charts/scanopy/templates/virtual-service.yaml new file mode 100644 index 0000000..766f6b9 --- /dev/null +++ b/apps/charts/scanopy/templates/virtual-service.yaml @@ -0,0 +1 @@ +{{ include "common.virtualService" . }} diff --git a/apps/charts/scanopy/values.yaml b/apps/charts/scanopy/values.yaml new file mode 100644 index 0000000..ec4c1d5 --- /dev/null +++ b/apps/charts/scanopy/values.yaml @@ -0,0 +1,116 @@ +# Server image configuration +image: + repository: ghcr.io/scanopy/scanopy/server + tag: latest + pullPolicy: IfNotPresent + +subdomain: scanopy + +# Server deployment configuration +deployment: + strategy: Recreate + replicas: 1 + revisionHistoryLimit: 0 + +# Server container configuration +container: + ports: + - name: http + port: 60072 + protocol: TCP + healthProbe: + type: httpGet + path: /api/health + port: http + +# Service configuration +service: + ports: + - name: http + port: 80 + targetPort: 60072 + protocol: TCP + type: ClusterIP + +# Volume configuration +volumes: + - name: data + mountPath: /data + persistentVolumeClaim: data + +# Persistent volume claims +persistentVolumeClaims: + - name: data + size: 10Gi + - name: daemon-config + size: 1Gi + +# VirtualService configuration +virtualService: + enabled: true + gateways: + public: true + private: true + +# Database configuration +database: + enabled: true + +# Environment variables +env: + SCANOPY_LOG_LEVEL: info + SCANOPY_SERVER_PORT: "60072" + SCANOPY_DAEMON_PORT: "60073" + SCANOPY_WEB_EXTERNAL_PATH: /app/static + SCANOPY_PUBLIC_URL: + value: "https://{subdomain}.{domain}" + SCANOPY_DATABASE_URL: + valueFrom: + secretKeyRef: + name: "{release}-connection" + key: url + SCANOPY_INTEGRATED_DAEMON_URL: + value: "http://{release}-daemon.{namespace}.svc.cluster.local:60073" + +# Daemon configuration +daemon: + image: + repository: ghcr.io/scanopy/scanopy/daemon + tag: latest + pullPolicy: IfNotPresent + deployment: + strategy: Recreate + replicas: 1 + container: + ports: + - name: http + port: 60073 + protocol: TCP + healthProbe: + type: httpGet + path: /api/health + port: http + securityContext: + privileged: true + service: + ports: + - name: http + port: 60073 + targetPort: 60073 + protocol: TCP + type: ClusterIP + volumes: + - name: daemon-config + mountPath: /root/.config/daemon + persistentVolumeClaim: daemon-config + env: + SCANOPY_LOG_LEVEL: info + SCANOPY_SERVER_PORT: "60072" + SCANOPY_DAEMON_PORT: "60073" + SCANOPY_SERVER_URL: + value: "http://{release}.{namespace}.svc.cluster.local:80" + SCANOPY_PORT: "60073" + SCANOPY_BIND_ADDRESS: "0.0.0.0" + SCANOPY_NAME: scanopy-daemon + SCANOPY_HEARTBEAT_INTERVAL: "30" + SCANOPY_MODE: Push diff --git a/apps/charts/zot/templates/deployment.yaml b/apps/charts/zot/templates/deployment.yaml index 416c74a..8876cf0 100644 --- a/apps/charts/zot/templates/deployment.yaml +++ b/apps/charts/zot/templates/deployment.yaml @@ -7,7 +7,6 @@ metadata: app.kubernetes.io/app: "{{ .Release.Name }}" spec: replicas: 1 - revisionHistoryLimit: 0 strategy: type: Recreate selector: