- 概述
- 要求
- 预安装
- 安装
- 安装后
- 迁移和升级
- 监控和警示
- 集群管理
- 特定于产品的配置
- 故障排除
安装和配置 GitOps 工具
安装和配置 GitOps 工具,用于管理 OpenShift 上的 Automation Suite 部署。
在继续安装和配置 OpenShift GitOps 运算符之前,您必须安装 OpenShift 服务网格并为uipathadmin服务帐户提供所有必需的权限。
有关服务网格的安装和配置说明,请参阅“安装和配置服务网格” 。
有关安装权限,请参阅授予安装权限。
如果集群上已安装并可用,则可以使用专用于 UiPath™ 应用程序的 OpenShift GitOps运算符实例或共享的 OpenShift GitOps运算符实例来部署 Automation Suite。
我们建议使用专用的 OpenShift GitOps运算符实例来安装 Automation Suite 应用程序。 此方法需要对其他命名空间和集群资源的最低权限。
有关安装和访问详细信息,请参阅以下部分:
配置专用的 GitOps 实例
我们建议为 ArgoCD 使用与<uipath>不同的命名空间。
如果您使用 OpenShift GitOps 版本 1.15 或更高版本,并在<uipath>命名空间中安装 ArgoCD 的专用实例,则由于服务网格控制平面在<uipath>命名空间中添加的网络策略,将无法访问 ArgoCD 用户界面。要解决此问题,您必须添加网络策略(如以下示例所示),以允许 Ingress Pod 访问<uipath>命名空间中的 ArgoCD-server Pod。
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: allow-argocd
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: argocd-server
ingress:
- from:
- namespaceSelector:
matchLabels:
network.openshift.io/policy-group: ingress
policyTypes:
- Ingress
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: allow-argocd
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: argocd-server
ingress:
- from:
- namespaceSelector:
matchLabels:
network.openshift.io/policy-group: ingress
policyTypes:
- Ingress
要配置专用的 OpenShift GitOps 运算符实例,请执行以下步骤:
-
如果
<argocd>命名空间尚不存在,请运行以下命令来创建命名空间:oc get namespace <argocd> || oc new-project <argocd> oc project <argocd>oc get namespace <argocd> || oc new-project <argocd> oc project <argocd> -
按照 安装 OpenShift GitOps 中的说明安装 OpenShift GitOps Orchestrator。
-
按照设置新的 ArgoCD 实例中的说明创建一个新的 ArgoCD 实例。
备注:在为 Argo CD 服务器和存储库服务器启用副本所述的
spec部分中,必须添加以下行:server.route.enabled: trueserver.route.enabled: true -
如果您使用 OpenShift Service网格 2.x,请修补 ArgoCD 部署,以便服务网格通过 OpenShift 路由公开该部署。在 OpenShift Service网格 3.x 上跳过此步骤,其中
maistra.io/expose-route标签在其中无效。oc -n <argocd> patch deployment argocd-server \ -p '{"spec":{"template":{"metadata":{"labels":{"maistra.io/expose-route":"true"}}}}}'oc -n <argocd> patch deployment argocd-server \ -p '{"spec":{"template":{"metadata":{"labels":{"maistra.io/expose-route":"true"}}}}}' -
创建角色,以便 ArgoCD 可以管理限制范围。
在 Automation Suite 2.2510.3 之前,平台 Helm 图表附带一个
LimitRange对象,该对象在<uipath>命名空间中分配默认资源限制,因此 ArgoCD 应用程序控制器需要权限来创建和管理该对象。从 2.2510.3 开始,此LimitRange对象已从图表中删除,控制器仅需要delete动词即可在同步期间删除先前版本创建的LimitRange。要创建角色,请执行以下步骤:
- 将与您的 Automation Suite 版本匹配的角色配置保存为 YAML 文件:
- Automation Suite 2.2510.3 及更高版本(仅需要
delete动词):kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: limit-range-manager namespace: <uipath> rules: - apiGroups: [""] resources: ["limitranges"] verbs: ["delete"]kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: limit-range-manager namespace: <uipath> rules: - apiGroups: [""] resources: ["limitranges"] verbs: ["delete"] - 2.2510.3 之前的版本:
kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: limit-range-manager namespace: <uipath> rules: - apiGroups: [""] resources: ["limitranges"] verbs: ["get", "watch", "list", "patch", "update", "create"]kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: limit-range-manager namespace: <uipath> rules: - apiGroups: [""] resources: ["limitranges"] verbs: ["get", "watch", "list", "patch", "update", "create"]
- Automation Suite 2.2510.3 及更高版本(仅需要
- 通过运行以下命令来应用配置。 确保将
<file_name.yaml>占位符替换为 YAML 文件的实际名称:oc apply -f <file_name.yaml>oc apply -f <file_name.yaml>
- 将与您的 Automation Suite 版本匹配的角色配置保存为 YAML 文件:
-
将
limit-range-manager角色绑定到argocd服务帐户:oc -n <uipath> create rolebinding limit-range-manager-binding --role=limit-range-manager --serviceaccount=<argocd>:argocd-argocd-application-controlleroc -n <uipath> create rolebinding limit-range-manager-binding --role=limit-range-manager --serviceaccount=<argocd>:argocd-argocd-application-controller -
如果您启用了 TaaS,请创建一个角色,该角色向 ArgoCD 应用程序控制器授予对
pods/log子资源的写入谓词。TaaS 预安装挂钩创建了一个包含这些动词的角色,而 Kubernetes RBAC 升级防护要求控制器自行持有这些动词,然后再授予这些动词。要创建角色,请执行以下步骤:- 将以下角色配置保存为 YAML 文件:
kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: argocd-pod-log-writer namespace: <uipath> rules: - apiGroups: [""] resources: ["pods/log"] verbs: ["create", "update", "patch", "delete"]kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: argocd-pod-log-writer namespace: <uipath> rules: - apiGroups: [""] resources: ["pods/log"] verbs: ["create", "update", "patch", "delete"] - 通过运行以下命令来应用配置。 确保将
<file_name.yaml>占位符替换为 YAML 文件的实际名称:oc apply -f <file_name.yaml>oc apply -f <file_name.yaml> - 将
argocd-pod-log-writer角色绑定到argocd服务帐户:oc -n <uipath> create rolebinding argocd-pod-log-writer-binding --role=argocd-pod-log-writer --serviceaccount=<argocd>:argocd-argocd-application-controlleroc -n <uipath> create rolebinding argocd-pod-log-writer-binding --role=argocd-pod-log-writer --serviceaccount=<argocd>:argocd-argocd-application-controller
- 将以下角色配置保存为 YAML 文件:
-
如果启用了 Automation Suite Robot,则必须通过以下步骤为 ArgoCD 启用集群范围模式:
重要提示:需要使用集群范围内的模式,因为默认情况下,Automation Suite Robots Chart 会部署命名空间的 ArgoCD 实例无法管理的
ClusterRole和ClusterRoleBinding。如果要仅使用命名空间范围的权限进行安装,则可以通过在asrobots.concurrency_limit中设置显式input.json来跳过此步骤;然后,图表不会部署集群范围的资源。有关详细信息,请参阅在不带集群角色的情况下授予安装权限。- 在
<openshift-gitops>中,编辑openshift-gitops-operator订阅资源以包含以下环境变量:ARGOCD_CLUSTER_CONFIG_NAMESPACES: <argocd>ARGOCD_CLUSTER_CONFIG_NAMESPACES: <argocd> - 请按照使用 Argo CD 实例管理集群范围内的资源中的说明进行操作。
- 在
-
如果
<uipath>命名空间与<argocd>命名空间不同,则必须确保 ArgoCD 实例可以管理<uipath>命名空间:oc label namespace <uipath> argocd.argoproj.io/managed-by=<argocd>oc label namespace <uipath> argocd.argoproj.io/managed-by=<argocd>在此命令中,
<argocd>是您部署专用 ArgoCD 实例的命名空间的名称。应用配置后,重新启动 ArgoCD
application-controler(状态副本)和server(部署)。 -
仅当
<uipath>命名空间与<argocd>命名空间不同时,才必须执行以下步骤。创建一个角色以管理<argocd>命名空间中的应用程序。要创建角色,请执行以下步骤:- 将以下角色配置保存为 YAML 文件:
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: uipath-application-manager namespace: <argocd> rules: - apiGroups: - argoproj.io resources: - applications verbs: ["get", "watch", "list", "patch", "update", "create", "delete"]apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: uipath-application-manager namespace: <argocd> rules: - apiGroups: - argoproj.io resources: - applications verbs: ["get", "watch", "list", "patch", "update", "create", "delete"] - 通过运行以下命令来应用配置。 确保将
<file_name.yaml>占位符替换为 YAML 文件的实际名称:oc apply -f <file_name.yaml>oc apply -f <file_name.yaml>
- 将以下角色配置保存为 YAML 文件:
-
将
uipath-application-manager角色绑定到uipathadmin服务帐户:oc project <argocd> oc create rolebinding uipath-application-manager \ --role=uipath-application-manager --serviceaccount=<uipath>:uipathadminoc project <argocd> oc create rolebinding uipath-application-manager \ --role=uipath-application-manager --serviceaccount=<uipath>:uipathadmin -
以集群管理员身份,在
helm-credentials命名空间中创建<argocd>存储库密码。这是一个 ArgoCD 存储库密码,其中包含 Helm 注册表连接详细信息,ArgoCD 会读取该密码以拉取 Automation Suite 图表。重要提示:如何管理此密码取决于您的 Automation Suite 版本:
- Automation Suite 2.2510.4 及更高版本: 密码归您所有。
uipathctl不管理它,也不需要对其或<argocd>命名空间的访问权限 — 除了您在上一步中授予的管理 ArgoCD 应用程序之外,uipathadmin服务帐户根本不需要任何权限。跳过下一步。 - Automation Suite 2.2510.3 :密码由您创建,但
uipathctl仍会在每次运行时更新密码,因此uipathadmin需要get、update和patch。使用 2.2510.3 完成下一步角色。 - 2.2510.3 之前的版本:
uipathctl会自行创建和管理密码,因此您可以跳过创建密码的步骤。对于 2.2510.3 之前的版本,使用该角色完成下一步。
每当创建密钥时,您还必须将其保持在最新状态:如果 Helm 注册表凭据发生更改,请自行更新密钥,否则 ArgoCD 将停止拉取图表。
apiVersion: v1 kind: Secret metadata: name: helm-credentials namespace: <argocd> labels: argocd.argoproj.io/secret-type: repository type: Opaque stringData: name: uipath-helm url: <helm-registry-url> type: helm enableOCI: "true" username: <registry-username> password: <registry-password>apiVersion: v1 kind: Secret metadata: name: helm-credentials namespace: <argocd> labels: argocd.argoproj.io/secret-type: repository type: Opaque stringData: name: uipath-helm url: <helm-registry-url> type: helm enableOCI: "true" username: <registry-username> password: <registry-password>stringData值以纯文本形式提供。对于开放式注册表(例如registry.uipath.com),请省略username和password密钥,以便 ArgoCD 匿名连接。将它们留空会导致 ArgoCD 尝试登录并失败,并显示401错误。或者,使用 CLI 创建相同的密码:oc -n <argocd> create secret generic helm-credentials \ --from-literal=name=uipath-helm \ --from-literal=url=<helm-registry-url> \ --from-literal=type=helm \ --from-literal=enableOCI=true \ --from-literal=username=<registry-username> \ --from-literal=password=<registry-password> oc -n <argocd> label --overwrite secret helm-credentials argocd.argoproj.io/secret-type=repositoryoc -n <argocd> create secret generic helm-credentials \ --from-literal=name=uipath-helm \ --from-literal=url=<helm-registry-url> \ --from-literal=type=helm \ --from-literal=enableOCI=true \ --from-literal=username=<registry-username> \ --from-literal=password=<registry-password> oc -n <argocd> label --overwrite secret helm-credentials argocd.argoproj.io/secret-type=repository - Automation Suite 2.2510.4 及更高版本: 密码归您所有。
-
仅限 Automation Suite 2.2510.3 及更早版本。这些版本会写入
helm-credentials密码,并查找<argocd>命名空间,因此uipathadmin需要访问两者的权限。在 2.2510.4 及更高版本中跳过此步骤。- 将与您的 Automation Suite 版本匹配的角色配置保存为 YAML 文件:
- Automation Suite 2.2510.3 、将作用域限制为您在上一步中创建的密码:
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: argo-secret-role namespace: <argocd> rules: - apiGroups: [""] resources: ["secrets"] resourceNames: ["helm-credentials"] verbs: ["get", "update", "patch"]apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: argo-secret-role namespace: <argocd> rules: - apiGroups: [""] resources: ["secrets"] resourceNames: ["helm-credentials"] verbs: ["get", "update", "patch"] - 2.2510.3 之前的版本:
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: argo-secret-role namespace: <argocd> rules: - apiGroups: ["rbac.authorization.k8s.io"] resources: ["roles", "rolebindings"] verbs: ["get", "watch", "list", "patch", "update", "create"] - apiGroups: [""] resources: ["secrets"] verbs: ["get", "watch", "list", "patch", "update", "create"]apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: argo-secret-role namespace: <argocd> rules: - apiGroups: ["rbac.authorization.k8s.io"] resources: ["roles", "rolebindings"] verbs: ["get", "watch", "list", "patch", "update", "create"] - apiGroups: [""] resources: ["secrets"] verbs: ["get", "watch", "list", "patch", "update", "create"]
- Automation Suite 2.2510.3 、将作用域限制为您在上一步中创建的密码:
- 通过运行以下命令来应用配置。 确保将
<file_name.yaml>占位符替换为 YAML 文件的实际名称:oc apply -f <file_name.yaml>oc apply -f <file_name.yaml> - 将
argo-secret-role角色和namespace-reader角色绑定到uipathadmin服务帐户:oc project <argocd> oc create rolebinding secret-binding \ --role=argo-secret-role --serviceaccount=<uipath>:uipathadmin oc create rolebinding namespace-reader-rolebinding \ --clusterrole=namespace-reader-clusterrole --serviceaccount=<uipath>:uipathadminoc project <argocd> oc create rolebinding secret-binding \ --role=argo-secret-role --serviceaccount=<uipath>:uipathadmin oc create rolebinding namespace-reader-rolebinding \ --clusterrole=namespace-reader-clusterrole --serviceaccount=<uipath>:uipathadmin
- 将与您的 Automation Suite 版本匹配的角色配置保存为 YAML 文件:
访问专用 ArgoCD 实例
要访问 ArgoCD,请执行以下步骤:
- 获取主机 URL:
oc get routes argocd-server -n <argocd> -o jsonpath={.spec.host}; echooc get routes argocd-server -n <argocd> -o jsonpath={.spec.host}; echo - 要登录,请使用
admin作为用户名,然后运行以下命令以获取密码:oc -n <argocd> get secrets argocd-cluster \ -o "jsonpath={.data['admin\.password']}" | base64 -d; echooc -n <argocd> get secrets argocd-cluster \ -o "jsonpath={.data['admin\.password']}" | base64 -d; echo
在 ArgoCD 中配置私有 Helm 存储库和证书
要在 ArgoCD 中配置 Helm 存储库,请执行以下步骤:
- 登录到 ArgoCD。
- 导航至“设置” >“存储库” >“+CONNECT REPO” 。
- 使用VIA HTTPS作为连接方法。
- 选择“Helm”作为类型。
- 提供名称。
- 选择“默认”作为项目。
- 提供存储库 URL、用户名、密码和证书信息。
重要提示:
在“+连接 REPO”页面上添加 TLS 客户端证书时,TLS 客户端证书密钥将成为必填字段。要在不使用 TLS 客户端证书密钥的情况下配置注册表证书,请执行以下步骤:
- 导航至“设置” >“存储库证书和已知主机” >“+ 添加 TLS 证书” 。
- 添加 PEM 格式的存储库名称和 TLS 证书。
- 启用“OCI”复选框。
- Select Connect.
- 确保连接状态为成功。
配置共享的 GitOps 实例
如果您的平台团队尚未配置共享的 OpenShift GitOps 运算符实例,请执行以下安装和配置步骤:
-
创建
<uipath>命名空间:oc get namespace <uipath> || oc new-project <uipath> oc project <uipath>oc get namespace <uipath> || oc new-project <uipath> oc project <uipath> -
按照 安装 OpenShift GitOps 中的说明安装 OpenShift GitOps Orchestrator。此安装附带默认的 ArgoCD 实例,位于
<openshift-gitops>命名空间中,名为openshift-gitops。 -
通过执行以下步骤为 ArgoCD 启用集群范围内模式:
- 在
<openshift-gitops>中,编辑openshift-gitops-operator订阅资源以包含以下环境变量:ARGOCD_CLUSTER_CONFIG_NAMESPACES: <openshift-gitops>ARGOCD_CLUSTER_CONFIG_NAMESPACES: <openshift-gitops> - 请按照使用 ArgoCD 实例管理集群范围内的资源中的说明进行操作。
- 在
-
确保
openshift-gitopsArgoCD 实例可以管理<uipath>命名空间:oc label namespace <uipath> argocd.argoproj.io/managed-by=openshift-gitopsoc label namespace <uipath> argocd.argoproj.io/managed-by=openshift-gitops应用配置后,重新启动 ArgoCD
openshift-gitops-application-controller(状态副本)和openshift-gitops-server(部署)。 -
如果您使用 OpenShift Service网格 2.x,请修补 ArgoCD 部署,以便服务网格通过 OpenShift 路由公开该部署。在 OpenShift Service网格 3.x 上跳过此步骤,其中
maistra.io/expose-route标签在其中无效。oc -n <uipath> patch deployment argocd-server \ -p '{"spec":{"template":{"metadata":{"labels":{"maistra.io/expose-route":"true"}}}}}'oc -n <uipath> patch deployment argocd-server \ -p '{"spec":{"template":{"metadata":{"labels":{"maistra.io/expose-route":"true"}}}}}' -
为 UiPath™ 应用程序创建一个 ArgoCD 项目:
apiVersion: argoproj.io/v1alpha1 kind: AppProject metadata: name: uipath namespace: <openshift-gitops> spec: description: Appproject to managed and deploy uipath applications clusterResourceWhitelist: - group: '*' kind: '*' destinations: - namespace: <uipath> server: https://kubernetes.default.svc - namespace: <istio-system> server: https://kubernetes.default.svc sourceNamespaces: - <openshift-gitops> sourceRepos: - '*'apiVersion: argoproj.io/v1alpha1 kind: AppProject metadata: name: uipath namespace: <openshift-gitops> spec: description: Appproject to managed and deploy uipath applications clusterResourceWhitelist: - group: '*' kind: '*' destinations: - namespace: <uipath> server: https://kubernetes.default.svc - namespace: <istio-system> server: https://kubernetes.default.svc sourceNamespaces: - <openshift-gitops> sourceRepos: - '*' -
创建角色,以便 ArgoCD 可以管理限制范围。
在 Automation Suite 2.2510.3 之前,平台 Helm 图表附带一个
LimitRange对象,该对象在<uipath>命名空间中分配默认资源限制,因此 ArgoCD 应用程序控制器需要权限来创建和管理该对象。从 2.2510.3 开始,此LimitRange对象已从图表中删除,控制器仅需要delete动词即可在同步期间删除先前版本创建的LimitRange。要创建角色,请执行以下步骤:
- 将与您的 Automation Suite 版本匹配的角色配置保存为 YAML 文件:
- Automation Suite 2.2510.3 及更高版本(仅需要
delete动词):kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: limit-range-manager namespace: <uipath> rules: - apiGroups: [""] resources: ["limitranges"] verbs: ["delete"]kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: limit-range-manager namespace: <uipath> rules: - apiGroups: [""] resources: ["limitranges"] verbs: ["delete"] - 2.2510.3 之前的版本:
kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: limit-range-manager namespace: <uipath> rules: - apiGroups: [""] resources: ["limitranges"] verbs: ["get", "watch", "list", "patch", "update", "create"]kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: limit-range-manager namespace: <uipath> rules: - apiGroups: [""] resources: ["limitranges"] verbs: ["get", "watch", "list", "patch", "update", "create"]
- Automation Suite 2.2510.3 及更高版本(仅需要
- 通过运行以下命令来应用配置。 确保将
<file_name.yaml>占位符替换为 YAML 文件的实际名称:oc apply -f <file_name.yaml>oc apply -f <file_name.yaml>
- 将与您的 Automation Suite 版本匹配的角色配置保存为 YAML 文件:
-
将
limit-range-manager角色绑定到argocd服务帐户:oc -n <uipath> create rolebinding limit-range-manager-binding --role=limit-range-manager --serviceaccount=<openshift-gitops>:openshift-gitops-argocd-application-controlleroc -n <uipath> create rolebinding limit-range-manager-binding --role=limit-range-manager --serviceaccount=<openshift-gitops>:openshift-gitops-argocd-application-controller -
创建角色以管理
<openshift-gitops>命名空间中的应用程序:apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: uipath-application-manager namespace: <openshift-gitops> rules: - apiGroups: - argoproj.io resources: - applications verbs: ["get", "watch", "list", "patch", "update", "create"]apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: uipath-application-manager namespace: <openshift-gitops> rules: - apiGroups: - argoproj.io resources: - applications verbs: ["get", "watch", "list", "patch", "update", "create"] -
将
uipath-application-manager角色绑定到uipathadmin服务帐户:oc project <openshift-gitops> oc create rolebinding uipath-application-manager \ --role=uipath-application-manager --serviceaccount=<uipath>:uipathadminoc project <openshift-gitops> oc create rolebinding uipath-application-manager \ --role=uipath-application-manager --serviceaccount=<uipath>:uipathadmin -
以集群管理员身份,在
helm-credentials命名空间中创建<openshift-gitops>存储库密码。这是一个 ArgoCD 存储库密码,其中包含 Helm 注册表连接详细信息,ArgoCD 会读取该密码以拉取 Automation Suite 图表。重要提示:如何管理此密码取决于您的 Automation Suite 版本:
- Automation Suite 2.2510.4 及更高版本: 密码归您所有。
uipathctl不管理它,也不需要对其或<openshift-gitops>命名空间的访问权限 — 除了您在上一步中授予的管理 ArgoCD 应用程序之外,uipathadmin服务帐户根本不需要任何权限。跳过下一步。 - Automation Suite 2.2510.3 :密码由您创建,但
uipathctl仍会在每次运行时更新密码,因此uipathadmin需要get、update和patch。使用 2.2510.3 完成下一步角色。 - 2.2510.3 之前的版本:
uipathctl会自行创建和管理密码,因此您可以跳过创建密码的步骤。对于 2.2510.3 之前的版本,使用该角色完成下一步。
每当创建密钥时,您还必须将其保持在最新状态:如果 Helm 注册表凭据发生更改,请自行更新密钥,否则 ArgoCD 将停止拉取图表。
apiVersion: v1 kind: Secret metadata: name: helm-credentials namespace: <openshift-gitops> labels: argocd.argoproj.io/secret-type: repository type: Opaque stringData: name: uipath-helm url: <helm-registry-url> type: helm enableOCI: "true" username: <registry-username> password: <registry-password>apiVersion: v1 kind: Secret metadata: name: helm-credentials namespace: <openshift-gitops> labels: argocd.argoproj.io/secret-type: repository type: Opaque stringData: name: uipath-helm url: <helm-registry-url> type: helm enableOCI: "true" username: <registry-username> password: <registry-password>stringData值以纯文本形式提供。对于开放式注册表(例如registry.uipath.com),请省略username和password密钥,以便 ArgoCD 匿名连接。将它们留空会导致 ArgoCD 尝试登录并失败,并显示401错误。或者,使用 CLI 创建相同的密码:oc -n <openshift-gitops> create secret generic helm-credentials \ --from-literal=name=uipath-helm \ --from-literal=url=<helm-registry-url> \ --from-literal=type=helm \ --from-literal=enableOCI=true \ --from-literal=username=<registry-username> \ --from-literal=password=<registry-password> oc -n <openshift-gitops> label --overwrite secret helm-credentials argocd.argoproj.io/secret-type=repositoryoc -n <openshift-gitops> create secret generic helm-credentials \ --from-literal=name=uipath-helm \ --from-literal=url=<helm-registry-url> \ --from-literal=type=helm \ --from-literal=enableOCI=true \ --from-literal=username=<registry-username> \ --from-literal=password=<registry-password> oc -n <openshift-gitops> label --overwrite secret helm-credentials argocd.argoproj.io/secret-type=repository - Automation Suite 2.2510.4 及更高版本: 密码归您所有。
-
仅限 Automation Suite 2.2510.3 及更早版本。这些版本会写入
helm-credentials密码,并查找<openshift-gitops>命名空间,因此uipathadmin需要访问两者的权限。在 2.2510.4 及更高版本中跳过此步骤。- 将与您的 Automation Suite 版本匹配的角色配置保存为 YAML 文件:
- Automation Suite 2.2510.3 、将作用域限制为您在上一步中创建的密码:
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: argo-secret-role namespace: <openshift-gitops> rules: - apiGroups: [""] resources: ["secrets"] resourceNames: ["helm-credentials"] verbs: ["get", "update", "patch"]apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: argo-secret-role namespace: <openshift-gitops> rules: - apiGroups: [""] resources: ["secrets"] resourceNames: ["helm-credentials"] verbs: ["get", "update", "patch"] - 2.2510.3 之前的版本:
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: argo-secret-role namespace: <openshift-gitops> rules: - apiGroups: ["rbac.authorization.k8s.io"] resources: ["roles", "rolebindings"] verbs: ["get", "watch", "list", "patch", "update", "create"] - apiGroups: [""] resources: ["secrets"] verbs: ["get", "watch", "list", "patch", "update", "create"]apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: argo-secret-role namespace: <openshift-gitops> rules: - apiGroups: ["rbac.authorization.k8s.io"] resources: ["roles", "rolebindings"] verbs: ["get", "watch", "list", "patch", "update", "create"] - apiGroups: [""] resources: ["secrets"] verbs: ["get", "watch", "list", "patch", "update", "create"]
- Automation Suite 2.2510.3 、将作用域限制为您在上一步中创建的密码:
- 通过运行以下命令来应用配置。 确保将
<file_name.yaml>占位符替换为 YAML 文件的实际名称:oc apply -f <file_name.yaml>oc apply -f <file_name.yaml> - 将
argo-secret-role角色和namespace-reader角色绑定到uipathadmin服务帐户:oc project <openshift-gitops> oc create rolebinding secret-binding \ --role=argo-secret-role --serviceaccount=<uipath>:uipathadmin oc create rolebinding namespace-reader-rolebinding \ --clusterrole=namespace-reader-clusterrole --serviceaccount=<uipath>:uipathadminoc project <openshift-gitops> oc create rolebinding secret-binding \ --role=argo-secret-role --serviceaccount=<uipath>:uipathadmin oc create rolebinding namespace-reader-rolebinding \ --clusterrole=namespace-reader-clusterrole --serviceaccount=<uipath>:uipathadmin
- 将与您的 Automation Suite 版本匹配的角色配置保存为 YAML 文件:
除了完成为 Automation Suite 安装配置共享 ArgoCD 实例的步骤之外,还必须将以下参数添加到input.json文件中:
"argocd": {
"project": "<uipath>"
},
"argocd": {
"project": "<uipath>"
},
访问共享的 ArgoCD 实例
要访问 ArgoCD,请执行以下步骤:
- 通过运行以下命令获取主机 URL:
oc get routes openshift-gitops-server -n <openshift-gitops> -o jsonpath={.spec.host}; echooc get routes openshift-gitops-server -n <openshift-gitops> -o jsonpath={.spec.host}; echo - 要登录,请使用
admin作为用户名,然后运行以下命令以获取密码:oc -n <openshift-gitops> get secrets openshift-gitops-cluster \ -o "jsonpath={.data['admin\.password']}" | base64 -d; echooc -n <openshift-gitops> get secrets openshift-gitops-cluster \ -o "jsonpath={.data['admin\.password']}" | base64 -d; echo
在 ArgoCD 中配置私有 Helm 存储库和证书
要在 ArgoCD 中配置 Helm 存储库,请执行以下步骤:
- 登录到 ArgoCD。
- 导航至“设置” >“存储库” >“+CONNECT REPO” 。
- 使用VIA HTTPS作为连接方法。
- 选择“Helm”作为类型。
- 提供名称。
- 选择“UiPath”作为项目。uipath是您为 UiPath™ 应用程序创建的 ArgoCD 项目的名称。
- 提供存储库 URL、用户名、密码和证书信息。
重要提示:
在“+连接 REPO”页面上添加 TLS 客户端证书时,TLS 客户端证书密钥将成为必填字段。要在不使用 TLS 客户端证书密钥的情况下配置注册表证书,请执行以下步骤:
- 导航至“设置” >“存储库证书和已知主机” >“+ 添加 TLS 证书” 。
- 添加 PEM 格式的存储库名称和 TLS 证书。
- 启用“OCI”复选框。
- Select Connect.
- 确保连接状态为成功。
为单个集群中的多个安装配置 ArgoCD
要为单个 OpenShift 集群中的多个 Automation Suite 安装配置 ArgoCD,请执行以下步骤:
- 检查 ArgoCD 的所有服务是否都已启动且正在运行。您可以运行以下命令来监控所有 Pod:
oc get pods -n <argocd>oc get pods -n <argocd> - 所有服务启动并正在运行后,您可以按顺序使用以下命令来修补 ArgoCD 的权限。这使 ArgoCD 可以管理安装了 Automation Suite 的不同应用程序命名空间:
oc patch appprojects.argoproj.io default -n <argocd> --type='merge' -p '{"spec": {"sourceNamespaces": ["*"]}}' oc patch configmaps argocd-cmd-params-cm -n <argocd> --type='merge' -p '{"data": {"application.namespaces": "*"}}' oc rollout restart -n <argocd> deployment argocd-server oc rollout restart -n <argocd> statefulset argocd-application-controlleroc patch appprojects.argoproj.io default -n <argocd> --type='merge' -p '{"spec": {"sourceNamespaces": ["*"]}}' oc patch configmaps argocd-cmd-params-cm -n <argocd> --type='merge' -p '{"data": {"application.namespaces": "*"}}' oc rollout restart -n <argocd> deployment argocd-server oc rollout restart -n <argocd> statefulset argocd-application-controller