-
Notifications
You must be signed in to change notification settings - Fork 107
WMCore services upgrade in kubernetes
This wiki is meant to provide you with:
- a checklist for upgrading WMCore services in CMSWEB testbed and/or production;
- a simple step-by-step procedure.
For further material, please visit the other WMCore wiki pages:
or the detailed instructions provided by the CMSWEB team:
When deploying WMCore services in the CMSWEB pre-production and/or production clusters, please make sure the following steps are performed:
- Ensure that all the relevant docker images have been successfully created and uploaded to the CERN registry. Also make sure the required docker tag is available.
- Check whether all the relevant services configuration have been merged in the services_config repository, under the correct branch.
- Log in to lxplus8, set the kubernetes token and load the required kubernetes environment (prod, preprod, testX).
- Check whether you are pointing to the correct cluster environment with
kubectl config get-clusters | grep -v NAME
- Clone the services_config repository and checkout the required branch (prod, preprod, test).
- Clone the CMSKubernetes repository.
- Define the list of services to be upgraded. This deployment uses the variable named
serviceList
for that. - IF required, update the services secrets with the script
./scripts/deploy-secrets.sh
. - Finally, update the WMCore services - under the
dmwm
namespace - with the script./scripts/deploy-srv.sh
. - IF couchapp changes are required, you need to log in to each CouchDB VM and run the command below (update the WMCore tag name):
sudo -H -u _couchdb bashs -l -c '/data/srv/current/config/couchdb/manage updatecouchapps 2.1.4.pre6 "I did read documentation"'
The next section assumes that you are familiar with the environment requirements (token/cluster setup, configuration repository, kubernetes repository).
Here is an exhaustive list of all the current WMCore central services that we deploy in CMSWEB kubernetes clusters, which you should set in your terminal for the subsequent steps in this wiki. They are:
$ SERVICE_LIST="reqmgr2 \
reqmgr2-tasks \
reqmgr2ms-monitor \
reqmgr2ms-transferor \
reqmgr2ms-rulecleaner \
reqmgr2ms-output \
reqmgr2ms-pileup \
reqmgr2ms-unmerged-t1 \
reqmgr2ms-unmerged-t2t3us \
reqmgr2ms-unmerged-t2t3 \
workqueue \
reqmon \
t0_reqmon \
t0_reqmon-tasks \
reqmon-tasks"
This step is only required when there are changes to the services configuration (made to the services_config repository, in the relevant branch).
Once you have defined the list of services to deploy - called as SERVICE_LIST
from the step above - and that you have cloned and checked out the correct services_config branch, you can deploy their secrets (service configuration and database credentials) with the following command:
for service in $SERVICE_LIST
do
echo "Deploying secrets for $service"
./scripts/deploy-secrets.sh dmwm $service $HOME/private/cmsweb-deploy/services_config
echo ""
done
Note that Kubernetes detects configuration changes. In case there are no new changes with relation to what has already been deployed, nothing will change and the AGE of your secrets will remain the same.
Now with the relevant WMCore service list defined (as SERVICE_LIST
) and the proper secrets in place, you can deploy all of the WMCore services with the following command; WAIT, before that, make sure you define the correct WMCore tag below TAG
:
TAG=X.Y.ZrcX
for service in $SERVICE_LIST
do
echo "Deploying service $service with tag $TAG"
./scripts/deploy-srv.sh $service $TAG
echo ""
done
This deploy-srv.sh
script will automatically delete any outdated service POD and deploy the new tag for your service(s).
Lastly, you can check the status of these services and their PODs with the following command:
kubectl get pods -n dmwm
note that it takes quite a few seconds to properly terminate old PODs and load in new containers.