-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from in tree to csi #448
base: main
Are you sure you want to change the base?
Conversation
… to developers and operators
…tches the nginx deployment to use it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shellcheck
📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086
dpl-platform/infrastructure/dpladm/bin/csi-migration-scripts/deleteOldPvAndPvc.sh
Line 14 in 952de06
kubectl get pvc -n $NAMESPACE $PVC_NAME -o yaml > "./pvAndPvcBackup/${NAMESPACE}_${PVC_NAME}.yaml" |
📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086
dpl-platform/infrastructure/dpladm/bin/csi-migration-scripts/deleteOldPvAndPvc.sh
Line 15 in 952de06
kubectl get pv $VOLUME_NAME -o yaml > "./pvAndPvcBackup/${NAMESPACE}_${VOLUME_NAME}" |
📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086
dpl-platform/infrastructure/dpladm/bin/csi-migration-scripts/deleteOldPvAndPvc.sh
Line 17 in 952de06
kubectl delete pvc -n $NAMESPACE $PVC_NAME --wait=false |
📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086
dpl-platform/infrastructure/dpladm/bin/csi-migration-scripts/deleteOldPvAndPvc.sh
Line 17 in 952de06
kubectl delete pvc -n $NAMESPACE $PVC_NAME --wait=false |
📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086
dpl-platform/infrastructure/dpladm/bin/csi-migration-scripts/deleteOldPvAndPvc.sh
Line 18 in 952de06
kubectl patch pvc -n $NAMESPACE $PVC_NAME -p '{"metadata":{"finalizers":null}}' |
📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086
dpl-platform/infrastructure/dpladm/bin/csi-migration-scripts/deleteOldPvAndPvc.sh
Line 18 in 952de06
kubectl patch pvc -n $NAMESPACE $PVC_NAME -p '{"metadata":{"finalizers":null}}' |
📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086
dpl-platform/infrastructure/dpladm/bin/csi-migration-scripts/deleteOldPvAndPvc.sh
Line 20 in 952de06
kubectl delete pv $VOLUME_NAME --grace-period=0 --wait=false |
📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086
dpl-platform/infrastructure/dpladm/bin/csi-migration-scripts/deleteOldPvAndPvc.sh
Line 21 in 952de06
kubectl patch pv $VOLUME_NAME -p '{"metadata":{"finalizers":null}}' |
NAMESPACES=$(kubectl get ns -l lagoon.sh/controller=lagoon --no-headers | awk '{print $1}' | grep main) | ||
VOLUMEHANDLE_PREFIX="/subscriptions/8ac8a259-5bb3-4799-bd1e-455145b12550/resourceGroups/rg-env-dplplat01/providers/Microsoft.Storage/storageAccounts/stdpldplplat01585708af/" | ||
for ns in $NAMESPACES; do | ||
echo $ns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for ns in $NAMESPACES; do | ||
echo $ns | ||
# Get pvc variable | ||
SHARE_NAME=$(kubectl get pvc -n $ns tmp-nginx | grep pvc | awk '{print $3}' | cut -c 5- ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHARE_NAME=$(kubectl get pvc -n $ns tmp-nginx | grep pvc | awk '{print $3}' | cut -c 5- ) | ||
# echo $SHARE_NAME | ||
|
||
PROJECT_NAME=$(echo $ns | rev | cut -c 6- | rev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubectl apply -f pv.yaml | ||
kubectl apply -f pvc.yaml | ||
|
||
kubectl patch deployments.apps -n $ns cli -p '{"spec":{"template":{"spec": {"volumes": [{"name": "nginx", "persistentVolumeClaim": { "claimName": "nginx"}}]}}}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubectl apply -f pvc.yaml | ||
|
||
kubectl patch deployments.apps -n $ns cli -p '{"spec":{"template":{"spec": {"volumes": [{"name": "nginx", "persistentVolumeClaim": { "claimName": "nginx"}}]}}}}' | ||
kubectl patch deployments.apps -n $ns nginx -p '{"spec":{"template":{"spec": {"volumes": [{"name": "nginx", "persistentVolumeClaim": { "claimName": "nginx"}}]}}}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Change it's name slighty so we can recognize it from the old ones | ||
NEW="new-" | ||
NEW_VOLUME_NAME=${NEW}${VOLUME_NAME} | ||
echo $NEW_VOLUME_NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubectl apply -f pvc.yaml | ||
|
||
# Switch the nginx deployments nginx volume to use the new PVC | ||
kubectl patch deployments.apps -n $1 nginx -p '{"spec":{"template":{"spec": {"volumes": [{"name": "nginx", "persistentVolumeClaim": { "claimName": "new-nginx"}}]}}}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
echo "Proceeding to remove the now obsolete PV and PVC from the namespace $1" | ||
|
||
backupAndDeleteOldPvAndPvc $1 $VOLUME_NAME "nginx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
echo "Proceeding to remove the now obsolete PV and PVC from the namespace $1" | ||
|
||
backupAndDeleteOldPvAndPvc $1 $VOLUME_NAME "nginx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local PVC_NAME=$3 | ||
|
||
# Backup the the old PVC and PV before deleting them | ||
kubectl get pvc -n $NAMESPACE $PVC_NAME -o yaml > "./pvAndPvcBackup/${NAMESPACE}_${PVC_NAME}.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubectl get pvc -n $NAMESPACE $PVC_NAME -o yaml > "./pvAndPvcBackup/${NAMESPACE}_${PVC_NAME}.yaml" | ||
kubectl get pv $VOLUME_NAME -o yaml > "./pvAndPvcBackup/${NAMESPACE}_${VOLUME_NAME}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shellcheck (suggestion)] reported by reviewdog 🐶
kubectl get pvc -n $NAMESPACE $PVC_NAME -o yaml > "./pvAndPvcBackup/${NAMESPACE}_${PVC_NAME}.yaml" | |
kubectl get pv $VOLUME_NAME -o yaml > "./pvAndPvcBackup/${NAMESPACE}_${VOLUME_NAME}" | |
kubectl get pvc -n "$NAMESPACE" "$PVC_NAME" -o yaml > "./pvAndPvcBackup/${NAMESPACE}_${PVC_NAME}.yaml" | |
kubectl get pv "$VOLUME_NAME" -o yaml > "./pvAndPvcBackup/${NAMESPACE}_${VOLUME_NAME}" |
kubectl delete pvc -n $NAMESPACE $PVC_NAME --wait=false | ||
kubectl patch pvc -n $NAMESPACE $PVC_NAME -p '{"metadata":{"finalizers":null}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shellcheck (suggestion)] reported by reviewdog 🐶
kubectl delete pvc -n $NAMESPACE $PVC_NAME --wait=false | |
kubectl patch pvc -n $NAMESPACE $PVC_NAME -p '{"metadata":{"finalizers":null}}' | |
kubectl delete pvc -n "$NAMESPACE" "$PVC_NAME" --wait=false | |
kubectl patch pvc -n "$NAMESPACE" "$PVC_NAME" -p '{"metadata":{"finalizers":null}}' |
kubectl delete pv $VOLUME_NAME --grace-period=0 --wait=false | ||
kubectl patch pv $VOLUME_NAME -p '{"metadata":{"finalizers":null}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shellcheck (suggestion)] reported by reviewdog 🐶
kubectl delete pv $VOLUME_NAME --grace-period=0 --wait=false | |
kubectl patch pv $VOLUME_NAME -p '{"metadata":{"finalizers":null}}' | |
kubectl delete pv "$VOLUME_NAME" --grace-period=0 --wait=false | |
kubectl patch pv "$VOLUME_NAME" -p '{"metadata":{"finalizers":null}}' |
What does this PR do?
These are the scripts we have used to move to the new CSI
Should this be tested by the reviewer and how?
no
Any specific requests for how the PR should be reviewed?
read it
What are the relevant tickets?
https://reload.atlassian.net/jira/software/c/projects/DDFDRIFT/boards/464?search=csi&selectedIssue=DDFDRIFT-189