Upgrading CTE for Kubernetes with a Helm-based Installation
Introduction
Upgrading CTE for Kubernetes to the latest release is accomplished by invoking the deploy.sh script with the desired release tag. The CTE for Kubernetes node server cannot be automatically upgraded. Doing this will result in application failures for existing pods using CTE volumes on the nodes. You must use a manual procedure to stop the pods running on the nodes and delete the CTE for Kubernetes node server pods on that node.
Redeploy CTE for Kubernetes
To redeploy CTE for Kubernetes, type:
./deploy.sh -t <version#>.<build#>
For example:
./deploy.sh -t 1.5.0.31
Drain and update a node
To upgrade the nodes:
-
Get a list of nodes currently running CTE for Kubernetes, type:
kubectl get pods -n kube-system -o wide -l app=cte-csi-node --no-headers -o custom-columns=":spec.nodeName"Response Example:
control.example.com node1.example.com -
Drain a node from the list, type:
kubectl drain --delete-emptydir-data --ignore-daemonsets <nodeName>Response example:
node/node1.example.com cordoned node/node1.example.com drainedNote
The drain command pauses while it waits for the node to be drained.
-
Use a compound kubectl command to delete the CTE for Kubernetes node server on this node:
kubectl delete -n kube-system pod $(kubectl get pods -n kube-system --field-selector spec.nodeName=<nodeName> -l app=cte-csi-node --no-headers -o custom-columns=":metadata.name")-
The
kubectl get podsneeds to be bounded to only output the CTE for Kubernetes-node label for this node -
Use
--field-selector spec.nodeName=<nodeName>to specify the CTE for Kubernetes node to drain. -
Use
-l app=cte-csi-nodeto select only the CTE for Kubernetes node server from that node. -
Use
--no-headers -o custom-columns=":metadata.name"to tellkubectlto only output the pod names. -
Pass the output of that command to the
kubectl deletepod which triggers a new CTE for Kubernetes node server pod to be created with the desired image.
-
-
Verify that the pod has started successfully, type:
kubectl get pods -n kube-system --field-selector spec.nodeName=<nodeName> -l app=cte-csi-node -o wideResponse example:
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES cte-csi-node-kgwkj 4/4 Running 0 14m 192.168.77.163 node1.example.com <none> <none> -
Return node to working status, type:
kubectl uncordon <nodeName>Response example:
node/node1.example.com uncordoned