Closed JorritSalverda closed 6 years ago
@JorritSalverda - for events and namespaces, the privileges must be cluster scoped. It should be a cluster role and a cluster role binding. Can you please try that out? Check https://github.com/kubernetes/charts/blob/master/stable/gocd/templates/gocd-ea-cluster-role.yaml and https://github.com/kubernetes/charts/blob/master/stable/gocd/templates/gocd-ea-cluster-role-binding.yaml for reference.
Can you please clarify from which container you're copying the value for /var/run/secrets/kubernetes.io/serviceaccount/token
? And are you sure that the token matches the configured service account's token? You can match the values by doing
secret_name=$(kubectl get serviceaccount server --namespace=NAMESPACE -o jsonpath="{.secrets[0].name}")
kubectl get secret $secret_name --namespace=NAMESPACE -o jsonpath="{.data['token']}" | base64 --decode
and
cat /var/run/secrets/kubernetes.io/serviceaccount/token
inside the server container.
Changing the Role
and RoleBinding
to ClusterRole
and ClusterRoleBinding
seemed to have helped. I also had to remove a %
from the end of the /var/run/secrets/kubernetes.io/serviceaccount/token
file content. When using kubectl describe secret TOKEN_NAME
as described in the form it doesn't show this %
at the end, so that's the better way to find the value.
Hopefully the setup for go.cd server running in Kubernetes can be simplified by implementing https://github.com/gocd/kubernetes-elastic-agents/issues/44 for future users.
When trying to configure the plugin it fails with the following message:
Failed to validate namespace existence: default Please check plugin log for more detail.
The only thing I can find in the go.cd server logs is the following:
I've set up RBAC role, binding and service account with the following template and use
https://kubernetes.default.svc.cluster.local
as cluster url. I've copied the service account token from/var/run/secrets/kubernetes.io/serviceaccount/token
and ca certificate data from/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
.Is there any other place to find the actual logs from the plugin?