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

View File

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

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 name: longhorn
namespace: argocd namespace: argocd
finalizers: finalizers:
- resources-finalizer.argocd.argoproj.io - resources-finalizer.argocd.argoproj.io
spec: spec:
project: default project: default
sources: sources:
# Helm chart from Longhorn repository - repoURL: https://charts.longhorn.io
- repoURL: https://charts.longhorn.io chart: longhorn
chart: longhorn targetRevision: 1.7.2
targetRevision: 1.7.2 helm:
helm: valueFiles:
valueFiles: - $values/longhorn/helm-values.yaml
- $values/longhorn/helm-values.yaml - repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
# Values file from Git repository targetRevision: main
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git ref: values
targetRevision: main - repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
ref: values targetRevision: main
# Ingress and Nodes from Git repository path: longhorn
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git kustomize: {}
targetRevision: main
path: longhorn
kustomize: {}
destination: destination:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
namespace: longhorn-system namespace: longhorn-system
syncPolicy: syncPolicy:
automated: automated:
prune: true prune: true
selfHeal: true selfHeal: true
allowEmpty: false allowEmpty: false
syncOptions: syncOptions:
- CreateNamespace=true - CreateNamespace=true
- PrunePropagationPolicy=foreground - PrunePropagationPolicy=foreground
- PruneLast=true - PruneLast=true
- RespectIgnoreDifferences=true - RespectIgnoreDifferences=true
- ServerSideApply=true - ServerSideApply=true
retry: retry:
limit: 5 limit: 5
backoff: backoff:
duration: 5s duration: 5s
factor: 2 factor: 2
maxDuration: 3m maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10 revisionHistoryLimit: 10
# Ignore differences in CRDs managed by Longhorn
ignoreDifferences: ignoreDifferences:
- group: apiextensions.k8s.io - group: apiextensions.k8s.io
kind: CustomResourceDefinition kind: CustomResourceDefinition
name: engines.longhorn.io name: engines.longhorn.io
jqPathExpressions: jqPathExpressions:
- .spec.conversion.webhook.clientConfig - .spec.conversion.webhook.clientConfig
- .status - .status
- .metadata.annotations - .metadata.annotations
- .metadata.generation - .metadata.generation
- .metadata.resourceVersion - .metadata.resourceVersion
- .spec.preserveUnknownFields - .spec.preserveUnknownFields
- group: apiextensions.k8s.io - group: apiextensions.k8s.io
kind: CustomResourceDefinition kind: CustomResourceDefinition
name: engineimages.longhorn.io name: engineimages.longhorn.io
jqPathExpressions: jqPathExpressions:
- .spec.conversion.webhook.clientConfig - .spec.conversion.webhook.clientConfig
- .status - .status
- .metadata.annotations - .metadata.annotations
- .metadata.generation - .metadata.generation
- .metadata.resourceVersion - .metadata.resourceVersion
- .spec.preserveUnknownFields - .spec.preserveUnknownFields
- group: apiextensions.k8s.io - group: apiextensions.k8s.io
kind: CustomResourceDefinition kind: CustomResourceDefinition
name: instancemanagers.longhorn.io name: instancemanagers.longhorn.io
jqPathExpressions: jqPathExpressions:
- .spec.conversion.webhook.clientConfig - .spec.conversion.webhook.clientConfig
- .status - .status
- .metadata.annotations - .metadata.annotations
- .metadata.generation - .metadata.generation
- .metadata.resourceVersion - .metadata.resourceVersion
- .spec.preserveUnknownFields - .spec.preserveUnknownFields
- group: apiextensions.k8s.io - group: apiextensions.k8s.io
kind: CustomResourceDefinition kind: CustomResourceDefinition
name: nodes.longhorn.io name: nodes.longhorn.io
jqPathExpressions: jqPathExpressions:
- .spec.conversion.webhook.clientConfig - .spec.conversion.webhook.clientConfig
- .status - .status
- .metadata.annotations - .metadata.annotations
- .metadata.generation - .metadata.generation
- .metadata.resourceVersion - .metadata.resourceVersion
- .spec.preserveUnknownFields - .spec.preserveUnknownFields
- group: apiextensions.k8s.io - group: apiextensions.k8s.io
kind: CustomResourceDefinition kind: CustomResourceDefinition
name: replicas.longhorn.io name: replicas.longhorn.io
jqPathExpressions: jqPathExpressions:
- .spec.conversion.webhook.clientConfig - .spec.conversion.webhook.clientConfig
- .status - .status
- .metadata.annotations - .metadata.annotations
- .metadata.generation - .metadata.generation
- .metadata.resourceVersion - .metadata.resourceVersion
- .spec.preserveUnknownFields - .spec.preserveUnknownFields
- group: apiextensions.k8s.io - group: apiextensions.k8s.io
kind: CustomResourceDefinition kind: CustomResourceDefinition
name: settings.longhorn.io name: settings.longhorn.io
jqPathExpressions: jqPathExpressions:
- .spec.conversion.webhook.clientConfig - .spec.conversion.webhook.clientConfig
- .status - .status
- .metadata.annotations - .metadata.annotations
- .metadata.generation - .metadata.generation
- .metadata.resourceVersion - .metadata.resourceVersion
- .spec.preserveUnknownFields - .spec.preserveUnknownFields
- group: apiextensions.k8s.io - group: apiextensions.k8s.io
kind: CustomResourceDefinition kind: CustomResourceDefinition
name: volumes.longhorn.io name: volumes.longhorn.io
jqPathExpressions: jqPathExpressions:
- .spec.conversion.webhook.clientConfig - .spec.conversion.webhook.clientConfig
- .status - .status
- .metadata.annotations - .metadata.annotations
- .metadata.generation - .metadata.generation
- .metadata.resourceVersion - .metadata.resourceVersion
- .spec.preserveUnknownFields - .spec.preserveUnknownFields

