OpenShift 4에 대한 NCP 준비 중

OpenShift 4를 설치하기 전에 일부 NCP 구성 파일을 업데이트해야 합니다.
먼저 다음 명령을 실행하여 NSX Container Plugin Operator YAML 규정을 가져옵니다.
git clone https://github.com/vmware/nsx-container-plugin-operator.git
다음 파일은
nsx-container-plugin-operator/deploy
폴더에 있습니다.
  • configmap.yaml
    – 이 파일을 NSX-T 정보로 업데이트합니다.
  • operator.yaml
    – 이 파일에 NCP 이미지 위치를 지정합니다.
  • namespace.yaml
    – 연산자에 대한 네임 스페이스 규격입니다. 이 파일은 편집하지 마십시오.
  • role_binding.yaml
    - 운영자에 대한 역할 바인딩 규격입니다. 이 파일은 편집하지 마십시오.
  • role.yaml
    - 운영자에 대한 역할 규격입니다. 이 파일은 편집하지 마십시오.
  • service_account.yaml
    - 운영자에 대한 서비스 계정 규격입니다. 이 파일은 편집하지 마십시오.
  • lb-secret.yaml
    - 기본 NSX-T 로드 밸런서 인증서에 대한 암호입니다.
  • nsx-secret.yaml
    - NSX-T에 대한 인증서 기반 인증 암호입니다.
    configmap.yaml
    에서
    nsx_api_user
    nsx_api_password
    대신 사용됩니다.
  • operator.nsx.vmware.com_ncpinstalls_crd.yaml
    - 운영자 소유 고객 리소스 정의입니다.
  • operator.nsx.vmware.com_v1_ncpinstall_cr.yaml
    - 운영자 소유 고객 리소스입니다.
다음
connfigmap.yaml
예는 기본 구성을 보여 줍니다. 추가 옵션은
deploy
폴더의
configmap.yaml
을 참조하십시오. 환경에 따라 다음 매개 변수에 대한 값을 지정해야 합니다.
  • 클러스터
  • nsx_api_managers
  • nsx_api_user
  • nsx_api_password
  • external_ip_pools
  • tier0_gateway
  • overlay_tz
  • edge_cluster
  • apiserver_host_ip
  • apiserver_host_port
kind: ConfigMap metadata: name: nsx-ncp-operator-config namespace: nsx-system-operator data: ncp.ini: | [vc] [coe] # Container orchestrator adaptor to plug in. adaptor = openshift4 # Specify cluster name. cluster = ocp [DEFAULT] [nsx_v3] policy_nsxapi = True # Path to NSX client certificate file. If specified, the nsx_api_user and # nsx_api_password options will be ignored. Must be specified along with # nsx_api_private_key_file option #nsx_api_cert_file = <None> # Path to NSX client private key file. If specified, the nsx_api_user and # nsx_api_password options will be ignored. Must be specified along with # nsx_api_cert_file option #nsx_api_private_key_file = <None> nsx_api_managers = 10.114.209.10,10.114.209.11,10.114.209.12 nsx_api_user = admin nsx_api_password = VMware1! # Do not use in production insecure = True # Choices: ALL DENY <None> log_firewall_traffic = DENY external_ip_pools = 10.114.17.0/25 #top_tier_router = <None> tier0_gateway = t0a single_tier_topology = True overlay_tz = 3efa070d-3870-4eb1-91b9-a44416637922 edge_cluster = 3088dc2b-d097-406e-b9de-7a161e8d0e47 [ha] [k8s] # Kubernetes API server IP address. apiserver_host_ip = api-int.ocp.yasen.local # Kubernetes API server port. apiserver_host_port = 6443 client_token_file = /var/run/secrets/kubernetes.io/serviceaccount/token # Choices: <None> allow_cluster allow_namespace baseline_policy_type = allow_cluster enable_multus = False process_oc_network = False [nsx_kube_proxy] [nsx_node_agent] ovs_bridge = br-int # The OVS uplink OpenFlow port ovs_uplink_port = ens192 [operator] # The default certificate for HTTPS load balancing. # Must be specified along with lb_priv_key option. # Operator will create lb-secret for NCP based on these two options. #lb_default_cert = <None> # The private key for default certificate for HTTPS load balancing. # Must be specified along with lb_default_cert option. #lb_priv_key = <None>
operator.yaml
env
섹션에서 NCP 이미지의 위치를 지정해야 합니다.
kind: Deployment metadata: name: nsx-ncp-operator namespace: nsx-system-operator spec: replicas: 1 selector: matchLabels: name: nsx-ncp-operator template: metadata: labels: name: nsx-ncp-operator spec: hostNetwork: true serviceAccountName: nsx-ncp-operator tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master - effect: NoSchedule key: node.kubernetes.io/not-ready containers: - name: nsx-ncp-operator # Replace this with the built image name image: vmware/nsx-container-plugin-operator:latest command: ["/bin/bash", "-c", "nsx-ncp-operator --zap-time-encoding=iso8601"] imagePullPolicy: Always env: - name: POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: OPERATOR_NAME value: "nsx-ncp-operator" - name: NCP_IMAGE value: "{NCP Image}"

주체 ID를 사용하여 NSX-T 인증서 기반 인증 구성

운영 환경에서는
configmap.yaml
에서
nsx_api_user
nsx_api_password
매개 변수를 사용하여 관리자 자격 증명을 제공하지 않는 것이 좋습니다. 다음 단계에서는 주체 ID를 생성하고 NCP에서 인증을 위해 인증서를 사용하도록 허용하는 방법을 설명합니다.
  1. 인증서 및 키를 생성합니다.
  2. NSX Manager에서
    시스템
    사용자 및 역할
    로 이동한 후
    추가
    역할을 가진 주체 ID
    를 클릭합니다. 주체 ID를 추가하고 1단계에서 생성한 인증서를 붙여 넣습니다.
  3. nsx-secret.yaml
    에 base64로 인코딩된 crt 및 키 값을 추가합니다.
  4. configmap.yaml의 [nsx_v3] 섹션 아래에서 인증서 및 키 파일의 위치를 설정합니다.
    nsx_api_cert_file = /etc/nsx-ujo/nsx-cert/tls.crt nsx_api_private_key_file = /etc/nsx-ujo/nsx-cert/tls.key
참고: 이미 부트스트랩된 클러스터에서 인증 방법을 변경하는 것은 지원되지 않습니다.

(선택 사항) 기본 NSX-T 로드 밸런서 인증서 구성

NSX-T 로드 밸런서는 OpenShift HTTPS 경로 개체를 구현하고 OCP HAProxy를 오프로드할 수 있습니다. 이를 위해 기본 인증서가 필요합니다. 다음 단계를 수행하여 기본 인증서를 구성합니다.
  1. lb-secret.yaml
    에 base64로 인코딩된 crt 및 키 값을 추가합니다.
  2. configmap.yaml
    [nsx_v3]
    섹션 아래에서 인증서 및 키의 위치를 설정합니다.
    lb_default_cert_path = /etc/nsx-ujo/lb-cert/tls.crt lb_priv_key_path = /etc/nsx-ujo/lb-cert/tls.key

(선택 사항) NSX Manager 인증서 기반 인증 구성

ConfigMap에서
insecure
=
False
를 설정하는 경우 NSX Manager 클러스터에 있는 관리자 세 개의 인증서 지문을 모두 지정해야 합니다. 다음 절차는 인증서 지문 지정 방법의 예입니다.
NSX Manager 세 개의 인증서를 파일에 모두 복사합니다.
ssh -l admin 10.114.209.10 -f 'get certificate api' > nsx1.crt ssh -l admin 10.114.209.11 -f 'get certificate api' > nsx2.crt ssh -l admin 10.114.209.12 -f 'get certificate api' > nsx3.crt NSX1=`openssl x509 -in nsx1.crt -fingerprint -noout|awk -F"=" '{print $2}'` NSX2=`openssl x509 -in nsx2.crt -fingerprint -noout|awk -F"=" '{print $2}'` NSX3=`openssl x509 -in nsx3.crt -fingerprint -noout|awk -F"=" '{print $2}'` THUMB="$NSX1,$NSX2,$NSX3" echo $THUMB
ConfigMap을 편집하고
[nsx_v3]
섹션에 지문을 추가합니다.
oc edit cm nsx-ncp-operator-config -n nsx-system-operator nsx_api_managers = 10.114.209.10,10.114.209.11,10.114.209.12 nsx_api_user = admin nsx_api_password = VMwareVMware1! insecure = False thumbprint = E0:A8:D6:06:88:B9:65:7D:FB:F8:14:CF:D5:E5:23:98:C9:43:10:71,A7:B0:26:B5:B2:F6:72:2B:39:86:19:84:E6:DD:AB:43:16:0E:CE:BD,52:9B:99:90:88:4C:9F:9B:83:5E:F7:AF:FC:60:06:50:BE:9E:32:08