10.8.2. フェデレーション設定例
以下の例は、さまざまな SPIRE フェデレーション設定を示しています。クラスター間の連携を設定する際には、これらをテンプレートとして使用してください。
- 例 1:ACME を使用した自動証明書管理
以下の例は、Let’s Encrypt を使用して証明書の自動プロビジョニングと更新を行うためのフェデレーションの設定方法を示しています。
apiVersion: operator.openshift.io/v1alpha1 kind: SpireServer metadata: name: cluster spec: trustDomain: cluster1.example.com federation: bundleEndpoint: profile: https_web refreshHint: 300 httpsWeb: acme: directoryUrl: https://acme-v02.api.letsencrypt.org/directory domainName: federation.apps.cluster1.example.com email: admin@example.com tosAccepted: "true" federatesWith: - trustDomain: cluster2.example.com bundleEndpointUrl: https://federation.apps.cluster2.example.com bundleEndpointProfile: https_web - trustDomain: cluster3.example.com bundleEndpointUrl: https://federation.apps.cluster3.example.com bundleEndpointProfile: https_web managedRoute: "true"-
プロファイルフィールドは、Web PKI 証明書ベースの認証にhttps_webプロファイルを使用します。 -
directoryURLフィールドは、本番環境のディレクトリーに使用されます。テストには、ステージング URLhttps://acme-staging-v02.api.letsencrypt.org/directoryを使用してください。
-
- 例 2:cert-manager を使用した手動証明書管理
次の例は、外部で管理される証明書を使用してフェデレーションを設定する方法を示しています。
apiVersion: operator.openshift.io/v1alpha1 kind: SpireServer metadata: name: cluster spec: trustDomain: cluster1.example.com federation: bundleEndpoint: profile: https_web refreshHint: 300 httpsWeb: servingCert: fileSyncInterval: 86400 externalSecretRef: spire-server-federation-tls federatesWith: - trustDomain: cluster2.example.com bundleEndpointUrl: https://federation.apps.cluster2.example.com bundleEndpointProfile: https_web - trustDomain: cluster3.example.com bundleEndpointUrl: https://federation.apps.cluster3.example.com bundleEndpointProfile: https_web managedRoute: "true"-
fileSyncIntervalフィールドは、24 時間ごとに証明書の更新を確認します。 -
externalSecretRefフィールドは、tls.crtとtls.keyを含む Kubernetes Secret の名前です。
-
- 例 3:SPIRE 間フェデレーションに https_spiffe プロファイルを使用する
以下の例は、SPIFFE ベースの TLS 認証を使用してフェデレーションを設定する方法を示しています。
apiVersion: operator.openshift.io/v1alpha1 kind: SpireServer metadata: name: cluster spec: trustDomain: cluster1.example.com federation: bundleEndpoint: profile: https_spiffe refreshHint: 300 federatesWith: - trustDomain: cluster2.example.com bundleEndpointUrl: https://federation.apps.cluster2.example.com bundleEndpointProfile: https_spiffe endpointSpiffeId: spiffe://cluster2.example.com/spire/server - trustDomain: cluster3.example.com bundleEndpointUrl: https://federation.apps.cluster3.example.com bundleEndpointProfile: https_spiffe endpointSpiffeId: spiffe://cluster3.example.com/spire/server managedRoute: "true"-
プロファイルフィールドは、SPIFFE ベースの TLS 認証にhttps_spiffeプロファイルを使用します。 -
endpointSiffeIdフィールドには、アイデンティティー確認に必要なリモート SPIRE サーバーの SPIFFE ID が含まれます。
-
- 例 4: 複数の認証プロファイルを使用した混合フェデレーション
次の例は、異なる認証プロファイルを使用して複数のリモートクラスターとフェデレーションを行うクラスターを示しています。
apiVersion: operator.openshift.io/v1alpha1 kind: SpireServer metadata: name: cluster spec: trustDomain: internal-cluster.example.com federation: bundleEndpoint: profile: https_spiffe refreshHint: 300 federatesWith: # Internal cluster using SPIFFE TLS - trustDomain: dev-cluster.example.com bundleEndpointUrl: https://federation.apps.dev-cluster.example.com bundleEndpointProfile: https_spiffe endpointSpiffeId: spiffe://dev-cluster.example.com/spire/server # External partner using Web PKI - trustDomain: partner.example.com bundleEndpointUrl: https://federation.partner.example.com bundleEndpointProfile: https_web # Another external partner using Web PKI - trustDomain: vendor.example.com bundleEndpointUrl: https://spire-federation.vendor.example.com bundleEndpointProfile: https_web managedRoute: "true"-
プロファイルフィールドクラスターは、https_spiffeプロファイルを使用してバンドルを公開します。 -
bundleEndpointProfileフィールドのクラスターは、https_spiffeプロファイルを使用してバンドルを公開します。
-