diff --git a/kube/clusters/biohazard/flux/kustomization.yaml b/kube/clusters/biohazard/flux/kustomization.yaml index 628a5dfc..ea32a830 100644 --- a/kube/clusters/biohazard/flux/kustomization.yaml +++ b/kube/clusters/biohazard/flux/kustomization.yaml @@ -140,6 +140,7 @@ resources: - ../../../deploy/apps/mlc-llm/ - ../../../deploy/apps/open-webui/ - ../../../deploy/apps/sillytavern/ + - ../../../deploy/apps/morphos/ - ../../../deploy/vm/_kubevirt/ #- ../../../deploy/vm/_base/ - ../../../deploy/vm/ad/ diff --git a/kube/deploy/apps/morphos/app/hr.yaml b/kube/deploy/apps/morphos/app/hr.yaml new file mode 100644 index 00000000..654cea4c --- /dev/null +++ b/kube/deploy/apps/morphos/app/hr.yaml @@ -0,0 +1,101 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.4.0/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: &app morphos + namespace: *app +spec: + interval: 5m + chart: + spec: + chart: app-template + version: 3.4.0 + sourceRef: + name: bjw-s + kind: HelmRepository + namespace: flux-system + values: + controllers: + morphos: + type: deployment + replicas: 1 + pod: + labels: + ingress.home.arpa/nginx-internal: allow + containers: + main: + image: &img + repository: ghcr.io/danvergara/morphos-server + tag: 0.6.0@sha256:3d6f64ef386cbb6a7c5d55526e1a69da2d3661a1996d757897e92bf4369088f5 + env: &env + TZ: "${CONFIG_TZ}" + securityContext: &sc + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + capabilities: + drop: ["ALL"] + resources: + requests: + cpu: "10m" + memory: "128Mi" + limits: + cpu: "3000m" + memory: "2Gi" + probes: + liveness: + enabled: true + readiness: + enabled: true + service: + morphos: + controller: morphos + ports: + http: + port: 8080 + protocol: HTTP + appProtocol: http + ingress: + main: + className: nginx-internal + hosts: + - host: &host "${APP_DNS_MORPHOS:=morphos}" + paths: &paths + - path: / + pathType: Prefix + service: + identifier: morphos + port: http + tls: + - hosts: [*host] + persistence: + tmp: + type: emptyDir + defaultPodOptions: + automountServiceAccountToken: false + enableServiceLinks: false + dnsConfig: + options: + - name: ndots + value: "1" + securityContext: + runAsNonRoot: true + runAsUser: &uid ${APP_UID_MORPHOS:=1000} + runAsGroup: *uid + fsGroup: *uid + fsGroupChangePolicy: Always + seccompProfile: { type: "RuntimeDefault" } + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: DoNotSchedule + labelSelector: + matchLabels: + app.kubernetes.io/name: *app + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: fuckoff.home.arpa/morphos + operator: DoesNotExist diff --git a/kube/deploy/apps/morphos/ks.yaml b/kube/deploy/apps/morphos/ks.yaml new file mode 100644 index 00000000..90bf6719 --- /dev/null +++ b/kube/deploy/apps/morphos/ks.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: morphos-app + namespace: flux-system + labels: &l + app.kubernetes.io/name: "morphos" +spec: + commonMetadata: + labels: *l + path: ./kube/deploy/apps/morphos/app + targetNamespace: "morphos" + dependsOn: [] diff --git a/kube/deploy/apps/morphos/kustomization.yaml b/kube/deploy/apps/morphos/kustomization.yaml new file mode 100644 index 00000000..5eeb2657 --- /dev/null +++ b/kube/deploy/apps/morphos/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ns.yaml + - ks.yaml diff --git a/kube/deploy/apps/morphos/ns.yaml b/kube/deploy/apps/morphos/ns.yaml new file mode 100644 index 00000000..ac4ea21c --- /dev/null +++ b/kube/deploy/apps/morphos/ns.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: morphos + labels: + kustomize.toolkit.fluxcd.io/prune: disabled + pod-security.kubernetes.io/enforce: &ps restricted + pod-security.kubernetes.io/audit: *ps + pod-security.kubernetes.io/warn: *ps