From 11ef19b1098d276f304ca2b189c45cff0a61281f Mon Sep 17 00:00:00 2001 From: CJ_Clippy Date: Thu, 13 Jun 2024 14:51:25 -0800 Subject: [PATCH] add temporal to apps --- apps/base/temporal/kustomization.yaml | 0 apps/base/temporal/namespace.yaml | 0 apps/base/temporal/release.yaml | 66 +++++++++++ apps/base/temporal/repository.yaml | 8 ++ apps/base/windmill/kustomization.yaml | 5 - apps/base/windmill/windmill.yaml | 152 -------------------------- apps/production/kustomization.yaml | 2 +- t.wip.tiltfile | 1 + 8 files changed, 76 insertions(+), 158 deletions(-) create mode 100644 apps/base/temporal/kustomization.yaml create mode 100644 apps/base/temporal/namespace.yaml create mode 100644 apps/base/temporal/release.yaml create mode 100644 apps/base/temporal/repository.yaml delete mode 100644 apps/base/windmill/kustomization.yaml delete mode 100644 apps/base/windmill/windmill.yaml diff --git a/apps/base/temporal/kustomization.yaml b/apps/base/temporal/kustomization.yaml new file mode 100644 index 0000000..e69de29 diff --git a/apps/base/temporal/namespace.yaml b/apps/base/temporal/namespace.yaml new file mode 100644 index 0000000..e69de29 diff --git a/apps/base/temporal/release.yaml b/apps/base/temporal/release.yaml new file mode 100644 index 0000000..5cc73c3 --- /dev/null +++ b/apps/base/temporal/release.yaml @@ -0,0 +1,66 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: temporal + namespace: futureporn +spec: + releaseName: temporal + chart: + spec: + chart: temporal + sourceRef: + kind: HelmRepository + name: temporal + interval: 50m + install: + remediation: + retries: 3 + # Default values + # https://artifacthub.io/packages/helm/lemontech/temporal?modal=values + values: + admintools: + image: + tag: "1.24.1-tctl-1.18.1-cli-0.12.0" + web: + image: + tag: "2.27.2" + config: + auth: + enabled: true + prometheus: + enabled: false + grafana: + enabled: false + elasticsearch: + enabled: false + cassandra: + enabled: false + server: + config: + persistence: + default: + driver: sql + sql: + driver: postgres12 + host: postgres.futureporn.svc.cluster.local + port: 5432 + visibility: + driver: sql + sql: + driver: postgres12 + host: postgres.futureporn.svc.cluster.local + port: 5432 + valuesFrom: + - kind: Secret + name: temporalPostgresUser + targetPath: server.config.persistence.default.sql.user + - kind: Secret + name: temporalPostgresPassword + targetPath: server.config.persistence.default.sql.password + - kind: Secret + name: temporalPostgresPassword + targetPath: server.config.persistence.visibility.sql.password + - kind: Secret + name: temporalPostgresUser + targetPath: server.config.persistence.visibility.sql.user + \ No newline at end of file diff --git a/apps/base/temporal/repository.yaml b/apps/base/temporal/repository.yaml new file mode 100644 index 0000000..e678008 --- /dev/null +++ b/apps/base/temporal/repository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: podinfo + namespace: futureporn +spec: + interval: 5m + url: https://stefanprodan.github.io/podinfo diff --git a/apps/base/windmill/kustomization.yaml b/apps/base/windmill/kustomization.yaml deleted file mode 100644 index 79702ae..0000000 --- a/apps/base/windmill/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: futureporn -resources: - - windmill.yaml diff --git a/apps/base/windmill/windmill.yaml b/apps/base/windmill/windmill.yaml deleted file mode 100644 index 027acca..0000000 --- a/apps/base/windmill/windmill.yaml +++ /dev/null @@ -1,152 +0,0 @@ ---- -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository -metadata: - name: bitnami - namespace: futureporn -spec: - type: "oci" - interval: 24h - url: oci://registry-1.docker.io/bitnamicharts ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta2 -kind: HelmRelease -metadata: - name: postgresql - namespace: futureporn -spec: - interval: 24h - chart: - spec: - chart: postgresql - version: "12.3.1" - sourceRef: - kind: HelmRepository - name: bitnami - values: - fullnameOverride: windmill-postgresql - architecture: standalone - backup: - enabled: false # @todo figure out how it's done and enable @see https://github.com/bitnami/charts/tree/main/bitnami/postgresql#backup-parameters - auth: - database: windmill - existingSecret: windmill-postgresql - primary: - persistence: - # It would be $0.20/mo cheaper to use 8Gi NVMe, - # but it's not available in Vultr's DFW datacenter - # so instead we use the minimum HDD size, 40Gi - storageClass: "vultr-block-storage-hdd" - size: "40Gi" - resources: - limits: - cpu: "1" - memory: "2Gi" - requests: - cpu: "250m" - memory: "1024Mi" ---- -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository -metadata: - name: windmill - namespace: futureporn -spec: - interval: 10m - url: https://windmill-labs.github.io/windmill-helm-charts ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta2 -kind: HelmRelease -metadata: - name: windmill - namespace: futureporn -spec: - interval: 60m - chart: - spec: - chart: windmill - version: "2.0.170" - sourceRef: - kind: HelmRepository - name: windmill - values: - postgresql: - # this is disabled because we spin up our own postgres with vultr HDD support (see above) - enabled: false - windmill: - # domain as shown in browser, this is used together with `baseProtocol` as part of the BASE_URL environment variable in app and worker container and in the ingress resource, if enabled - baseDomain: windmill2.sbtp.xyz - baseProtocol: https - # postgres URI, pods will crashloop if database is unreachable, sets DATABASE_URL environment variable in app and worker container - databaseUrl: postgres://postgres:blahblahblah@windmill-postgresql/windmill?sslmode=disable - # replica for the application app - appReplicas: 1 - # replicas for the workers, jobs are executed on the workers - lspReplicas: 2 - workerGroups: - # The default worker group is the one that will execute jobs with any taggs except the native ones. Windmill has a default worker group configuration for it - - name: "default" - replicas: 1 - # -- Annotations to apply to the pods - annotations: {} - # -- Labels to apply to the pods - labels: {} - # -- Node selector to use for scheduling the pods - nodeSelector: {} - # -- Tolerations to apply to the pods - tolerations: [] - # -- Affinity rules to apply to the pods - affinity: {} - # -- Resource limits and requests for the pods - resources: - requests: - memory: "1028Mi" - cpu: "500m" - limits: - memory: "2048Mi" - cpu: "1000m" - # -- Extra environment variables to apply to the pods - extraEnv: [] - # -- Extra sidecar containers - extraContainers: [] - # -- Mode for workers, defaults to "worker" - alternative "agent" requires Enterprise license - mode: "worker" - # Thenative worker group will only execute native jobs. Windmill has a default worker group configuration for it - - name: "native" - replicas: 1 - # -- Resource limits and requests for the pods - resources: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "256Mi" - cpu: "200m" - # -- Extra environment variables to apply to the pods - extraEnv: [] - # -- Extra sidecar containers - extraContainers: [] - # -- Mode for workers, defaults to "worker" - alternative "agent" requires Enterprise license - mode: "worker" - - name: "gpu" - replicas: 0 - # Use those to override the tag or image used for the app and worker containers. Windmill uses the same image for both. - # By default, if enterprise is enable, the image is set to ghcr.io/windmill-labs/windmill-ee, otherwise the image is set to ghcr.io/windmill-labs/windmill - #tag: "mytag" - #image: "ghcr.io/windmill-labs/windmill" - # enable postgres (bitnami) on kubernetes - # enable minio (bitnami) on kubernetes - minio: - enabled: false - ingress: - enabled: true - className: nginx - annotations: - kubernetes.io/ingress.class: "nginx" - cert-manager.io/cluster-issuer: "letsencrypt" - tls: - - secretName: windmill-tls - hosts: - - windmill2.sbtp.xyz - enterprise: - enable: false \ No newline at end of file diff --git a/apps/production/kustomization.yaml b/apps/production/kustomization.yaml index fd8d3ac..8a133f3 100644 --- a/apps/production/kustomization.yaml +++ b/apps/production/kustomization.yaml @@ -3,7 +3,7 @@ kind: Kustomization resources: - ../base/podinfo # - ../base/chisel - - ../base/windmill + - ../base/temporal - ../base/fp patches: - path: podinfo-values.yaml diff --git a/t.wip.tiltfile b/t.wip.tiltfile index 2c90b24..f78b20c 100644 --- a/t.wip.tiltfile +++ b/t.wip.tiltfile @@ -244,6 +244,7 @@ docker_build( ## however, I don't think tilt has this capability. sync('./packages/next', '/ignore-me'), ], + # this entrypoint is a godsend. It lets me restart the node app (fast) without having to rebuild the docker container (slow) entrypoint='pnpm nodemon --ext js,ts,json,yaml --exec node --no-warnings=ExperimentalWarning --loader ts-node/esm ./src/temporal/worker.ts' ) # k8s_resource(