diff --git a/gitops/argocd/apps/k3s/homelab/core/annotations.yaml b/gitops/argocd/apps/k3s/homelab/core/annotations.yaml index 4e615d7040..4f133fe8f5 100644 --- a/gitops/argocd/apps/k3s/homelab/core/annotations.yaml +++ b/gitops/argocd/apps/k3s/homelab/core/annotations.yaml @@ -35,3 +35,5 @@ annotations: fieldSpecs: - path: metadata/annotations create: true +- path: spec/template/metadata/annotations + create: true diff --git a/gitops/argocd/apps/k3s/homelab/core/applicationset.yaml b/gitops/argocd/apps/k3s/homelab/core/applicationset.yaml new file mode 100644 index 0000000000..7ac1b9bd70 --- /dev/null +++ b/gitops/argocd/apps/k3s/homelab/core/applicationset.yaml @@ -0,0 +1,105 @@ +--- +# Copyright (C) Nicolas Lamirault +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: core + labels: + app.kubernetes.io/name: core + app.kubernetes.io/instance: core-argocd-applicationset + app.kubernetes.io/component: argocd-applicationset + app.kubernetes.io/part-of: core-argocd +spec: + generators: + - list: + elements: + - appName: metrics-server + namespace: kube-system + path: gitops/argocd/charts/kube-system/metrics-server + targetRevision: master + - appName: sealed-secrets + namespace: kube-system + path: gitops/argocd/charts/kube-system/sealed-secrets + targetRevision: master + - appName: external-secrets + namespace: kube-system + path: gitops/argocd/charts/kube-system/external-secrets + targetRevision: master + - appName: nfs-subdir-external-provisioner + namespace: kube-system + path: gitops/argocd/charts/kube-system/nfs-subdir-external-provisioner + targetRevision: master + # - appName: argo-workflows + # namespace: gitops + # path: gitops/argocd/charts/gitops/argo-workflows + # targetRevision: master + # - appName: argo-rollouts + # namespace: gitops + # path: gitops/argocd/charts/gitops/argo-rollouts + # targetRevision: master + # - appName: argo-events + # namespace: gitops + # path: gitops/argocd/charts/gitops/argo-events + # targetRevision: master + - appName: kargo + namespace: gitops + path: gitops/argocd/charts/gitops/kargo + targetRevision: master + template: + metadata: + name: "{{appName}}" + annotations: + # https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#webhook-and-manifest-paths-annotation + argocd.argoproj.io/manifest-generate-paths: "/{{path}}" + finalizers: + - resources-finalizer.argocd.argoproj.io + labels: + app.kubernetes.io/name: "{{appName}}" + app.kubernetes.io/instance: "{{appName}}-argocd-application" + app.kubernetes.io/component: argocd-application + app.kubernetes.io/part-of: "{{appName}}-argocd" + spec: + destination: + namespace: "{{namespace}}" + server: https://kubernetes.default.svc + project: portefaix-k3s-homelab + source: + repoURL: https://github.com/portefaix/portefaix-kubernetes.git + targetRevision: "{{targetRevision}}" + path: "{{path}}" + helm: + valueFiles: + - values.yaml + - values-k3s-homelab.yaml + syncPolicy: + automated: + prune: true + selfHeal: true + allowEmpty: false + syncOptions: + - CreateNamespace=true + - Validate=false + - SkipDryRunOnMissingResource=true + - ApplyOutOfSyncOnly=true + # - ServerSideApply=true + # retry: + # limit: 5 + # backoff: + # duration: 5s + # factor: 2 + # maxDuration: 3m0s diff --git a/gitops/argocd/apps/k3s/homelab/core/argo-events.yaml b/gitops/argocd/apps/k3s/homelab/core/argo-events.yaml deleted file mode 100644 index 6110060675..0000000000 --- a/gitops/argocd/apps/k3s/homelab/core/argo-events.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# Copyright (C) Nicolas Lamirault -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: argo-events - annotations: - # https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#webhook-and-manifest-paths-annotation - argocd.argoproj.io/manifest-generate-paths: /gitops/argocd/charts/gitops/argo-events - notifications.argoproj.io/subscribe.grafana: argo-events - finalizers: - - resources-finalizer.argocd.argoproj.io - labels: - app.kubernetes.io/name: argo-events - app.kubernetes.io/instance: argo-events-argocd-app - app.kubernetes.io/part-of: argo-events -spec: - destination: - namespace: gitops - server: https://kubernetes.default.svc - project: portefaix-k3s-homelab - source: - path: gitops/argocd/charts/gitops/argo-events - repoURL: https://github.com/portefaix/portefaix-kubernetes.git - targetRevision: master - helm: - valueFiles: - - values.yaml - - values-k3s-homelab.yaml - syncPolicy: - automated: - prune: true - selfHeal: true - allowEmpty: false - syncOptions: - - CreateNamespace=true - - Validate=false - - SkipDryRunOnMissingResource=true - - ApplyOutOfSyncOnly=true - - ServerSideApply=true - # retry: - # limit: 5 - # backoff: - # duration: 5s - # factor: 2 - # maxDuration: 3m0s diff --git a/gitops/argocd/apps/k3s/homelab/core/argo-rollouts.yaml b/gitops/argocd/apps/k3s/homelab/core/argo-rollouts.yaml deleted file mode 100644 index edef4004ab..0000000000 --- a/gitops/argocd/apps/k3s/homelab/core/argo-rollouts.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# Copyright (C) Nicolas Lamirault -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: argo-rollouts - annotations: - # https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#webhook-and-manifest-paths-annotation - argocd.argoproj.io/manifest-generate-paths: /gitops/argocd/charts/gitops/argo-rollouts - notifications.argoproj.io/subscribe.grafana: argo-rollouts - finalizers: - - resources-finalizer.argocd.argoproj.io - labels: - app.kubernetes.io/name: argo-rollouts - app.kubernetes.io/instance: argo-rollouts-argocd-app - app.kubernetes.io/part-of: argo-rollouts -spec: - destination: - namespace: gitops - server: https://kubernetes.default.svc - project: portefaix-k3s-homelab - source: - path: gitops/argocd/charts/gitops/argo-rollouts - repoURL: https://github.com/portefaix/portefaix-kubernetes.git - targetRevision: master - helm: - valueFiles: - - values.yaml - - values-k3s-homelab.yaml - syncPolicy: - automated: - prune: true - selfHeal: true - allowEmpty: false - syncOptions: - - CreateNamespace=true - - Validate=false - - SkipDryRunOnMissingResource=true - - ApplyOutOfSyncOnly=true - - ServerSideApply=true - # retry: - # limit: 5 - # backoff: - # duration: 5s - # factor: 2 - # maxDuration: 3m0s diff --git a/gitops/argocd/apps/k3s/homelab/core/argo-workflows.yaml b/gitops/argocd/apps/k3s/homelab/core/argo-workflows.yaml deleted file mode 100644 index e7e0155905..0000000000 --- a/gitops/argocd/apps/k3s/homelab/core/argo-workflows.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# Copyright (C) Nicolas Lamirault -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: argo-workflows - annotations: - # https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#webhook-and-manifest-paths-annotation - argocd.argoproj.io/manifest-generate-paths: /gitops/argocd/charts/gitops/argo-workflows - notifications.argoproj.io/subscribe.grafana: argo-workflows - finalizers: - - resources-finalizer.argocd.argoproj.io - labels: - app.kubernetes.io/name: argo-workflows - app.kubernetes.io/instance: argo-workflows-argocd-app - app.kubernetes.io/part-of: argo-workflows -spec: - destination: - namespace: gitops - server: https://kubernetes.default.svc - project: portefaix-k3s-homelab - source: - path: gitops/argocd/charts/gitops/argo-workflows - repoURL: https://github.com/portefaix/portefaix-kubernetes.git - targetRevision: master - helm: - valueFiles: - - values.yaml - - values-k3s-homelab.yaml - syncPolicy: - automated: - prune: true - selfHeal: true - allowEmpty: false - syncOptions: - - CreateNamespace=true - - Validate=false - - SkipDryRunOnMissingResource=true - - ApplyOutOfSyncOnly=true - - ServerSideApply=true - # retry: - # limit: 5 - # backoff: - # duration: 5s - # factor: 2 - # maxDuration: 3m0s diff --git a/gitops/argocd/apps/k3s/homelab/core/external-secrets.yaml b/gitops/argocd/apps/k3s/homelab/core/external-secrets.yaml deleted file mode 100644 index 1bac453bd2..0000000000 --- a/gitops/argocd/apps/k3s/homelab/core/external-secrets.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# Copyright (C) Nicolas Lamirault -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: external-secrets - annotations: - # https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#webhook-and-manifest-paths-annotation - argocd.argoproj.io/manifest-generate-paths: /gitops/argocd/charts/kube-system/external-secrets - notifications.argoproj.io/subscribe.grafana: external-secrets - finalizers: - - resources-finalizer.argocd.argoproj.io - labels: - app.kubernetes.io/name: external-secrets - app.kubernetes.io/instance: external-secrets-argocd-app - app.kubernetes.io/part-of: external-secrets -spec: - destination: - namespace: kube-system - server: https://kubernetes.default.svc - project: portefaix-k3s-homelab - source: - path: gitops/argocd/charts/kube-system/external-secrets - repoURL: https://github.com/portefaix/portefaix-kubernetes.git - targetRevision: master - helm: - valueFiles: - - values.yaml - - values-k3s-homelab.yaml - syncPolicy: - automated: - prune: true - selfHeal: true - allowEmpty: false - syncOptions: - - CreateNamespace=true - - Validate=false - - SkipDryRunOnMissingResource=true - - ApplyOutOfSyncOnly=true - - ServerSideApply=true - # retry: - # limit: 5 - # backoff: - # duration: 5s - # factor: 2 - # maxDuration: 3m0s diff --git a/gitops/argocd/apps/k3s/homelab/core/kargo.yaml b/gitops/argocd/apps/k3s/homelab/core/kargo.yaml deleted file mode 100644 index f71075b5f4..0000000000 --- a/gitops/argocd/apps/k3s/homelab/core/kargo.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# Copyright (C) Nicolas Lamirault -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: kargo - annotations: - # https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#webhook-and-manifest-paths-annotation - argocd.argoproj.io/manifest-generate-paths: /gitops/argocd/charts/gitops/kargo - notifications.argoproj.io/subscribe.grafana: kargo - finalizers: - - resources-finalizer.argocd.argoproj.io - labels: - app.kubernetes.io/name: kargo - app.kubernetes.io/instance: kargo-argocd-app - app.kubernetes.io/part-of: kargo -spec: - destination: - namespace: gitops - server: https://kubernetes.default.svc - project: portefaix-k3s-homelab - source: - path: gitops/argocd/charts/gitops/kargo - repoURL: https://github.com/portefaix/portefaix-kubernetes.git - targetRevision: master - helm: - valueFiles: - - values.yaml - - values-k3s-homelab.yaml - syncPolicy: - automated: - prune: true - selfHeal: true - allowEmpty: false - syncOptions: - - CreateNamespace=true - - Validate=false - - SkipDryRunOnMissingResource=true - - ApplyOutOfSyncOnly=true - - ServerSideApply=true - # retry: - # limit: 5 - # backoff: - # duration: 5s - # factor: 2 - # maxDuration: 3m0s diff --git a/gitops/argocd/apps/k3s/homelab/core/kustomization.yaml b/gitops/argocd/apps/k3s/homelab/core/kustomization.yaml index 655cf7c1dc..e46c8c3efc 100644 --- a/gitops/argocd/apps/k3s/homelab/core/kustomization.yaml +++ b/gitops/argocd/apps/k3s/homelab/core/kustomization.yaml @@ -22,11 +22,4 @@ transformers: - annotations.yaml - labels.yaml resources: -- metrics-server.yaml -- sealed-secrets.yaml -- external-secrets.yaml -- nfs-subdir-external-provisioner.yaml -# - argo-events.yaml -# - argo-rollouts.yaml -# - argo-workflows.yaml -- kargo.yaml +- applicationset.yaml diff --git a/gitops/argocd/apps/k3s/homelab/core/labels.yaml b/gitops/argocd/apps/k3s/homelab/core/labels.yaml index 3dfb245969..ac70e7ca92 100644 --- a/gitops/argocd/apps/k3s/homelab/core/labels.yaml +++ b/gitops/argocd/apps/k3s/homelab/core/labels.yaml @@ -20,7 +20,6 @@ kind: LabelTransformer metadata: name: labels labels: - app.kubernetes.io/component: argo-cd-application app.kubernetes.io/managed-by: kustomize app.kubernetes.io/version: v1.0.0 portefaix.xyz/stack: core @@ -28,3 +27,5 @@ labels: fieldSpecs: - path: metadata/labels create: true +- path: spec/template/metadata/labels + create: true diff --git a/gitops/argocd/apps/k3s/homelab/core/metrics-server.yaml b/gitops/argocd/apps/k3s/homelab/core/metrics-server.yaml deleted file mode 100644 index d18c9fcb99..0000000000 --- a/gitops/argocd/apps/k3s/homelab/core/metrics-server.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# Copyright (C) Nicolas Lamirault -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: metrics-server - annotations: - # https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#webhook-and-manifest-paths-annotation - argocd.argoproj.io/manifest-generate-paths: /gitops/argocd/charts/kube-system/metrics-server - notifications.argoproj.io/subscribe.grafana: metrics-server - finalizers: - - resources-finalizer.argocd.argoproj.io - labels: - app.kubernetes.io/name: metrics-server - app.kubernetes.io/instance: metrics-server-argocd-app - app.kubernetes.io/part-of: metrics-server -spec: - destination: - namespace: kube-system - server: https://kubernetes.default.svc - project: portefaix-k3s-homelab - source: - path: gitops/argocd/charts/kube-system/metrics-server - repoURL: https://github.com/portefaix/portefaix-kubernetes.git - targetRevision: master - helm: - valueFiles: - - values.yaml - - values-k3s-homelab.yaml - syncPolicy: - automated: - prune: true - selfHeal: true - allowEmpty: false - syncOptions: - - CreateNamespace=true - - Validate=false - - SkipDryRunOnMissingResource=true - - ApplyOutOfSyncOnly=true - - ServerSideApply=true - # retry: - # limit: 5 - # backoff: - # duration: 5s - # factor: 2 - # maxDuration: 3m0s diff --git a/gitops/argocd/apps/k3s/homelab/core/nfs-subdir-external-provisioner.yaml b/gitops/argocd/apps/k3s/homelab/core/nfs-subdir-external-provisioner.yaml deleted file mode 100644 index a19be9cc03..0000000000 --- a/gitops/argocd/apps/k3s/homelab/core/nfs-subdir-external-provisioner.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# Copyright (C) Nicolas Lamirault -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: nfs-subdir-external-provisioner - annotations: - # https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#webhook-and-manifest-paths-annotation - argocd.argoproj.io/manifest-generate-paths: /gitops/argocd/charts/kube-system/nfs-subdir-external-provisioner - notifications.argoproj.io/subscribe.grafana: nfs-subdir-external-provisioner - finalizers: - - resources-finalizer.argocd.argoproj.io - labels: - app.kubernetes.io/name: nfs-subdir-external-provisioner - app.kubernetes.io/instance: nfs-subdir-external-provisioner-argocd-app - app.kubernetes.io/part-of: nfs-subdir-external-provisioner -spec: - destination: - namespace: kube-system - server: https://kubernetes.default.svc - project: portefaix-k3s-homelab - source: - path: gitops/argocd/charts/kube-system/nfs-subdir-external-provisioner - repoURL: https://github.com/portefaix/portefaix-kubernetes.git - targetRevision: master - helm: - valueFiles: - - values.yaml - - values-k3s-homelab.yaml - syncPolicy: - automated: - prune: true - selfHeal: true - allowEmpty: false - syncOptions: - - CreateNamespace=true - - Validate=false - - SkipDryRunOnMissingResource=true - - ApplyOutOfSyncOnly=true - - ServerSideApply=true - # retry: - # limit: 5 - # backoff: - # duration: 5s - # factor: 2 - # maxDuration: 3m0s diff --git a/gitops/argocd/apps/k3s/homelab/core/sealed-secrets.yaml b/gitops/argocd/apps/k3s/homelab/core/sealed-secrets.yaml deleted file mode 100644 index 38f1f7ee8d..0000000000 --- a/gitops/argocd/apps/k3s/homelab/core/sealed-secrets.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# Copyright (C) Nicolas Lamirault -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: sealed-secrets - annotations: - # https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#webhook-and-manifest-paths-annotation - argocd.argoproj.io/manifest-generate-paths: /gitops/argocd/charts/kube-system/sealed-secrets - notifications.argoproj.io/subscribe.grafana: sealed-secrets - finalizers: - - resources-finalizer.argocd.argoproj.io - labels: - app.kubernetes.io/name: sealed-secrets - app.kubernetes.io/instance: sealed-secrets-argocd-app - app.kubernetes.io/part-of: sealed-secrets -spec: - destination: - namespace: kube-system - server: https://kubernetes.default.svc - project: portefaix-k3s-homelab - source: - path: gitops/argocd/charts/kube-system/sealed-secrets - repoURL: https://github.com/portefaix/portefaix-kubernetes.git - targetRevision: master - helm: - valueFiles: - - values.yaml - - values-k3s-homelab.yaml - syncPolicy: - automated: - prune: true - selfHeal: true - allowEmpty: false - syncOptions: - - CreateNamespace=true - - Validate=false - - SkipDryRunOnMissingResource=true - - ApplyOutOfSyncOnly=true - - ServerSideApply=true - # retry: - # limit: 5 - # backoff: - # duration: 5s - # factor: 2 - # maxDuration: 3m0s