Upgrading CTE for Kubernetes
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.0.0.1223
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:
ub20-master ub20-work1
-
Drain a node from the list, type:
kubectl drain --delete-emptydir-data --ignore-daemonsets <nodeName>
Note
The drain command pauses while it waits for the node to be drained.
Response example:
node/ub20-work1 cordoned node/ub20-work1 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 pods
needs 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-node
to select only the CTE for Kubernetes node server from that node. -
Use
--no-headers -o custom-columns=":metadata.name"
to tellkubectl
to only output the pod names. -
Pass the output of that command to the
kubectl delete
pod 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 wide
Response 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 ub20-work1 <none> <none>
-
Return node to working status, type:
kubectl uncordon <nodeName>
Response example:
node/ub20-work1 uncordoned