Shut down all Kubernetes Pods using Longhorn volumes in order to detach the volumes. The easiest way to achieve this is by deleting all workloads and recreate them later after upgrade. If this is not desirable, some workloads may be suspended.
In this section, you’ll learn how each workload can be modified to shut down its pods.
Deployment
Edit the deployment with .
Set .spec.replicas
to 0
.
StatefulSet
Edit the statefulset with kubectl edit statefulset/<name>
.
Set .spec.replicas
to 0
.
DaemonSet
Delete the daemonset with .
Pod
Delete the pod with kubectl delete pod/<name>
.
There is no way to suspend a pod not managed by a workload controller.
CronJob
Edit the cronjob with kubectl edit cronjob/<name>
.
Set .spec.suspend
to true
.
Wait for any currently executing jobs to complete, or terminate them by deleting relevant pods.
Job
Otherwise, delete the job with kubectl delete job/<name>
.
ReplicaSet
Edit the replicaset with .
Set .spec.replicas
to 0
.
ReplicationController
Edit the replicationcontroller with kubectl edit rc/<name>
.
Set .spec.replicas
to 0
.
Wait for the volumes using by the Kubernetes to complete detaching.