You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the cluster-backup repo, I was able to migrate the users from one instance of Workbench to another. The API server throws a 500 exception when trying to pull from /accounts, since the user's ResourceQuota does not exist and cannot be read. Furthermore any existing stacks needed to be wiped out, since their services were not migrated properly.
This could easily be fixed by having the API server create resources where they do exist.
The text was updated successfully, but these errors were encountered:
bodom0015
changed the title
initExistingUsers needs to create ResourceQuotas
initExistingUsers needs to create ResourceQuotas and Services
Apr 19, 2019
Got bit by this again during the CHEESEhub production migration/redeploy. PVCs are also now missing for existing users as well.
Solution for services was to not migrate any existing stacks. This created a different problem where etcd imported empty directories as empty files instead. Manually deleting these empty files caused them to be recreated properly the next time.
For now, the other resources can be created using a script I threw together (be sure to include userreg.yaml in the same directory):
ubuntu@cheesehub-master:~$ cat post-migration.sh
## Given a list of names from etcd, ensure they have a namespace and PVC available## Usage: ./post-migration.sh##set -e
# Fetch a sorted list of users from etcd
usernames=$(kubectl exec -it deploy/workbench -c etcd -- etcdctl ls /ndslabs/accounts | awk -F '[/\r]''{print $4}')echo Importing the following users:
echo"$usernames"read -p "Press enter to continue or Ctrl+C to abort"||echo# Fail-fast for empty list or errorif [ "$usernames"=="" ];thenecho"No usernames given for import... aborting."exit 1
fi# For each username, apply a PVC and NS to ensure that one existsforusernamein$usernames;doecho"Importing $username..."
cat userreg.yaml | sed -e "s#{{USERNAME}}#$username#g"| kubectl apply -f -
done
ubuntu@cheesehub-master:~$ cat userreg.yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: {{USERNAME}}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{USERNAME}}-home
namespace: {{USERNAME}}
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Mi
---
apiVersion: v1
kind: ResourceQuota
metadata:
name: quota
namespace: {{USERNAME}}
spec:
hard:
cpu: "2"
memory: 8196M
status:
hard:
cpu: "2"
memory: 8196M
Using the
cluster-backup
repo, I was able to migrate the users from one instance of Workbench to another. The API server throws a 500 exception when trying to pull from/accounts
, since the user's ResourceQuota does not exist and cannot be read. Furthermore any existing stacks needed to be wiped out, since their services were not migrated properly.This could easily be fixed by having the API server create resources where they do exist.
The text was updated successfully, but these errors were encountered: