REFACTOR(goldilocks): use managedNamespaceMetadata for namespace labels

- Remove namespace.yaml files
- Add managedNamespaceMetadata with Goldilocks label
- Set CreateNamespace=true in syncOptions
- Update kustomization.yaml to remove namespace.yaml references
This commit is contained in:
2025-12-29 15:57:47 +09:00
parent 66890d8f66
commit 9abcdfa98d
18 changed files with 200 additions and 283 deletions

View File

@@ -7,41 +7,36 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Helm chart from CloudNativePG repository
- repoURL: https://cloudnative-pg.github.io/charts
chart: cloudnative-pg
targetRevision: 0.23.0
helm:
valueFiles:
- $values/cnpg/helm-values.yaml
# Values file from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/cluster-infrastructure.git
targetRevision: main
ref: values
destination:
server: https://kubernetes.default.svc
namespace: cnpg
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
- ServerSideApply=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10

View File

@@ -1,5 +1,3 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
resources: []

View File

@@ -1,6 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: cnpg
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -7,52 +7,44 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Helm chart from Longhorn repository
- repoURL: https://charts.longhorn.io
chart: longhorn
targetRevision: 1.7.2
helm:
valueFiles:
- $values/longhorn/helm-values.yaml
# Values file from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
ref: values
# Ingress and Nodes from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
path: longhorn
kustomize: {}
destination:
server: https://kubernetes.default.svc
namespace: longhorn-system
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
- RespectIgnoreDifferences=true
- ServerSideApply=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10
# Ignore differences in CRDs managed by Longhorn
ignoreDifferences:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition

View File

@@ -1,10 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: longhorn-system
resources:
- namespace.yaml
- ingress.yaml
- nodes/mayne-vcn.yaml
- nodes/mayne-worker-1.yaml

View File

@@ -1,6 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: longhorn-system
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -7,44 +7,38 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Official MinIO Helm chart
- repoURL: https://charts.min.io
chart: minio
targetRevision: 5.2.0
helm:
valueFiles:
- $values/minio/helm-values.yaml
# Values file from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
ref: values
# Vault secrets from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
path: minio
destination:
server: https://kubernetes.default.svc
namespace: minio
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10

View File

@@ -1,7 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- vault/minio-root-password.yaml
- ingress.yaml

View File

@@ -1,6 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: minio
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -7,16 +7,13 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
path: pgweb
destination:
server: https://kubernetes.default.svc
namespace: pgweb
syncPolicy:
automated:
prune: true
@@ -29,3 +26,6 @@ spec:
duration: 5s
factor: 2
maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'

View File

@@ -1,10 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# argocd.yaml은 수동으로 관리 (순환 참조 방지)
# - argocd.yaml
- namespace.yaml
- deployment.yaml
- vault/serviceaccount.yaml
- vault/secretstore.yaml

View File

@@ -1,6 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: pgweb
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -7,7 +7,6 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
- repoURL: https://charts.bitnami.com/bitnami
chart: postgresql
@@ -18,31 +17,28 @@ spec:
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
ref: values
# Vault secrets from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
path: postgresql-dev
destination:
server: https://kubernetes.default.svc
namespace: postgresql-dev
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10

View File

@@ -1,8 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# argocd.yaml은 수동으로 관리 (순환 참조 방지)
# - argocd.yaml
- namespace.yaml
- vault/postgresql-password-dev.yaml

View File

@@ -1,6 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: postgresql-dev
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -7,7 +7,6 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
- repoURL: https://vmware-tanzu.github.io/helm-charts
chart: velero
@@ -22,32 +21,29 @@ spec:
targetRevision: main
path: velero
kustomize: {}
destination:
server: https://kubernetes.default.svc
namespace: velero
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
- ServerSideApply=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10
---
apiVersion: argoproj.io/v1alpha1
kind: Application
@@ -58,11 +54,10 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://helm.otwld.com/
chart: velero-ui
targetRevision: "*"
targetRevision: '*'
helm:
values: |
image:
@@ -108,28 +103,26 @@ spec:
serviceAccount:
create: true
name: velero-ui
destination:
server: https://kubernetes.default.svc
namespace: velero
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=false
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
- ServerSideApply=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10

View File

@@ -1,7 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- vault/velero-secrets.yaml
- ingress.yaml

View File

@@ -1,6 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: velero
labels:
goldilocks.fairwinds.com/enabled: "true"