diff --git a/k8s/README.md b/k8s/README.md index 8533a42..69b6bf6 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -7,6 +7,7 @@ These manifests deploy `k8s-mgmt-pod` as a single-replica bastion deployment ins 1. Build and publish the image. 2. Replace the placeholder image in `deployment.yaml` with a pinned tag or digest. 3. Create the real `k8s-mgmt-pod-auth` Secret instead of applying `secret.yaml.example`. +4. The pod state directory is now backed by a PVC, so SSH host keys and generated fallback passwords survive pod recreation until you delete the claim. ## Create the Secret diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 3f23603..01e85f9 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -104,4 +104,5 @@ spec: volumes: - name: state - emptyDir: {} \ No newline at end of file + persistentVolumeClaim: + claimName: k8s-mgmt-pod-state \ No newline at end of file diff --git a/k8s/kustomization.yaml b/k8s/kustomization.yaml index 3687f1b..45d635a 100644 --- a/k8s/kustomization.yaml +++ b/k8s/kustomization.yaml @@ -5,6 +5,7 @@ resources: - namespace.yaml - serviceaccount.yaml - rbac.yaml + - pvc.yaml - deployment.yaml - service.yaml - networkpolicy.yaml diff --git a/k8s/pvc.yaml b/k8s/pvc.yaml new file mode 100644 index 0000000..c954184 --- /dev/null +++ b/k8s/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: k8s-mgmt-pod-state +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file