简体   繁体   English

具有 kubernetes 集群角色的 ArgoCD RBAC

[英]ArgoCD RBAC with kubernetes cluster roles

Just reading official argo-cd documentation regarding RBAC ( https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/ ), I realize that Argo RBAC configuration only supports mapping either SSO Groups (AD) or local users.只是阅读有关 RBAC 的官方 argo-cd 文档( https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/ ),我意识到 Argo RBAC 配置仅支持映射 SSO 组(AD)或本地用户。

Is there any workaround or a way to configure a permission for ArgoCD by using existing kubernetes clusterroles instead of sso groups?是否有任何解决方法或方法通过使用现有的 kubernetes 集群角色而不是 sso 组来配置 ArgoCD 的权限? Thanks in advance提前致谢

I'm trying to do something like this我正在尝试做这样的事情

p, role:staging-db-admins, applications, create, staging-db-admins/*, allow
p, role:staging-db-admins, applications, delete, staging-db-admins/*, allow
p, role:staging-db-admins, applications, get, staging-db-admins/*, allow
p, role:staging-db-admins, applications, override, staging-db-admins/*, allow
p, role:staging-db-admins, applications, sync, staging-db-admins/*, allow
p, role:staging-db-admins, applications, update, staging-db-admins/*, allow
p, role:staging-db-admins, projects, get, staging-db-admins, allow
r, customized_clusterrole, role:staging-db-admins

No, since, as per docs, you can use either local users/groups, or some SSO provider, configured via Dex or standalone (keycloak/Auth0 etc).不,因为根据文档,您可以使用通过 Dex 或独立(keycloak/Auth0 等)配置的本地用户/组或某些 SSO 提供程序。

To elaborate further, roles, and especially clusterroles make no sense outside of kubernetes itself, they are describing what you can do inside of kubernetes.为了进一步阐述,角色,尤其是集群角色在 kubernetes 本身之外没有任何意义,它们描述了您可以在 kubernetes 内部做什么。 RoleBindings describe actual mapping between users/groups and roles. RoleBindings 描述了用户/组和角色之间的实际映射。 From OIDC standpoint, they don't contain required info like Scope, Claim, End user etc.从 OIDC 的角度来看,它们不包含所需的信息,例如 Scope、声明、最终用户等。

As per kubernetes docs itself https://kubernetes.io/docs/reference/access-authn-authz/authentication/根据 kubernetes 文档本身https://kubernetes.io/docs/reference/access-authn-authz/authentication/

Kubernetes does not provide an OpenID Connect Identity Provider. Kubernetes 不提供 OpenID Connect 身份提供程序。 You can use an existing public OpenID Connect Identity Provider (such as Google, or others).您可以使用现有的公共 OpenID Connect 身份提供商(例如 Google 或其他)。 Or, you can run your own Identity Provider, such as dex, Keycloak, CloudFoundry UAA, or Tremolo Security's OpenUnison.或者,您可以运行自己的身份提供程序,例如 dex、Keycloak、CloudFoundry UAA 或 Tremolo Security 的 OpenUnison。

So if you really want to make seamless integration between k8s and argocd - you have to use some sort of SSO provider, maybe even hosted inside your cluster.因此,如果您真的想在 k8s 和 argocd 之间进行无缝集成 - 您必须使用某种 SSO 提供程序,甚至可能托管在您的集群中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM