From 466fb5cf36b889445af167a9eb260c9f6ded8aca Mon Sep 17 00:00:00 2001 From: srliao <906239+srliao@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:07:19 -0500 Subject: [PATCH] add gcsim-assets --- .../gcsim-assets/app/externalsecret.yaml | 20 +++++ .../gcsim/gcsim-assets/app/helmrelease.yaml | 79 +++++++++++++++++++ .../gcsim/gcsim-assets/app/kustomization.yaml | 6 ++ kubernetes/apps/gcsim/gcsim-assets/ks.yaml | 23 ++++++ 4 files changed, 128 insertions(+) create mode 100644 kubernetes/apps/gcsim/gcsim-assets/app/externalsecret.yaml create mode 100644 kubernetes/apps/gcsim/gcsim-assets/app/helmrelease.yaml create mode 100644 kubernetes/apps/gcsim/gcsim-assets/app/kustomization.yaml create mode 100644 kubernetes/apps/gcsim/gcsim-assets/ks.yaml diff --git a/kubernetes/apps/gcsim/gcsim-assets/app/externalsecret.yaml b/kubernetes/apps/gcsim/gcsim-assets/app/externalsecret.yaml new file mode 100644 index 00000000..68b609d3 --- /dev/null +++ b/kubernetes/apps/gcsim/gcsim-assets/app/externalsecret.yaml @@ -0,0 +1,20 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: gcsim-assets +spec: + secretStoreRef: + kind: ClusterSecretStore + name: onepassword-connect + target: + name: gcsim-assets-secret + template: + engineVersion: v2 + data: + SOURCE_HOST: "{{ .SOURCE_HOST }}" + SOURCE_TYPE: "{{ .SOURCE_TYPE }}" + dataFrom: + - extract: + key: gcsim-assets diff --git a/kubernetes/apps/gcsim/gcsim-assets/app/helmrelease.yaml b/kubernetes/apps/gcsim/gcsim-assets/app/helmrelease.yaml new file mode 100644 index 00000000..b193b60c --- /dev/null +++ b/kubernetes/apps/gcsim/gcsim-assets/app/helmrelease.yaml @@ -0,0 +1,79 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.0.4/charts/library/common/values.schema.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: &app gcsim-assets +spec: + interval: 30m + chart: + spec: + chart: app-template + version: 3.3.2 + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + uninstall: + keepHistory: false + values: + controllers: + gcsim-assets: + annotations: + reloader.stakater.com/auto: "true" + containers: + app: + image: + repository: ghcr.io/genshinsim/assets-develop + tag: nightly@sha256:b7de2c4233f3755f638ca6113dafe786d6ec477244749c0c5660471459884c53 + pullPolicy: Always + envFrom: + - secretRef: + name: gcsim-assets-secret + env: + TZ: America/Toronto + CACHE_DIR: /cache + PORT: &port 3000 + resources: + requests: + cpu: 10m + memory: 512Mi + limits: + memory: 512Mi + service: + app: + controller: gcsim-assets + ports: + http: + port: *port + ingress: + app: + enabled: true + nameOverride: *app + className: internal + annotations: + hajimari.io/enable: "false" + hosts: + - host: &host '{{ .Release.Name }}.${SECRET_DOMAIN}' + paths: + - path: / + service: + identifier: app + port: http + tls: + - hosts: + - *host + + persistence: + assets: + enabled: true + type: emptyDir + globalMounts: + - path: /cache diff --git a/kubernetes/apps/gcsim/gcsim-assets/app/kustomization.yaml b/kubernetes/apps/gcsim/gcsim-assets/app/kustomization.yaml new file mode 100644 index 00000000..3e5aa624 --- /dev/null +++ b/kubernetes/apps/gcsim/gcsim-assets/app/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./helmrelease.yaml + - ./externalsecret.yaml diff --git a/kubernetes/apps/gcsim/gcsim-assets/ks.yaml b/kubernetes/apps/gcsim/gcsim-assets/ks.yaml new file mode 100644 index 00000000..ec0e1d4d --- /dev/null +++ b/kubernetes/apps/gcsim/gcsim-assets/ks.yaml @@ -0,0 +1,23 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app gcsim-assets + namespace: flux-system +spec: + targetNamespace: gcsim + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./kubernetes/apps/gcsim/gcsim-assets/app + dependsOn: + - name: external-secrets-stores + prune: true + sourceRef: + kind: GitRepository + name: home-kubernetes + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m