View File

@@ -1,11 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
namespace: longhorn-system namespace: longhorn-system
resources: resources:
- namespace.yaml - ingress.yaml
- ingress.yaml - nodes/mayne-vcn.yaml
- nodes/mayne-vcn.yaml - nodes/mayne-worker-1.yaml
- nodes/mayne-worker-1.yaml - nodes/mayne-worker-2.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 name: minio
namespace: argocd namespace: argocd
finalizers: finalizers:
- resources-finalizer.argocd.argoproj.io - resources-finalizer.argocd.argoproj.io
spec: spec:
project: default project: default
sources: sources:
# Official MinIO Helm chart - repoURL: https://charts.min.io
- repoURL: https://charts.min.io chart: minio
chart: minio targetRevision: 5.2.0
targetRevision: 5.2.0 helm:
helm: valueFiles:
valueFiles: - $values/minio/helm-values.yaml
- $values/minio/helm-values.yaml - repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
# Values file from Git repository targetRevision: main
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git ref: values
targetRevision: main - repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
ref: values targetRevision: main
# Vault secrets from Git repository path: minio
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main
path: minio
destination: destination:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
namespace: minio namespace: minio
syncPolicy: syncPolicy:
automated: automated:
prune: true prune: true
selfHeal: true selfHeal: true
allowEmpty: false allowEmpty: false
syncOptions: syncOptions:
- CreateNamespace=true - CreateNamespace=true
- PrunePropagationPolicy=foreground - PrunePropagationPolicy=foreground
- PruneLast=true - PruneLast=true
retry: retry:
limit: 5 limit: 5
backoff: backoff:
duration: 5s duration: 5s
factor: 2 factor: 2
maxDuration: 3m maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10 revisionHistoryLimit: 10

View File

@@ -1,7 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- namespace.yaml - vault/minio-root-password.yaml
- vault/minio-root-password.yaml - ingress.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 name: pgweb
namespace: argocd namespace: argocd
finalizers: finalizers:
- resources-finalizer.argocd.argoproj.io - resources-finalizer.argocd.argoproj.io
spec: spec:
project: default project: default
sources: sources:
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git - repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main targetRevision: main
path: pgweb path: pgweb
destination: destination:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
namespace: pgweb namespace: pgweb
syncPolicy: syncPolicy:
automated: automated:
prune: true prune: true
selfHeal: true selfHeal: true
syncOptions: syncOptions:
- CreateNamespace=true - CreateNamespace=true
retry: retry:
limit: 5 limit: 5
backoff: backoff:
duration: 5s duration: 5s
factor: 2 factor: 2
maxDuration: 3m maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'

View File

