Portal:Cloud VPS/Admin/Runbooks/Magnum
Magnum is an openstack service running on cloudcontrols which calls out to a cloud-hosted kubernetes cluster to do the actual work. The full explanation of the moving parts is at Portal:Cloud VPS/Admin/Magnum setup.
The config for the worker cluster is kept on cloudcontrols in /var/lib/magnum/.kube/config -- the wrapper wmcs-magnum-kubectl will automatically use that config.
Magnum infra reports as down
Error/Incident
This alert is the openstack prometheus exporter reporting that the magnum service is down. This is probably firing because the magnum API is unreachable.
Fixing
- Check that magnum api service is running on cloudcontrol nodes. systemctl status magnum-api
- Check that haproxy on cloudlb nodes can reach the api, by searching for 'magnum' in the haproxy logs. journalctl -u haproxy.service | grep magnum
- Test magnum access via the openstack cli on a cloudcontrol. sudo wmcs-openstack coe cluster list (may be empty in codfw1dev)
- Look for frequent errors or crashes in magnum-api logs on cloudcontrol nodes: /var/log/magnum/magnum-api.log
It's possible this is firing because magnum-conductor is down. Conductor is a simple service that largely marshalls calls directly to the capi worker.
- Check that magnum conductor service is running on cloudcontrol nodes. $ systemctl status magnum-conductor
- Look for frequent errors or crashes in magnum-conductor logs on cloudcontrol nodes: /var/log/magnum/magnum-conductor.log
Magnum cluster api worker node is not ready
Error/Incident
This fires when the k3s cluster running cluster-api is down or unreachable. The worker runs on a VM in the 'magnum' project.
Fixing
- Make sure the VM hosting cluster-api is running.
- Consider a full rebuild of the cluster-api worker. It's pretty quick and there's no state to lose on the worker node.
- The kube config for the worker cluster is installed on a cloudcontrol in /var/lib/magnum/.kube/config -- make sure that the installed kubeconf is valid for the current worker cluster. Double-check the server: ip!
- For fine-grained debugging, use the kube config to dig into the cluster itself.
andrew@cloudcontrol1011:~$ sudo wmcs-magnum-kubectl get pods --all-namespaces
No capi pod running in the magnum cluster api worker cluster
Error/Incident
There should be at least one pod in the capi-system namespace running on the cluster-api worker cluster. This alert fires if that pod is down.
The capi-system pod is in charge of deploying the necessary bits of a kubernetes cluster.
Fixing
- Use the kube config on a cloudcontrol to dig into the kubernetes cluster.
andrew@cloudcontrol1011:~$ sudo wmcs-magnum-kubectl get pods --all-namespaces
No capo pod running in the magnum cluster api worker cluster
Error/Incident
There should be at least one pod in the capo-system namespace running on the cluster-api worker cluster. This alert fires if that pod is down.
The capo-system pod knows how to call back to openstack and create the cloud resources necessary for hosting a kubernetes cluster.
Fixing
- Use the kube config on a cloudcontrol to dig into the kubernetes cluster.
andrew@cloudcontrol1011:~$ sudo wmcs-magnum-kubectl get pods --all-namespaces
Cluster creation fails
Error/Incident
This won't produce an actual alert; most likely a user will report the issue.
Fixing
If the user is using a custom template then troubleshooting should start there. Often it's as simple as correcting the 'kube_tag' label.
For deeper debugging of the failure, investigate the capi worker logs. The interesting bits are most likely to be in the capi namespace (this namespace orchestrates the various k8s components) or the capo namespace (which marshalls capi needs back to openstack as API calls).
$ sudo wmcs-magnum-kubectl get pods --all-namespaces
$ # Note pod ID in the capo-system name space
$ sudo wmcs-magnum-kubectl logs -n capo-system <pod-id>
Related information
Old incidents
Add your incident here:
