全部產品
Search
文件中心

Identity as a Service:Argo CD SSO

更新時間:Sep 24, 2024

本文為您介紹如何在IDaaS中配置Argo CD單點登入。

應用簡介

Argo CD是用於Kubernetes的聲明性GitOps連續交付工具。​

一、建立應用

請管理員前往應用 > 應用市場,搜尋到Argo CD應用。單擊添加應用,確認應用程式名稱後,即可完成應用建立。

image.png

建立應用成功後,會自動來到SSO單點登入配置頁。

二、在IDaaS中配置SSO

複製Argo CD服務訪問地址,例如:【https://argocd.example.com】。

image.png

將【https://argocd.example.com】填寫到表單中。

image.png

為了便於測試,授權範圍可暫時選擇全員可訪問。

其他選項保持預設,單擊儲存即可完成IDaaS側全部SSO配置。

說明

應用賬戶:預設使用IDaaS郵箱作為應用登入標識。IDaaS郵箱必須包含,才能完成SSO。若希望靈活配置,請參考單點登入通用說明進行配置。

在頁面下方的應用配置資訊中,即包含了Argo CD完成SSO配置所需要的參數。

image.png

三、配置Argo CD

1. SAML配置欄位

將IDaaS應用配置資訊中的參數全部填寫到配置argocd-cm中。

欄位

別稱

說明

ssoURL

IdP 發起 SSO 地址

從IDaaS SSO配置頁應用配置資訊中擷取。

Argo CD將向該地址發送SAML Request請求,發起單點登入請求。

ssoIssuer

IdP 唯一標識

IdP Entity ID

從IDaaS SSO配置頁應用配置資訊中擷取。

caData

密鑰憑證

Certificate

從IDaaS SSO配置頁應用配置資訊中複製出來,然後Base64之後使用。

2. 前往單點登入設定

編輯argocd-cm和配置data.dex.config部分:

kubectl edit configmap argocd-cm -n argocd
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
data:
  dex.config: |
    connectors:
    - type: saml
      id: saml
      name: 阿里雲IDaaS
      config:
        ssoURL: 阿里雲IDaaS SAML 應用IdP發起SSO地址
        entityIssuer: https://argocd.example.com/api/dex/callback
        caData: 阿里雲IDaaS SAML 應用認證Base64之後的值
        redirectURI: https://argocd.example.com/api/dex/callback
        usernameAttr: email
        emailAttr: email
        # optional
        ssoIssuer: 阿里雲IDaaS SAML 應用IdP唯一標識
  url: https://argocd.example.com
kind: ConfigMap
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"ConfigMap","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"argocd-cm","app.kubernetes.io/part-of":"argocd"},"name":"argocd-cm","namespace":"argocd"}}
  creationTimestamp: "2022-03-23T02:43:34Z"
  labels:
    app.kubernetes.io/name: argocd-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cm
  namespace: argocd
  resourceVersion: "124561"
  uid: 9e161ab5-807e-449a-8488-7e764b4ed349

儲存配置,重啟服務嗎,開啟單點登入。

四、嘗試SSO

您已經可以嘗試Argo CD SSO。​

IDP發起

請用已授權使用Argo CD的IDaaS賬戶,登入到IDaaS門戶頁,單擊頁面上Argo CD表徵圖,發起SSO,檢查配置結果。

image.png

SP發起

請在匿名瀏覽器中,開啟Argo CD登入頁,單擊單點登入頁簽下的登入,則會跳轉到IDaaS進行登入。如果使用者尚未登入IDaaS ,則IDaaS會引導使用者進行登入 。

image.png

驗證通過後,將直接登入到Argo CD中。

​​