Add Immich deployment
This commit is contained in:
54
apps/hydra/immich/deployment.yaml
Normal file
54
apps/hydra/immich/deployment.yaml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: immich
|
||||||
|
name: immich
|
||||||
|
namespace: immich
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: immich
|
||||||
|
strategy: {}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: immich
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: DB_DATABASE_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: db_username
|
||||||
|
name: immich-secret
|
||||||
|
- name: DB_HOSTNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: db_host
|
||||||
|
name: immich-secret
|
||||||
|
- name: DB_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: db_password
|
||||||
|
name: immich-secret
|
||||||
|
- name: DB_PORT
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: db_port
|
||||||
|
name: immich-secret
|
||||||
|
- name: DB_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: db_username
|
||||||
|
name: immich-secret
|
||||||
|
image: ghcr.io/immich-app/immich-server:v2.6.0:-release}
|
||||||
|
name: immich-server
|
||||||
|
ports:
|
||||||
|
- containerPort: 2283
|
||||||
|
resources: {}
|
||||||
|
volumes:
|
||||||
|
- name: upload
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: immich-pvc
|
||||||
|
status: {}
|
||||||
@@ -4,5 +4,6 @@ metadata:
|
|||||||
name: immich
|
name: immich
|
||||||
namespace: immich
|
namespace: immich
|
||||||
resources:
|
resources:
|
||||||
- uploads-pvc.yaml
|
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
|
- uploads-pvc.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ metadata:
|
|||||||
name: linking
|
name: linking
|
||||||
namespace: linkding
|
namespace: linkding
|
||||||
resources:
|
resources:
|
||||||
- namespace.yaml
|
|
||||||
- srv.yaml
|
- srv.yaml
|
||||||
- pvc.yaml
|
- pvc.yaml
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
|
- namespace.yaml
|
||||||
|
|||||||
@@ -4,16 +4,16 @@ metadata:
|
|||||||
name: truenas-csi
|
name: truenas-csi
|
||||||
namespace: truenas-csi
|
namespace: truenas-csi
|
||||||
resources:
|
resources:
|
||||||
- config.yaml
|
- CSIDriver.yaml
|
||||||
- nfs-storage-class.yaml
|
- nfs-storage-class.yaml
|
||||||
- controller-deployment.yaml
|
- controller-deployment.yaml
|
||||||
- controller-binding.yaml
|
- controller-binding.yaml
|
||||||
- node-cluster-role.yaml
|
- node-binding.yaml
|
||||||
- node-deamonset.yaml
|
- config.yaml
|
||||||
- CSIDriver.yaml
|
|
||||||
- iscsi-storage-class.yaml
|
- iscsi-storage-class.yaml
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- controller-service-account.yaml
|
- controller-service-account.yaml
|
||||||
- controller-cluster-role.yaml
|
- controller-cluster-role.yaml
|
||||||
- node-service-account.yaml
|
- node-service-account.yaml
|
||||||
- node-binding.yaml
|
- node-cluster-role.yaml
|
||||||
|
- node-deamonset.yaml
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"danicos.dev/daniel/go-kube/pkg/kube"
|
"danicos.dev/daniel/go-kube/pkg/kube"
|
||||||
"danicos.dev/daniel/go-kube/pkg/stack"
|
"danicos.dev/daniel/go-kube/pkg/stack"
|
||||||
"danicos.dev/daniel/homelab/pkg/root"
|
"danicos.dev/daniel/homelab/pkg/root"
|
||||||
|
apps "k8s.io/api/apps/v1"
|
||||||
core "k8s.io/api/core/v1"
|
core "k8s.io/api/core/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@ var uploads_pvc core.PersistentVolumeClaim
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
meta = kube.NewMetadata(root.Immich.Name, Namespace)
|
meta = kube.NewMetadata(root.Immich.Name, Namespace)
|
||||||
|
srv = meta.Service(root.Immich.Port)
|
||||||
uploads_pvc = meta.PVC()
|
uploads_pvc = meta.PVC()
|
||||||
uploads_pvc.Spec.StorageClassName = new(root.TrueNASSTorageClassNFS)
|
uploads_pvc.Spec.StorageClassName = new(root.TrueNASSTorageClassNFS)
|
||||||
uploads_pvc.Spec.AccessModes = []core.PersistentVolumeAccessMode{core.ReadWriteMany}
|
uploads_pvc.Spec.AccessModes = []core.PersistentVolumeAccessMode{core.ReadWriteMany}
|
||||||
@@ -41,7 +43,42 @@ func Stack() stack.Stack {
|
|||||||
map[string]any{
|
map[string]any{
|
||||||
"namespace": Namespace,
|
"namespace": Namespace,
|
||||||
"uploads-pvc": uploads_pvc,
|
"uploads-pvc": uploads_pvc,
|
||||||
|
// "redis": Redis(),
|
||||||
|
"deployment": Deployment(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return kz.Stack("immich")
|
return kz.Stack("immich")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Deployment() apps.Deployment {
|
||||||
|
uploadVol := kube.NewVolumeFrom(kube.VolumeSourcePVC, "upload", uploads_pvc.Name)
|
||||||
|
envMapping := map[string]string{}
|
||||||
|
secretMapping := map[string]string{
|
||||||
|
"DB_HOSTNAME": Secret.DBHostKey,
|
||||||
|
"DB_PORT": Secret.DBPortKey,
|
||||||
|
"DB_USERNAME": Secret.DBUsernameKey,
|
||||||
|
"DB_PASSWORD": Secret.DBPasswordKey,
|
||||||
|
"DB_DATABASE_NAME": Secret.DBUsernameKey,
|
||||||
|
}
|
||||||
|
podSpec := core.PodSpec{
|
||||||
|
Containers: []core.Container{
|
||||||
|
{
|
||||||
|
Name: root.Immich.Name + "-server",
|
||||||
|
Image: root.Immich.Image,
|
||||||
|
Env: kube.NewEnvVarWithSecret(envMapping, secretMapping, Secret.Name),
|
||||||
|
Ports: []core.ContainerPort{{ContainerPort: root.Immich.Port}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Volumes: []core.Volume{
|
||||||
|
// /etc/localtime
|
||||||
|
uploadVol,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return kube.NewDeployment(meta, podSpec)
|
||||||
|
}
|
||||||
|
|
||||||
|
func Redis() apps.Deployment {
|
||||||
|
meta := kube.NewMetadata(root.Immich.Name+"-redis", Namespace)
|
||||||
|
podSpec := core.PodSpec{}
|
||||||
|
return kube.NewDeployment(meta, podSpec)
|
||||||
|
}
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ var Linkding = Service{
|
|||||||
|
|
||||||
var Immich = Service{
|
var Immich = Service{
|
||||||
Name: "immich",
|
Name: "immich",
|
||||||
Image: "",
|
Image: "ghcr.io/immich-app/immich-server:v2.6.0:-release}",
|
||||||
|
Port: 2283,
|
||||||
// PublicURL: "https://photos.danicos.me",
|
// PublicURL: "https://photos.danicos.me",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user