add scanopy

This commit is contained in:
Morten Olsen
2026-01-04 23:49:05 +01:00
parent a46edfee5d
commit f42a167653
10 changed files with 312 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
apiVersion: v2
version: 1.0.0
name: scanopy
dependencies:
- name: common
version: 1.0.0
repository: file://../../common

View File

@@ -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 }}

View File

@@ -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

View File

@@ -0,0 +1 @@
{{ include "common.database" . }}

View File

@@ -0,0 +1 @@
{{ include "common.deployment" . }}

View File

@@ -0,0 +1 @@
{{ include "common.pvc" . }}

View File

@@ -0,0 +1 @@
{{ include "common.service" . }}

View File

@@ -0,0 +1 @@
{{ include "common.virtualService" . }}

View File

@@ -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

View File

@@ -7,7 +7,6 @@ metadata:
app.kubernetes.io/app: "{{ .Release.Name }}" app.kubernetes.io/app: "{{ .Release.Name }}"
spec: spec:
replicas: 1 replicas: 1
revisionHistoryLimit: 0
strategy: strategy:
type: Recreate type: Recreate
selector: selector: