6.2. 다중 클러스터 구성 개요
다중 클러스터 토폴로지를 구성하려면 다음 작업을 수행해야 합니다.
- 각 클러스터에 OpenShift Service Mesh Operator를 설치합니다.
- 각 클러스터의 루트 및 중간 인증서를 생성하거나 액세스할 수 있습니다.
- 각 클러스터에 보안 인증서를 적용합니다.
- 각 클러스터에 대한 Istio를 설치합니다.
6.2.1. 다중 클러스터 토폴로지에 대한 인증서 생성 링크 복사링크가 클립보드에 복사되었습니다!
두 클러스터에 대한 루트 및 중간 인증 기관(CA) 인증서를 생성합니다.
사전 요구 사항
- OpenSSL이 로컬로 설치되어 있어야 합니다.
프로세스
루트 CA 인증서를 생성합니다.
다음 명령을 실행하여 root 인증서의 키를 생성합니다.
$ openssl genrsa -out root-key.pem 4096루트 CA 인증서에 대해
root-ca.conf라는 OpenSSL 구성 인증서 파일을 생성합니다.루트 인증서 구성 파일의 예
encrypt_key = no prompt = no utf8 = yes default_md = sha256 default_bits = 4096 req_extensions = req_ext x509_extensions = req_ext distinguished_name = req_dn [ req_ext ] subjectKeyIdentifier = hash basicConstraints = critical, CA:true keyUsage = critical, digitalSignature, nonRepudiation, keyEncipherment, keyCertSign [ req_dn ] O = Istio CN = Root CA다음 명령을 실행하여 인증서 서명 요청을 생성합니다.
$ openssl req -sha256 -new -key root-key.pem \ -config root-ca.conf \ -out root-cert.csr다음 명령을 실행하여 공유 루트 인증서를 생성합니다.
$ openssl x509 -req -sha256 -days 3650 \ -signkey root-key.pem \ -extensions req_ext -extfile root-ca.conf \ -in root-cert.csr \ -out root-cert.pem
East 클러스터의 중간 CA 인증서를 생성합니다.
다음 명령을 실행하여
east라는 디렉터리를 생성합니다.$ mkdir east다음 명령을 실행하여 동 클러스터의 중간 인증서에 대한 키를 생성합니다.
$ openssl genrsa -out east/ca-key.pem 4096East 클러스터의 중간 인증서를 위해
east/디렉토리에intermediate.conf라는 OpenSSL 구성 파일을 생성합니다. 다음 예제 파일을 복사하여 로컬에 저장합니다.설정 파일 예
[ req ] encrypt_key = no prompt = no utf8 = yes default_md = sha256 default_bits = 4096 req_extensions = req_ext x509_extensions = req_ext distinguished_name = req_dn [ req_ext ] subjectKeyIdentifier = hash basicConstraints = critical, CA:true, pathlen:0 keyUsage = critical, digitalSignature, nonRepudiation, keyEncipherment, keyCertSign subjectAltName=@san [ san ] DNS.1 = istiod.istio-system.svc [ req_dn ] O = Istio CN = Intermediate CA L = east다음 명령을 실행하여 인증서 서명 요청을 생성합니다.
$ openssl req -new -config east/intermediate.conf \ -key east/ca-key.pem \ -out east/cluster-ca.csr다음 명령을 실행하여 동 클러스터에 대한 중간 CA 인증서를 생성합니다.
$ openssl x509 -req -sha256 -days 3650 \ -CA root-cert.pem \ -CAkey root-key.pem -CAcreateserial \ -extensions req_ext -extfile east/intermediate.conf \ -in east/cluster-ca.csr \ -out east/ca-cert.pem다음 명령을 실행하여 east 클러스터의 중간 및 루트 CA 인증서에서 인증서 체인을 생성합니다.
$ cat east/ca-cert.pem root-cert.pem > east/cert-chain.pem && cp root-cert.pem east
West 클러스터의 중간 CA 인증서를 생성합니다.
다음 명령을 실행하여
west라는 디렉터리를 만듭니다.$ mkdir west다음 명령을 실행하여 서부 클러스터의 중간 인증서에 대한 키를 생성합니다.
$ openssl genrsa -out west/ca-key.pem 4096West 클러스터의 중간 인증서에 대해
west/디렉토리에intermediate.conf라는 OpenSSL 구성 파일을 만듭니다. 다음 예제 파일을 복사하여 로컬에 저장합니다.설정 파일 예
[ req ] encrypt_key = no prompt = no utf8 = yes default_md = sha256 default_bits = 4096 req_extensions = req_ext x509_extensions = req_ext distinguished_name = req_dn [ req_ext ] subjectKeyIdentifier = hash basicConstraints = critical, CA:true, pathlen:0 keyUsage = critical, digitalSignature, nonRepudiation, keyEncipherment, keyCertSign subjectAltName=@san [ san ] DNS.1 = istiod.istio-system.svc [ req_dn ] O = Istio CN = Intermediate CA L = west다음 명령을 실행하여 인증서 서명 요청을 생성합니다.
$ openssl req -new -config west/intermediate.conf \ -key west/ca-key.pem \ -out west/cluster-ca.csr다음 명령을 실행하여 인증서를 생성합니다.
$ openssl x509 -req -sha256 -days 3650 \ -CA root-cert.pem \ -CAkey root-key.pem -CAcreateserial \ -extensions req_ext -extfile west/intermediate.conf \ -in west/cluster-ca.csr \ -out west/ca-cert.pem다음 명령을 실행하여 인증서 체인을 생성합니다.
$ cat west/ca-cert.pem root-cert.pem > west/cert-chain.pem && cp root-cert.pem west
6.2.2. 다중 클러스터 토폴로지에 인증서 적용 링크 복사링크가 클립보드에 복사되었습니다!
다중 클러스터 토폴로지의 클러스터에 루트 및 중간 인증 기관(CA) 인증서를 적용합니다.
이 절차에서 CLUSTER1 은 동부 클러스터이며 CLUSTER2 는 서부 클러스터입니다.
사전 요구 사항
- 외부 로드 밸런서가 지원되는 두 개의 OpenShift Container Platform 클러스터에 액세스할 수 있습니다.
- 각 클러스터에 대한 루트 CA 인증서 및 중간 CA 인증서를 생성했거나 사용자가 사용할 수 있도록 했습니다.
프로세스
다중 클러스터 토폴로지의 동 클러스터에 인증서를 적용합니다.
다음 명령을 실행하여 East 클러스터에 로그인합니다.
$ oc login -u https://<east_cluster_api_server_url>다음 명령을 실행하여 동 클러스터의
oc명령 컨텍스트가 포함된 환경 변수를 설정합니다.$ export CTX_CLUSTER1=$(oc config current-context)다음 명령을 실행하여
istio-system이라는 프로젝트를 생성합니다.$ oc get project istio-system --context "${CTX_CLUSTER1}" || oc new-project istio-system --context "${CTX_CLUSTER1}"다음 명령을 실행하여
network1을 동쪽 클러스터에서 포드의 기본 네트워크로 사용하도록 Istio를 구성합니다.$ oc --context "${CTX_CLUSTER1}" label namespace istio-system topology.istio.io/network=network1다음 명령을 실행하여 동 클러스터에서 Istio의 CA 인증서, 인증서 체인 및 개인 키를 생성합니다.
$ oc get secret -n istio-system --context "${CTX_CLUSTER1}" cacerts || oc create secret generic cacerts -n istio-system --context "${CTX_CLUSTER1}" \ --from-file=east/ca-cert.pem \ --from-file=east/ca-key.pem \ --from-file=east/root-cert.pem \ --from-file=east/cert-chain.pem참고"멀티 클러스터 메시의 인증서 생성"의 지침을 준수하면 인증서가
east/디렉터리에 있습니다. 인증서가 다른 디렉터리에 있는 경우 그에 따라 구문을 수정합니다.
다중 클러스터 토폴로지의 West 클러스터에 인증서를 적용합니다.
다음 명령을 실행하여 West 클러스터에 로그인합니다.
$ oc login -u https://<west_cluster_api_server_url>다음 명령을 실행하여 West 클러스터의
oc명령 컨텍스트가 포함된 환경 변수를 설정합니다.$ export CTX_CLUSTER2=$(oc config current-context)다음 명령을 실행하여
istio-system이라는 프로젝트를 생성합니다.$ oc get project istio-system --context "${CTX_CLUSTER2}" || oc new-project istio-system --context "${CTX_CLUSTER2}"다음 명령을 실행하여
network2를 서부 클러스터에서 포드의 기본 네트워크로 사용하도록 Istio를 구성합니다.$ oc --context "${CTX_CLUSTER2}" label namespace istio-system topology.istio.io/network=network2다음 명령을 실행하여 서부 클러스터에서 Istio의 CA 인증서 보안을 생성합니다.
$ oc get secret -n istio-system --context "${CTX_CLUSTER2}" cacerts || oc create secret generic cacerts -n istio-system --context "${CTX_CLUSTER2}" \ --from-file=west/ca-cert.pem \ --from-file=west/ca-key.pem \ --from-file=west/root-cert.pem \ --from-file=west/cert-chain.pem참고"멀티 클러스터 메시의 인증서 생성"에 대한 지침을 수행한 경우 인증서가
west/디렉터리에 있습니다. 인증서가 다른 디렉터리에 있는 경우 그에 따라 구문을 수정합니다.
다음 단계
메시 토폴로지를 구성하는 모든 클러스터에 Istio를 설치합니다.