-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a service account and token for use in ~/.kube/config #1458
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to update the Should it be in the |
Yes.
Maybe yes. @jnummelin wdyt? |
Moved to Still needs some specs, though most of it would be |
end | ||
|
||
def validate | ||
transport.exec!('kubectl get -n kube-system serviceaccount/pharos-admin') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using kubectl
here because client is not yet configured?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added that just to validate that kubectl
without sudo on master works without KUBECONFIG=
or --kubeconfig=
.
The next phase actually probably should be changed to use the file from home instead of /etc/kubernetes
end | ||
|
||
def create_service_account | ||
transport.exec!("sudo kubectl get #{KUBECONFIG_PARAM} -n kube-system serviceaccount/#{ADMIN_USER} || sudo kubectl #{KUBECONFIG_PARAM} -n kube-system create serviceaccount #{ADMIN_USER}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we don't need sudo for kubectl
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, maybe we need because this points to root readable kubeconfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error: Error loading config file "/etc/kubernetes/admin.conf": open /etc/kubernetes/admin.conf: permission denied
Any idea why the validation fails on drone? Works fine on my vagrant.
|
Fixes #1454
Create a
pharos-admin
service account and sa token and use those instead of the client certificate in the kubeconfig created into~/.kube/config
duringpharos up
.Instead of copying the
/etc/kubernetes/admin.conf
, a new config is built from scratch.