@@ -1,12 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
# argocd.yaml은 수동으로 관리 (순환 참조 방지) - deployment.yaml
# - argocd.yaml - vault/serviceaccount.yaml
- namespace.yaml - vault/secretstore.yaml
- deployment.yaml - vault/pgweb-secret.yaml
- vault/serviceaccount.yaml - ingress.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 name: postgresql-dev
namespace: argocd namespace: argocd
finalizers: finalizers:
- resources-finalizer.argocd.argoproj.io - resources-finalizer.argocd.argoproj.io
spec: spec:
project: default project: default
sources: sources:
- repoURL: https://charts.bitnami.com/bitnami - repoURL: https://charts.bitnami.com/bitnami
chart: postgresql chart: postgresql
targetRevision: 16.2.1 targetRevision: 16.2.1
helm: helm:
valueFiles: valueFiles:
- $values/postgresql-dev/helm-values.yaml - $values/postgresql-dev/helm-values.yaml
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git - repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
targetRevision: main targetRevision: main
ref: values ref: values
# Vault secrets from Git repository - repoURL: https://gitea0213.kro.kr/bluemayne/databases.git
- repoURL: https://gitea0213.kro.kr/bluemayne/databases.git targetRevision: main
targetRevision: main path: postgresql-dev
path: postgresql-dev
destination: destination:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
namespace: postgresql-dev namespace: postgresql-dev
syncPolicy: syncPolicy:
automated: automated:
prune: true prune: true
selfHeal: true selfHeal: true
allowEmpty: false allowEmpty: false
syncOptions: syncOptions:
- CreateNamespace=true - CreateNamespace=true
- PrunePropagationPolicy=foreground - PrunePropagationPolicy=foreground
- PruneLast=true - PruneLast=true
retry: retry:
limit: 5 limit: 5
backoff: backoff:
duration: 5s duration: 5s
factor: 2 factor: 2
maxDuration: 3m maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10 revisionHistoryLimit: 10

View File

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

@@ -4,50 +4,46 @@ metadata:
name: velero name: velero
namespace: argocd namespace: argocd
finalizers: finalizers:
- resources-finalizer.argocd.argoproj.io - resources-finalizer.argocd.argoproj.io
spec: spec:
project: default project: default
sources: sources:
- repoURL: https://vmware-tanzu.github.io/helm-charts - repoURL: https://vmware-tanzu.github.io/helm-charts
chart: velero chart: velero
targetRevision: 11.2.0 targetRevision: 11.2.0
helm: helm:
valueFiles: valueFiles:
- $values/velero/helm-values.yaml - $values/velero/helm-values.yaml
- repoURL: https://gitea0213.kro.kr/bluemayne/cluster-infrastructure.git - repoURL: https://gitea0213.kro.kr/bluemayne/cluster-infrastructure.git
targetRevision: main targetRevision: main
ref: values ref: values
- repoURL: https://gitea0213.kro.kr/bluemayne/cluster-infrastructure.git - repoURL: https://gitea0213.kro.kr/bluemayne/cluster-infrastructure.git
targetRevision: main targetRevision: main
path: velero path: velero
kustomize: {} kustomize: {}
destination: destination:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
namespace: velero namespace: velero
syncPolicy: syncPolicy:
automated: automated:
prune: true prune: true
selfHeal: true selfHeal: true
allowEmpty: false allowEmpty: false
syncOptions: syncOptions:
- CreateNamespace=true - CreateNamespace=true
- PrunePropagationPolicy=foreground - PrunePropagationPolicy=foreground
- PruneLast=true - PruneLast=true
- ServerSideApply=true - ServerSideApply=true
retry: retry:
limit: 5 limit: 5
backoff: backoff:
duration: 5s duration: 5s
factor: 2 factor: 2
maxDuration: 3m maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10 revisionHistoryLimit: 10
--- ---
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: Application kind: Application
@@ -55,14 +51,13 @@ metadata:
name: velero-ui name: velero-ui
namespace: argocd namespace: argocd
finalizers: finalizers:
- resources-finalizer.argocd.argoproj.io - resources-finalizer.argocd.argoproj.io
spec: spec:
project: default project: default
source: source:
repoURL: https://helm.otwld.com/ repoURL: https://helm.otwld.com/
chart: velero-ui chart: velero-ui
targetRevision: "*" targetRevision: '*'
helm: helm:
values: | values: |
image: image:
@@ -108,28 +103,26 @@ spec:
serviceAccount: serviceAccount:
create: true create: true
name: velero-ui name: velero-ui
destination: destination:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
namespace: velero namespace: velero
syncPolicy: syncPolicy:
automated: automated:
prune: true prune: true
selfHeal: true selfHeal: true
allowEmpty: false allowEmpty: false
syncOptions: syncOptions:
- CreateNamespace=false - CreateNamespace=true
- PrunePropagationPolicy=foreground - PrunePropagationPolicy=foreground
- PruneLast=true - PruneLast=true
- ServerSideApply=true - ServerSideApply=true
retry: retry:
limit: 5 limit: 5
backoff: backoff:
duration: 5s duration: 5s
factor: 2 factor: 2
maxDuration: 3m maxDuration: 3m
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
revisionHistoryLimit: 10 revisionHistoryLimit: 10

View File

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

View File

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