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