Skip to content

Commit

Permalink
[controller] Add resource CSIDriver with new provisioner, remove reso…
Browse files Browse the repository at this point in the history
…urce CSIDriver with old provisioner, and implement additional kubelet restart (#163)

Signed-off-by: v.oleynikov <[email protected]>
Signed-off-by: Aleksandr Zimin <[email protected]>
Co-authored-by: Aleksandr Zimin <[email protected]>
  • Loading branch information
duckhawk and AleksZimin authored Aug 15, 2024
1 parent 94c9ba6 commit 33261de
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hooks/migrate_csi_endpoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ run_trigger() {
exit 1
fi

if kubectl delete csidriver ${OLD_DRIVER_NAME} > /dev/null 2>&1; then
echo "CSIDriver ${OLD_DRIVER_NAME} deleted"
else
echo "CSIDriver ${OLD_DRIVER_NAME} does not exist. Skipping deletion"
fi

values::set sdsReplicatedVolume.internal.csiMigrationHook.completed "true"
exit 0
}
Expand Down
13 changes: 13 additions & 0 deletions templates/linstor-csi/csidriver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: replicated.csi.storage.deckhouse.io
spec:
attachRequired: true
fsGroupPolicy: ReadWriteOnceWithFSType
podInfoOnMount: true
requiresRepublish: false
seLinuxMount: true
storageCapacity: true
volumeLifecycleModes:
- Persistent
7 changes: 7 additions & 0 deletions templates/nodegroupconfiguration-restart-kubelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ spec:
if [ "$is_kubelet_restart_needed" = "true" ]; then
echo "Kubelet restart is needed. Restarting kubelet."
systemctl restart kubelet
echo "Sleeping for 180 seconds before restarting kubelet again."
sleep 180
echo "Restarting kubelet again."
systemctl restart kubelet
bb-kubectl --kubeconfig $kubeconfig label node "$(hostname -s)" "$LABEL_KEY"-
else
echo "Kubelet restart is not needed. Exiting."
Expand Down

0 comments on commit 33261de

Please sign in to comment.