1.9. 为集群配置添加权限


您可以授予 Argo CD 实例的权限来管理集群配置。创建具有额外权限的集群角色,然后创建新的集群角色绑定以将集群角色与服务帐户关联。

流程

  1. 以 admin 用户身份登录 OpenShift Container Platform Web 控制台。
  2. 在 Web 控制台中,选择 User Management Roles Create Role。使用以下 ClusterRole YAML 模板来添加规则来指定额外权限。

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: secrets-cluster-role
    rules:
    - apiGroups: [""]
      resources: ["secrets"]
      verbs: ["*"]
    Copy to Clipboard Toggle word wrap
  3. Create 添加集群角色。
  4. 现在,创建集群角色绑定。在 Web 控制台中,选择 User Management Role Bindings Create Binding
  5. Project 下拉菜单中选择 All Projects
  6. Create binding
  7. Binding type 选择为 Cluster-wide role binding(ClusterRoleBinding)
  8. RoleBinding 名称 输入一个唯一值。
  9. 从下拉列表中选择新创建的集群角色或现有集群角色。
  10. 选择 Subject 作为 ServiceAccount,并提供 Subject 命名空间名称

    1. 主题命名空间:openshift-gitops
    2. 主题名称:openshift-gitops-argocd-application-controller
  11. CreateClusterRoleBinding 对象的 YAML 文件如下:

    kind: ClusterRoleBinding
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
      name: cluster-role-binding
    subjects:
      - kind: ServiceAccount
        name: openshift-gitops-argocd-application-controller
        namespace: openshift-gitops
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: admin
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat