Я пытаюсь настроить плагин kubernetes в Jenkins. Вот детали, которые я добавляю:
Теперь, когда я нажимаю на тестовое соединение, я получаю следующую ошибку:
Error testing connection https://xx.xx.xx.xx:8001: Failure executing: GET at: https://xx.xx.xx.xx:8001/api/v1/namespaces/default/pods. Message: Unauthorized! Configured service account doesn't have access. Service account may have been revoked. Unauthorized.
После того, как я поработал с Google, я понял, что это может быть связано с привязкой роли, поэтому я создал привязку роли для моей учетной записи службы default
:
# kubectl describe rolebinding jenkins
Name: jenkins
Labels: <none>
Annotations: <none>
Role:
Kind: ClusterRole
Name: pod-reader
Subjects:
Kind Name Namespace
---- ---- ---------
ServiceAccount default default
Вот роль читателя pod:
# kubectl describe role pod-reader
Name: pod-reader
Labels: <none>
Annotations: <none>
PolicyRule:
Resources Non-Resource URLs Resource Names Verbs
--------- ----------------- -------------- -----
pods [] [] [get watch list]
Но я все еще получаю ту же ошибку. Есть ли что-то еще, что нужно сделать здесь? ТИА.