refactor: move embedded Kubernetes manifests to role templates
Some checks failed
Deploy Cluster / Terraform (push) Successful in 1m38s
Deploy Cluster / Ansible (push) Failing after 9m46s

This commit is contained in:
2026-03-02 01:45:30 +00:00
parent b30977a158
commit 58fabf23f8
7 changed files with 134 additions and 125 deletions

View File

@@ -173,56 +173,14 @@
when: csi_smoke_test_enabled | bool
- name: Apply CSI smoke test resources
shell: |
kubectl apply -f - <<'EOF'
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ csi_smoke_test_storage_class }}
provisioner: csi.hetzner.cloud
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ csi_smoke_test_pvc_name }}
namespace: kube-system
labels:
app.kubernetes.io/name: csi-smoke
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ csi_smoke_test_size }}
storageClassName: {{ csi_smoke_test_storage_class }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ csi_smoke_test_job_name }}
namespace: kube-system
labels:
app.kubernetes.io/name: csi-smoke
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: write-and-read
image: busybox:1.36
command: ["/bin/sh", "-c", "echo csi-ok > /data/health && cat /data/health"]
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ csi_smoke_test_pvc_name }}
EOF
template:
src: csi-smoke.yaml.j2
dest: /tmp/csi-smoke.yaml
mode: "0644"
when: csi_smoke_test_enabled | bool
- name: Apply CSI smoke test manifests
command: kubectl apply -f /tmp/csi-smoke.yaml
changed_when: true
when: csi_smoke_test_enabled | bool