Skip to content
Lukas edited this page Feb 2, 2018 · 21 revisions

Welcome to the recast-docs wiki!

minikube start
eval $(minikube docker-env)

or create a new cluster on CERN OpenStack

you need
- CLUSTER_NAME
- KEYPAIR
- NODECOUNT
- SHARE_NAME
- SHARE_SIZE_GB
- SHARE_KEY
- SHARE_MONITOR_{1..N}

openstack coe cluster create --name [CLUSTER_NAME] --cluster-template kubernetes-alpha --keypair [KEYPAIR] --node-count [NODECOUNT]

manila create --share-type "Geneva CephFS Testing" --name [SHARE_NAME] cephfs [SHARE_SIZE_GB]
manila access-allow [SHARE_NAME] cephx storage_user

#get access key, monitor list, and path
manila access-list [SHARE_NAME]|grep storage_user
manila show [SHARE_NAME]|grep path

copy into deploy.yml

  CephFS:
    Path: '[SHARE_PATH]'
    User: 'storage_user'
    AuthKey: '[SHARE_KEY]'
    Monitors:
    - [SHARE_MONITOR_1]
    - [SHARE_MONITOR_2]
    - [SHARE_MONITOR_3]
helm init

For Production:

hostnames=(recast-control recast-frontend-beta yadage)

For Staging:

hostnames=(recast-control-staging recast-frontend-staging yadage-staging)

Setup Nodes and Deploy via Helm

minions=($(kubectl get no|grep minion|awk '{print $1}'|head -n3))
roles=(ccnode frontendnode yadagesvcnode)

for i in `seq 1 3`;do 
 kubectl label node $minions[$i] role=$roles[$i]
done

recast-cloud make_helm_values local_deploy.yml .. local_filled.yml
helm install ../../helm/recastchart -f local_filled.yml

Initialize Data

kubectl exec $(kubectl get pods|grep frontend |awk '{print $1}') \
-- recast-frontend-admin create_db -c /secrets/config/config.yaml

kubectl exec $(kubectl get pods|grep frontend |awk '{print $1}') \
-- recast-frontend-admin fill_db -c /secrets/config/config.yaml

kubectl exec -it $(kubectl get pods|grep control-center |awk '{print $1}') \
-- recast-control-center-admin rebuild_catalogue -c /secrets/config/config.yaml

Switch Hostnames

for i in `seq 1 3`;do
  oldhost=$(dig "$hostnames[$i]".cern.ch|grep CNAME|awk '{print $NF}'|sed 's|.cern.ch.||')
  if [ $oldhost  ]; then
    openstack server unset --property landb-alias $oldhost;
  else
    echo "no old host";
  fi
  openstack server set --property landb-alias=$hostnames[$i] $minions[$i]
done