From 8fdcbe17a8bf521742e4aa96b8fd35f3d5171313 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Mon, 5 Feb 2024 21:33:58 +0100
Subject: [PATCH] fix(vpa): Adjust paths for admissioncontroller TLS
 certificates

---
 infrastructure/vpa/admissioncontroller-patch.yaml | 12 ++++++++++++
 infrastructure/vpa/kustomization.yaml             |  6 ++++++
 2 files changed, 18 insertions(+)
 create mode 100644 infrastructure/vpa/admissioncontroller-patch.yaml

diff --git a/infrastructure/vpa/admissioncontroller-patch.yaml b/infrastructure/vpa/admissioncontroller-patch.yaml
new file mode 100644
index 000000000..fe74d0880
--- /dev/null
+++ b/infrastructure/vpa/admissioncontroller-patch.yaml
@@ -0,0 +1,12 @@
+- op: add
+  path: /spec/template/spec/containers/0/args
+  value: []
+- op: add
+  path: /spec/template/spec/containers/0/args/-
+  value: --client-ca-file=/etc/tls-certs/ca.crt
+- op: add
+  path: /spec/template/spec/containers/0/args/-
+  value: --tls-private-key=/etc/tls-certs/tls.key
+- op: add
+  path: /spec/template/spec/containers/0/args/-
+  value: --tls-cert-file=/etc/tls-certs/tls.crt
\ No newline at end of file
diff --git a/infrastructure/vpa/kustomization.yaml b/infrastructure/vpa/kustomization.yaml
index ccb0a0498..5b8c97753 100644
--- a/infrastructure/vpa/kustomization.yaml
+++ b/infrastructure/vpa/kustomization.yaml
@@ -18,6 +18,12 @@ patches:
       version: v1
       group: apps
       kind: Deployment
+  - path: admissioncontroller-patch.yaml
+    target:
+      version: v1
+      group: apps
+      kind: Deployment
+      name: vpa-admission-controller
 
 components:
   - ../../shared/components/namespace-restricted
-- 
GitLab