From e3826366a7e30562531f9f7210de0e7157264558 Mon Sep 17 00:00:00 2001 From: Juan Ignacio Donoso Date: Fri, 15 Dec 2023 15:01:15 -0300 Subject: [PATCH] feat(default): upgrade obsidian-sync helmrelease and kustomization --- .../main/apps/default/kustomization.yaml | 2 +- .../externalsecret.yaml} | 2 +- .../helmrelease.yaml} | 0 .../obsidian-sync/app/kustomization.yaml | 15 ++++++++++++ .../{config => app/resources}/config.ini | 0 .../main/apps/default/obsidian-sync/ks.yaml | 23 +++++++++++++++++++ .../default/obsidian-sync/kustomization.yaml | 17 -------------- .../patches/kustomizeconfig.yaml | 7 ------ 8 files changed, 40 insertions(+), 26 deletions(-) rename kubernetes/main/apps/default/obsidian-sync/{external-secret.yaml => app/externalsecret.yaml} (74%) rename kubernetes/main/apps/default/obsidian-sync/{helm-release.yaml => app/helmrelease.yaml} (100%) create mode 100644 kubernetes/main/apps/default/obsidian-sync/app/kustomization.yaml rename kubernetes/main/apps/default/obsidian-sync/{config => app/resources}/config.ini (100%) create mode 100644 kubernetes/main/apps/default/obsidian-sync/ks.yaml delete mode 100644 kubernetes/main/apps/default/obsidian-sync/kustomization.yaml delete mode 100644 kubernetes/main/apps/default/obsidian-sync/patches/kustomizeconfig.yaml diff --git a/kubernetes/main/apps/default/kustomization.yaml b/kubernetes/main/apps/default/kustomization.yaml index 32cfbdeb5..d79d9b3dc 100644 --- a/kubernetes/main/apps/default/kustomization.yaml +++ b/kubernetes/main/apps/default/kustomization.yaml @@ -8,4 +8,4 @@ resources: # Flux-Kustomizations - ./hajimari - ./minio - - ./obsidian-sync + - ./obsidian-sync/ks.yaml diff --git a/kubernetes/main/apps/default/obsidian-sync/external-secret.yaml b/kubernetes/main/apps/default/obsidian-sync/app/externalsecret.yaml similarity index 74% rename from kubernetes/main/apps/default/obsidian-sync/external-secret.yaml rename to kubernetes/main/apps/default/obsidian-sync/app/externalsecret.yaml index 497fa4a9c..1553e06e9 100644 --- a/kubernetes/main/apps/default/obsidian-sync/external-secret.yaml +++ b/kubernetes/main/apps/default/obsidian-sync/app/externalsecret.yaml @@ -1,9 +1,9 @@ --- +# yaml-language-server: $schema=https://kubernetes-schemas.devbu.io/external-secrets.io/externalsecret_v1beta1.json apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret metadata: name: obsidian-sync - namespace: default spec: secretStoreRef: kind: ClusterSecretStore diff --git a/kubernetes/main/apps/default/obsidian-sync/helm-release.yaml b/kubernetes/main/apps/default/obsidian-sync/app/helmrelease.yaml similarity index 100% rename from kubernetes/main/apps/default/obsidian-sync/helm-release.yaml rename to kubernetes/main/apps/default/obsidian-sync/app/helmrelease.yaml diff --git a/kubernetes/main/apps/default/obsidian-sync/app/kustomization.yaml b/kubernetes/main/apps/default/obsidian-sync/app/kustomization.yaml new file mode 100644 index 000000000..da8ce39a8 --- /dev/null +++ b/kubernetes/main/apps/default/obsidian-sync/app/kustomization.yaml @@ -0,0 +1,15 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - externalsecret.yaml + - helmrelease.yaml +configMapGenerator: + - name: obsidian-sync-configmap + files: + - config.ini=resources/config.ini +generatorOptions: + disableNameSuffixHash: true + annotations: + kustomize.toolkit.fluxcd.io/substitute: disabled diff --git a/kubernetes/main/apps/default/obsidian-sync/config/config.ini b/kubernetes/main/apps/default/obsidian-sync/app/resources/config.ini similarity index 100% rename from kubernetes/main/apps/default/obsidian-sync/config/config.ini rename to kubernetes/main/apps/default/obsidian-sync/app/resources/config.ini diff --git a/kubernetes/main/apps/default/obsidian-sync/ks.yaml b/kubernetes/main/apps/default/obsidian-sync/ks.yaml new file mode 100644 index 000000000..dbfaa8ccd --- /dev/null +++ b/kubernetes/main/apps/default/obsidian-sync/ks.yaml @@ -0,0 +1,23 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.devbu.io/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app obsidian-sync + namespace: flux-system +spec: + targetNamespace: home + commonMetadata: + labels: + app.kubernetes.io/name: *app + dependsOn: + - name: external-secrets-stores + path: ./kubernetes/main/apps/default/obsidian-sync/app + prune: true + sourceRef: + kind: GitRepository + name: home-kubernetes + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/kubernetes/main/apps/default/obsidian-sync/kustomization.yaml b/kubernetes/main/apps/default/obsidian-sync/kustomization.yaml deleted file mode 100644 index b7a40db6c..000000000 --- a/kubernetes/main/apps/default/obsidian-sync/kustomization.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: default -resources: - - external-secret.yaml - - helm-release.yaml -configMapGenerator: - - name: obsidian-sync-configmap - files: - - config.ini=config/config.ini -configurations: - - ./patches/kustomizeconfig.yaml -labels: - - pairs: - app.kubernetes.io/name: obsidian-sync - app.kubernetes.io/instance: obsidian-sync diff --git a/kubernetes/main/apps/default/obsidian-sync/patches/kustomizeconfig.yaml b/kubernetes/main/apps/default/obsidian-sync/patches/kustomizeconfig.yaml deleted file mode 100644 index 4af3acbc0..000000000 --- a/kubernetes/main/apps/default/obsidian-sync/patches/kustomizeconfig.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -nameReference: - - kind: ConfigMap - version: v1 - fieldSpecs: - - path: spec/values/persistence/config-file/name - kind: HelmRelease