diff --git a/workloads/headlamp/kustomization.yaml b/workloads/headlamp/kustomization.yaml index 9f8248b..a599337 100644 --- a/workloads/headlamp/kustomization.yaml +++ b/workloads/headlamp/kustomization.yaml @@ -1,9 +1,33 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -# Esto fuerza a que todos los recursos remotos caigan en nuestro namespace seguro +# Fuerza a todos los recursos al namespace headlamp namespace: headlamp resources: - https://raw.githubusercontent.com/kubernetes-sigs/headlamp/main/kubernetes-headlamp.yaml - - ingress.yaml \ No newline at end of file + - ingress.yaml + +# Inyectamos el kubeconfig como un volumen montado desde el secreto +patches: + - target: + kind: Deployment + name: headlamp + patch: |- + - op: add + path: /spec/template/spec/volumes/- + value: + name: kubeconfig-vol + secret: + secretName: headlamp-kubeconfig + - op: add + path: /spec/template/spec/containers/0/volumeMounts/- + value: + name: kubeconfig-vol + mountPath: /home/headlamp/.config/Headlamp/kubeconfigs/config + subPath: config + - op: add + path: /spec/template/spec/containers/0/env/- + value: + name: KUBECONFIG + value: /home/headlamp/.config/Headlamp/kubeconfigs/config \ No newline at end of file