- Apply the Kubernetes Job that creates the checkpoint and the PVC it stores the data on.
kubectl apply -f k8s-job-and-pvc.yaml
- Wait until the Job completed
kubectl get job create-checkpoint
- Apply the Knative Service or as an alternative the Pod the restores the checkpoint.
kubectl apply -f restore-pod.yaml
Knative alternative:
Before applying the kService, you have to edit the config-features
configmap to enable the following confguration.
kubectl edit cm -n knative-serving config-features
kubernetes.containerspec-addcapabilities: enabled
kubernetes.podspec-securitycontext: enabled
kubernetes.podspec-persistent-volume-claim: "enabled"
kubernetes.podspec-persistent-volume-write: "enabled"
kubernetes.podspec-fieldref: "enabled"
kubectl apply -f restore-kservice.yaml
- Inspect the logs of application