REFACTOR(goldilocks): use managedNamespaceMetad...

- 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 ac2abde8b5
commit 5ec1a3323d
27 changed files with 164 additions and 271 deletions

View File

@@ -7,40 +7,35 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Helm chart from external repository
- repoURL: https://prometheus-community.github.io/helm-charts
chart: alertmanager
targetRevision: 1.29.0
helm:
valueFiles:
- $values/alertmanager/helm-values.yaml
# Values file from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/monitoring.git
targetRevision: main
ref: values
destination:
server: https://kubernetes.default.svc
namespace: alertmanager
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,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: alertmanager
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -7,48 +7,41 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Helm chart from external repository
- repoURL: https://charts.fairwinds.com/stable
chart: goldilocks
targetRevision: 8.0.2
helm:
valueFiles:
- $values/goldilocks/helm-values.yaml
# Values file from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/monitoring.git
targetRevision: main
ref: values
destination:
server: https://kubernetes.default.svc
namespace: goldilocks
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
- RespectIgnoreDifferences=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
# Ignore Deployment differences for CPU limits (set to null)
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
ignoreDifferences:
- group: apps
kind: Deployment
jqPathExpressions:
- '.spec.template.spec.containers[].resources.limits.cpu'
- .spec.template.spec.containers[].resources.limits.cpu
revisionHistoryLimit: 10

View File

@@ -1,6 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- ingress.yaml

View File

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

View File

@@ -7,44 +7,38 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Helm chart from external repository
- repoURL: https://grafana.github.io/helm-charts
chart: grafana
targetRevision: 10.3.0
helm:
valueFiles:
- $values/grafana/helm-values.yaml
# Values file from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/monitoring.git
targetRevision: main
ref: values
# Additional resources (ExternalSecret, Ingress, etc.)
- repoURL: https://gitea0213.kro.kr/bluemayne/monitoring.git
targetRevision: main
path: grafana
destination:
server: https://kubernetes.default.svc
namespace: grafana
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/grafana-admin-password.yaml
- ingress.yaml

View File

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

View File

@@ -7,40 +7,35 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Helm chart from external repository
- repoURL: https://prometheus-community.github.io/helm-charts
chart: kube-state-metrics
targetRevision: 5.25.1
helm:
valueFiles:
- $values/kube-state-metrics/helm-values.yaml
# Values file from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/monitoring.git
targetRevision: main
ref: values
destination:
server: https://kubernetes.default.svc
namespace: kube-state-metrics
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,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: kube-state-metrics
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -24,3 +24,6 @@ spec:
selfHeal: true
syncOptions:
- CreateNamespace=true
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'

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: loki
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -7,40 +7,35 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Helm chart from external repository
- repoURL: https://prometheus-community.github.io/helm-charts
chart: prometheus-node-exporter
targetRevision: 4.39.0
helm:
valueFiles:
- $values/node-exporter/helm-values.yaml
# Values file from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/monitoring.git
targetRevision: main
ref: values
destination:
server: https://kubernetes.default.svc
namespace: node-exporter
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,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: node-exporter
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -7,44 +7,38 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Helm chart from external repository
- repoURL: https://prometheus-community.github.io/helm-charts
chart: kube-prometheus-stack
targetRevision: 80.0.0
helm:
valueFiles:
- $values/prometheus/helm-values.yaml
# Values file from Git repository
- repoURL: https://gitea0213.kro.kr/bluemayne/monitoring.git
targetRevision: main
ref: values
# Additional resources (ExternalSecret, etc.)
- repoURL: https://gitea0213.kro.kr/bluemayne/monitoring.git
targetRevision: main
path: prometheus
destination:
server: https://kubernetes.default.svc
namespace: prometheus
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,6 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- vault/postgresql-password.yaml

View File

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

View File

@@ -24,3 +24,6 @@ spec:
selfHeal: true
syncOptions:
- CreateNamespace=true
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'

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: promtail
labels:
goldilocks.fairwinds.com/enabled: "true"

View File

@@ -7,48 +7,41 @@ metadata:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# Helm chart from external repository
- repoURL: https://charts.fairwinds.com/stable
chart: vpa
targetRevision: 4.6.0
helm:
valueFiles:
- $values/vpa/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: vpa
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
- RespectIgnoreDifferences=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
# Ignore Deployment differences for CPU limits (set to null)
managedNamespaceMetadata:
labels:
goldilocks.fairwinds.com/enabled: 'true'
ignoreDifferences:
- group: apps
kind: Deployment
jqPathExpressions:
- '.spec.template.spec.containers[].resources.limits.cpu'
- .spec.template.spec.containers[].resources.limits.cpu
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: vpa
labels:
goldilocks.fairwinds.com/enabled: "true"