-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add Kubernetes RBAC support #591
Conversation
kind: ServiceAccount | ||
metadata: | ||
name: flannel | ||
namespace: kube-system |
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.
rather than hardcoding the kube-system namespace and duplicating the config/pod spec from the main example, I would include the service account in the core kubernetes yml example (without the namespace), make the core example use a bespoke service account, limit this file to the clusterrole with the required permissions, and document the kubectl command to grant the clusterrole to the flannel service account in the desired namespace
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.
Ahh yes. Will fix now.
@liggitt updated. Is this what you had in mind? |
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.
Close. I'd keep the clusterrole and RBAC related comment in a separate file they can optionally create. That keeps the main example clean for clusters that don't use RBAC
@@ -42,6 +69,7 @@ spec: | |||
hostNetwork: true | |||
nodeSelector: | |||
beta.kubernetes.io/arch: amd64 | |||
serviceAccount: flannel |
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.
serviceAccountName is the non-deprecated field
b0f90ba
to
97acf0c
Compare
Looks good to me |
# $ kubectl create --namespace kube-system -f kube-flannel.yml | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1alpha1 |
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.
might want to switch this to v1beta1 for longevity
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.
yep, fixing now
LGTM - merging |
This PR adds RBAC support.
@liggitt