Содержание
RabbitMQ
k8s
Helm Bitnami - https://github.com/bitnami/charts/tree/master/bitnami/rabbitmq
Показать конфигурацию:
kubectl exec dvs-rabbitmq-0 -- cat /bitnami/rabbitmq/conf/rabbitmq.conf kubectl exec dvs-rabbitmq-0 -- cat /app/load_definition.json
или из secrets:
kubectl get secret dvs-rabbitmq-config -o json | jq -r '.data."rabbitmq.conf" | @base64d' kubectl get secret load-definition -o json | jq -r '.data."load_definition.json" | @base64d'
Обновить RabbitMQ (на примере до 4.1.0) через Operator:
kubectl -n ${NAMESPACE} patch RabbitmqCluster/dvs-rabbitmq -p '{"spec":{"image":"docker.io/bitnami/rabbitmq:4.1.0-debian-12-r0"}}' --type=merge
Удалить все crd:
kubectl delete crd $(kubectl api-resources --api-group=rabbitmq.com -o name)
ha
rabbitmqctl
https://www.rabbitmq.com/rabbitmqctl.8.html
Показать политики:
rabbitmqctl list_policies
Показать плагины:
rabbitmq-plugins list
Credentials & Passwords
Проблемы
Error while waiting for Mnesia tables
Решение: Запустить с --set clustering.forceBoot=true (переменная RABBITMQ_FORCE_BOOT=yes). После обновить в k8s c PDB=true.
https://www.rabbitmq.com/rabbitmqctl.8.html#force_boot
https://stackoverflow.com/questions/60407082/rabbit-mq-error-while-waiting-for-mnesia-tables
failed to delete user/permission/policy
После удаления:
kubectl describe user.rabbitmq.com/${USER} -n ${NAMESPACE} kubectl describe permission.rabbitmq.com/${USER} -n ${NAMESPACE} kubectl describe policy.rabbitmq.com/${POLICY} -n ${NAMESPACE}
Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedDelete 16m (x5 over 66m) user-controller failed to delete user Warning FailedDelete 2m5s (x11 over 140m) permission-controller failed to delete permission Normal SuccessfulDelete 5m6s (x10 over 138m) policy-controller successfully deleted policy
При обновлении helm:
Error: UPGRADE FAILED: an error occurred while rolling back the release. original upgrade error:
cannot patch «${USER}» with kind Permission: Internal error occurred: failed calling webhook «vpermission.kb.io»: failed to call webhook: Post «https://rmqco-rabbitmq-messaging-topology-operator-webhook.dev.svc:443/validate-rabbitmq-com-v1beta1-permission?timeout=10s»: service «rmqco-rabbitmq-messaging-topology-operator-webhook» not found
&& cannot patch «${POLICY}» with kind Policy: Internal error occurred: failed calling webhook «vpolicy.kb.io»: failed to call webhook: Post «https://rmqco-rabbitmq-messaging-topology-operator-webhook.dev.svc:443/validate-rabbitmq-com-v1beta1-policy?timeout=10s»: service «rmqco-rabbitmq-messaging-topology-operator-webhook» not found
&& cannot patch «${USER}» with kind User: Internal error occurred: failed calling webhook «vuser.kb.io»: failed to call webhook: Post «https://rmqco-rabbitmq-messaging-topology-operator-webhook.dev.svc:443/validate-rabbitmq-com-v1beta1-user?timeout=10s»: service «rmqco-rabbitmq-messaging-topology-operator-webhook» not found
Решение: Переустановить и удалить в окружении на которое указывает ошибка.
