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

@@ -4,44 +4,39 @@ metadata:
name: cnpg
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
- 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
- repoURL: https://cloudnative-pg.github.io/charts
chart: cloudnative-pg
targetRevision: 0.23.0
helm:
valueFiles:
- $values/cnpg/helm-values.yaml
- 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
- 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

@@ -4,123 +4,115 @@ metadata:
name: longhorn
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
- 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: {}
- repoURL: https://charts.longhorn.io
chart: longhorn
targetRevision: 1.7.2
helm:
valueFiles:
- $values/longhorn/helm-values.yaml
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
ref: values
- 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
- 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
name: engines.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: engineimages.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: instancemanagers.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: nodes.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: replicas.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: settings.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: volumes.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: engines.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: engineimages.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: instancemanagers.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: nodes.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: replicas.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: settings.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: volumes.longhorn.io
jqPathExpressions:
- .spec.conversion.webhook.clientConfig
- .status
- .metadata.annotations
- .metadata.generation
- .metadata.resourceVersion
- .spec.preserveUnknownFields

View File

@@ -1,11 +1,8 @@
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
- nodes/mayne-worker-2.yaml
- ingress.yaml
- nodes/mayne-vcn.yaml
- nodes/mayne-worker-1.yaml
- nodes/mayne-worker-2.yaml

View File

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

View File

@@ -4,47 +4,41 @@ metadata:
name: minio
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
- 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
- repoURL: https://charts.min.io
chart: minio
targetRevision: 5.2.0
helm:
valueFiles:
- $values/minio/helm-values.yaml
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
ref: values
- 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
- 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
- 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

@@ -4,28 +4,28 @@ metadata:
name: pgweb
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
path: pgweb
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
path: pgweb
destination:
server: https://kubernetes.default.svc
namespace: pgweb
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- CreateNamespace=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'

View File

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

View File

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

View File

@@ -4,45 +4,41 @@ metadata:
name: postgresql-dev
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
- repoURL: https://charts.bitnami.com/bitnami
chart: postgresql
targetRevision: 16.2.1
helm:
valueFiles:
- $values/postgresql-dev/helm-values.yaml
- 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
- repoURL: https://charts.bitnami.com/bitnami
chart: postgresql
targetRevision: 16.2.1
helm:
valueFiles:
- $values/postgresql-dev/helm-values.yaml
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
ref: values
- 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
- 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
- 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

@@ -4,50 +4,46 @@ metadata:
name: velero
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
- repoURL: https://vmware-tanzu.github.io/helm-charts
chart: velero
targetRevision: 11.2.0
helm:
valueFiles:
- $values/velero/helm-values.yaml
- repoURL: https://gitea0213.kro.kr/bluemayne/cluster-infrastructure.git
targetRevision: main
ref: values
- repoURL: https://gitea0213.kro.kr/bluemayne/cluster-infrastructure.git
targetRevision: main
path: velero
kustomize: {}
- repoURL: https://vmware-tanzu.github.io/helm-charts
chart: velero
targetRevision: 11.2.0
helm:
valueFiles:
- $values/velero/helm-values.yaml
- repoURL: https://gitea0213.kro.kr/bluemayne/cluster-infrastructure.git
targetRevision: main
ref: values
- repoURL: https://gitea0213.kro.kr/bluemayne/cluster-infrastructure.git
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
- 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
@@ -55,14 +51,13 @@ metadata:
name: velero-ui
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
- 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
- PrunePropagationPolicy=foreground
- PruneLast=true
- ServerSideApply=true
- 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
- 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"