From 27479af5aa4e6cdf8399c8a2341e3876024f09e5 Mon Sep 17 00:00:00 2001 From: Mayne0213 Date: Sun, 28 Dec 2025 23:44:13 +0900 Subject: [PATCH] FEAT(goldilocks): add vpa and goldilocks - for resource optimization - Add VPA (Vertical Pod Autoscaler) for automatic resource recommendation - Add Goldilocks dashboard for visualizing VPA recommendations - Update kustomization.yaml to include both applications --- vpa/argocd/vpa.yaml | 46 +++++++++++++++++++++++++++++++++++++++ vpa/helm-values/vpa.yaml | 47 ++++++++++++++++++++++++++++++++++++++++ vpa/kustomization.yaml | 6 +++++ 3 files changed, 99 insertions(+) create mode 100644 vpa/argocd/vpa.yaml create mode 100644 vpa/helm-values/vpa.yaml create mode 100644 vpa/kustomization.yaml diff --git a/vpa/argocd/vpa.yaml b/vpa/argocd/vpa.yaml new file mode 100644 index 0000000..8afbfc2 --- /dev/null +++ b/vpa/argocd/vpa.yaml @@ -0,0 +1,46 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: vpa + namespace: argocd + finalizers: + - 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/vpa.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 + + retry: + limit: 5 + backoff: + duration: 5s + factor: 2 + maxDuration: 3m + + revisionHistoryLimit: 10 diff --git a/vpa/helm-values/vpa.yaml b/vpa/helm-values/vpa.yaml new file mode 100644 index 0000000..dda7620 --- /dev/null +++ b/vpa/helm-values/vpa.yaml @@ -0,0 +1,47 @@ +# VPA Helm Values +# Reference: https://github.com/FairwindsOps/charts/tree/master/stable/vpa + +# Recommender - recommends resource requests based on historical usage +recommender: + enabled: true + replicaCount: 1 + + resources: + limits: + cpu: null + memory: 1Gi + requests: + cpu: 50m + memory: 512Mi + +# Updater - applies recommended resource requests to pods +updater: + enabled: true + replicaCount: 1 + + resources: + limits: + cpu: null + memory: 1Gi + requests: + cpu: 50m + memory: 512Mi + +# Admission Controller - injects resource requests into new pods +admissionController: + enabled: true + replicaCount: 1 + + resources: + limits: + cpu: null + memory: 512Mi + requests: + cpu: 50m + memory: 256Mi + + # Generate self-signed certificate + generateCertificate: true + +# Optional: Configure default VPA behavior +# metrics-server should be installed in the cluster diff --git a/vpa/kustomization.yaml b/vpa/kustomization.yaml new file mode 100644 index 0000000..5a7a8b7 --- /dev/null +++ b/vpa/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + # ArgoCD Application 리소스는 infrastructure/kustomization.yaml에서 관리 + # - argocd/vpa.yaml