diff --git a/argocd-apps/homelab.yaml b/argocd-apps/homelab.yaml index 94a993f..9428d67 100644 --- a/argocd-apps/homelab.yaml +++ b/argocd-apps/homelab.yaml @@ -811,4 +811,26 @@ spec: syncOptions: - CreateNamespace=true - PruneLast=true +--- +# zipline +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: zipline + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: homelab + source: + repoURL: https://gitea.dooplex.hu/admin/homelab-manifests.git + targetRevision: main + path: zipline-system + destination: + server: https://kubernetes.default.svc + namespace: zipline-system + syncPolicy: + syncOptions: + - CreateNamespace=true + - PruneLast=true --- \ No newline at end of file diff --git a/yamls/longhorn-storageclasses.yaml b/yamls/longhorn-storageclasses.yaml new file mode 100644 index 0000000..7a5b552 --- /dev/null +++ b/yamls/longhorn-storageclasses.yaml @@ -0,0 +1,39 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: longhorn-ssd2 +provisioner: driver.longhorn.io +allowVolumeExpansion: true +reclaimPolicy: Delete +volumeBindingMode: Immediate +parameters: + backupTargetName: default + dataEngine: v1 + dataLocality: disabled + disableRevisionCounter: 'true' + fromBackup: '' + fsType: ext4 + numberOfReplicas: '1' + staleReplicaTimeout: '30' + unmapMarkSnapChainRemoved: ignored + diskSelector: ssd2 +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: longhorn-hdd +provisioner: driver.longhorn.io +allowVolumeExpansion: true +reclaimPolicy: Delete +volumeBindingMode: Immediate +parameters: + backupTargetName: default + dataEngine: v1 + dataLocality: disabled + disableRevisionCounter: 'true' + fromBackup: '' + fsType: ext4 + numberOfReplicas: '1' + staleReplicaTimeout: '30' + unmapMarkSnapChainRemoved: ignored + diskSelector: hdd \ No newline at end of file diff --git a/zipline-system/zipline.yaml b/zipline-system/zipline.yaml new file mode 100644 index 0000000..f152b73 --- /dev/null +++ b/zipline-system/zipline.yaml @@ -0,0 +1,141 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: zipline-system +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: zipline-config + namespace: zipline-system +data: + CORE_DEFAULT_DOMAIN: "zipline.dooplex.hu" + CORE_RETURN_HTTPS_URLS: "true" + CORE_TRUST_PROXY: "true" + DATASOURCE_TYPE: "local" + DATASOURCE_LOCAL_DIRECTORY: "/zipline/uploads" + FEATURES_OAUTH_REGISTRATION: "true" + FEATURES_USER_REGISTRATION: "false" + OAUTH_BYPASS_LOCAL_LOGIN: "true" + OAUTH_LOGIN_ONLY: "true" + OAUTH_OIDC_AUTHORIZE_URL: "https://authentik.dooplex.hu/application/o/authorize/" + OAUTH_OIDC_TOKEN_URL: "https://authentik.dooplex.hu/application/o/token/" + OAUTH_OIDC_USERINFO_URL: "https://authentik.dooplex.hu/application/o/userinfo/" + OAUTH_OIDC_REDIRECT_URI: "https://zipline.dooplex.hu/api/auth/oauth/oidc" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: zipline-data + namespace: zipline-system + labels: + recurring-job-group.longhorn.io/needbackup: enabled + recurring-job.longhorn.io/source: enabled +spec: + accessModes: + - ReadWriteOnce + storageClassName: longhorn-hdd + resources: + requests: + storage: 10Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: zipline + namespace: zipline-system +spec: + replicas: 1 + selector: + matchLabels: + app: zipline + template: + metadata: + labels: + app: zipline + spec: + containers: + - name: zipline + image: ghcr.io/diced/zipline:latest + ports: + - containerPort: 3000 + envFrom: + - configMapRef: + name: zipline-config + env: + - name: CORE_SECRET + valueFrom: + secretKeyRef: + name: zipline-secrets + key: CORE_SECRET + - name: OAUTH_OIDC_CLIENT_ID + valueFrom: + secretKeyRef: + name: zipline-secrets + key: OAUTH_OIDC_CLIENT_ID + - name: OAUTH_OIDC_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: zipline-secrets + key: OAUTH_OIDC_CLIENT_SECRET + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: zipline-secrets + key: POSTGRES_PASSWORD + - name: DATABASE_URL + value: "postgresql://zipline:$(POSTGRES_PASSWORD)@postgresql-rw.database-system.svc.cluster.local:5432/zipline" + volumeMounts: + - name: zipline-data + mountPath: /zipline/uploads +--- +apiVersion: v1 +kind: Service +metadata: + name: zipline + namespace: zipline-system +spec: + selector: + app: zipline + ports: + - name: http + port: 80 + targetPort: 3000 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: zipline + namespace: zipline-system + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + external-dns.alpha.kubernetes.io/hostname: zipline.dooplex.hu,zipline.home + nginx.ingress.kubernetes.io/ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-body-size: "100m" +spec: + ingressClassName: nginx-internal + tls: + - hosts: + - zipline.dooplex.hu + secretName: zipline-tls + rules: + - host: zipline.dooplex.hu + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: zipline + port: + number: 80 + - host: zipline.home + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: zipline + port: + number: 80 \ No newline at end of file