您需要在 NCP 網繭中掛接憑證檔案,以使用 NSX API 設定憑證型驗證,或為 NSX 負載平衡器設定 SSL 卸載的預設憑證。

在這兩種情況下,執行下列操作:
  • 使用憑證和私密金鑰建立密碼。
  • 將密碼磁碟區連結至 NCP 網繭並掛接磁碟區 (請參閱以下的 ConfigMap 範例)。

針對使用 NSX API 的憑證型驗證,在 nsx-ncp-config ConfigMap 中的 [nsx_v3] 下,指定 nsx_api_cert_filensx_api_private_key_file 選項,加上憑證和金鑰的掛接路徑。

針對 NSX 負載平衡器 SSL 卸載,在 nsx-ncp-config ConfigMap 中的 [nsx_v3] 下,指定 lb_default_cert_pathlb_priv_key_path 選項,加上憑證和金鑰的掛接路徑。

ConfigMap 區段,您可在其中指定憑證和金鑰的路徑:
      volumes:
        - name: projected-volume
          projected:
            sources:
              # ConfigMap nsx-ncp-config is expected to supply ncp.ini
              - configMap:
                  name: nsx-ncp-config
                  items:
                    - key: ncp.ini
                      path: ncp.ini
              # To use cert based auth, uncomment and update the secretName,
              # then update ncp.ini with the mounted cert and key file paths
              #- secret:
              #    name: nsx-secret
              #    items:
              #      - key: tls.crt
              #        path: nsx-cert/tls.crt
              #      - key: tls.key
              #        path: nsx-cert/tls.key
              #- secret:
              #    name: lb-secret
              #    items:
              #      - key: tls.crt
              #        path: lb-cert/tls.crt
              #      - key: tls.key
              #        path: lb-cert/tls.key
              # To use JWT based auth, uncomment and update the secretName.
              #- secret:
              #    name: wcp-cluster-credentials
              #    items:
              #      - key: username
              #        path: vc/username
              #      - key: password
              #        path: vc/password