5 인스턴스 프로비전
이 섹션에서는 Blockchain Platform Manager를 사용하여 Oracle Blockchain Platform 인스턴스를 프로비저닝하는 방법에 대해 설명합니다.
Oracle Blockchain Platform 인스턴스를 생성하기 전에
Oracle Blockchain Platform을 프로비저닝하기 전에 개발자 또는 엔터프라이즈 인스턴스가 요구사항을 충족하는지 여부를 결정하십시오.
사용할 프로비전 구성 결정
인스턴스를 프로비저닝할 때 두 구성 중에서 선택합니다. 이 옵션 간의 마이그레이션은 현재 지원되지 않습니다.
| 구성 | 특징 |
|---|---|
| 개발자 이 시작 구성의 권장 용도는 개발 및 평가입니다. |
|
| 엔터프라이즈 고가용성 인스턴스 구성으로 각 서비스에 대한 복제본 수가 더 많습니다. |
|
Blockchain Platform Manager를 사용하여 인스턴스 프로비전
Blockchain Platform Manager에서 블록체인 설립자 또는 참가자 인스턴스를 생성하려면 [새 인스턴스 생성] 마법사를 사용합니다.
-
설립자 조직: 참여자가 나중에 참여할 수 있는 새로운 네트워크를 포함한 완전한 블록체인 환경입니다.
-
참가자 인스턴스: 가입할 설립자 조직이 이미 있는 경우 인증서가 네트워크에 대한 액세스 권한을 제공할 경우 참가자 인스턴스를 생성할 수 있습니다. 참가자는 자체적으로 기능할 수 없습니다.
프로비전 사후 요구사항
kubectl get virtualservice -n <instance-namespace> -o json | jq -r
.items[].spec.hosts[0]kubectl get virtualservice -n <instance-namespace> -o json | jq -r
.items[].spec.hosts[0]Oracle Blockchain Platform Enterprise Edition 인스턴스를 생성한 후 구성요소의 공용 호스트 이름을 OpenShift 로컬 네트워크에서 분석할 수 있도록 DNS를 구성해야 합니다.
- 다음 명령을 실행합니다.
oc new-project obp-coredns - 다음 명령을 실행하여
obp-coredns네임스페이스에 사용자정의coredns서버를 배치합니다.
다음 매니페스트 파일을 명령과 함께 사용합니다.kubectl apply -f <coredns-deployment-yaml-file>apiVersion: v1 kind: ConfigMap metadata: name: coredns namespace: obp-coredns data: Corefile: |- .:1053 { errors health { lameduck 5s } ready kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } prometheus :9153 forward . /etc/resolv.conf cache 30 loop reload loadbalance } import custom/*.server --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: obp-coredns name: obp-coredns namespace: obp-coredns spec: progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: app: obp-coredns strategy: type: RollingUpdate template: metadata: labels: app: obp-coredns spec: containers: - args: - -conf - /etc/coredns/Corefile image: docker.io/coredns/coredns:latest imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 5 httpGet: path: /health port: 8080 scheme: HTTP initialDelaySeconds: 60 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 name: coredns ports: - containerPort: 1053 name: dns protocol: UDP - containerPort: 1053 name: dns-tcp protocol: TCP - containerPort: 9153 name: metrics protocol: TCP readinessProbe: failureThreshold: 3 httpGet: path: /ready port: 8181 scheme: HTTP periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 resources: limits: memory: 170Mi requests: cpu: 100m memory: 70Mi securityContext: allowPrivilegeEscalation: false capabilities: add: - NET_BIND_SERVICE drop: - all readOnlyRootFilesystem: true terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /etc/coredns name: config-volume readOnly: true - mountPath: /etc/coredns/custom name: custom-config-volume readOnly: true dnsPolicy: Default restartPolicy: Always schedulerName: default-scheduler securityContext: {} serviceAccount: obp-coredns serviceAccountName: obp-coredns terminationGracePeriodSeconds: 30 volumes: - configMap: defaultMode: 420 items: - key: Corefile path: Corefile name: coredns name: config-volume - configMap: defaultMode: 420 name: coredns-custom optional: true name: custom-config-volume --- apiVersion: v1 kind: Service metadata: labels: app: obp-coredns name: obp-coredns namespace: obp-coredns spec: ports: - name: dns port: 53 protocol: UDP targetPort: 1053 - name: dns-tcp port: 53 protocol: TCP targetPort: 1053 - name: metrics port: 9153 protocol: TCP targetPort: 9153 selector: app: obp-coredns sessionAffinity: None type: ClusterIP --- apiVersion: v1 kind: ServiceAccount metadata: name: obp-coredns namespace: obp-coredns --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: obp-coredns rules: - apiGroups: - "" resources: - endpoints - services - pods - namespaces verbs: - list - watch - apiGroups: - "" resources: - nodes verbs: - get - apiGroups: - discovery.k8s.io resources: - endpointslices verbs: - list - watch --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: obp-coredns roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: obp-coredns subjects: - kind: ServiceAccount name: obp-coredns namespace: obp-coredns - 블록체인 인스턴스에 대한 YAML 형식으로
coredns-custom-configmap파일을 생성합니다.
이전 예에서apiVersion: v1 kind: ConfigMap metadata: name: coredns-custom namespace: obp-coredns data: obp.server: |2 <instanceName>.<domain>:1053 { log kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } rewrite stop { name regex (.*)\.<instanceName>\.<domain>\.com istio-ingressgateway.istio-system.svc.cluster.local answer auto } forward . /etc/resolv.conf }<instanceName>은 인스턴스의 이름이고<domain>은 인스턴스를 생성할 때 전달된 도메인입니다. - 다음 명령을 실행하여 사용자 정의
ConfigMap객체를 적용합니다.kubectl apply -f <coredns-custom-configmap-yaml-file> - 다음 명령을 실행하여 클러스터 IP 주소를 가져옵니다. IP 주소를 기록합니다.
kubectl get svc -n obp-coredns - 다음 명령을 실행하여 OpenShift DNS 사용자정의 리소스를 편집합니다.
kubectl edit dnses.operator/default - 다음 예와 같이 인스턴스 및 도메인 이름을 사용하도록 DNS 사용자정의 리소스의 영역 섹션을 업데이트합니다.
이전 예에서## Add the following section to the dns custom resource under spec servers: - forwardPlugin: policy: Random upstreams: - 192.0.2.233 name: obp-server zones: - <instanceName>.<domain><instanceName>은 인스턴스의 이름이고<domain>은 상위 도메인입니다. - 새 인스턴스를 추가하려면 다음 예와 같이
coredns-custom-configmap파일에 항목을 추가하고 새 인스턴스의 도메인에 대한 OpenShift DNS 사용자정의 리소스를 업데이트합니다.
DNS 변경 사항을 적용하려면 Blockchain Platform Manager를 사용하여 Blockchain Platform 인스턴스를 중지하고 다시 시작해야 합니다.apiVersion: v1 kind: ConfigMap metadata: name: coredns-custom namespace: obp-coredns data: obp.server: |2 myobp.example.com:1053 { log kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } rewrite stop { name regex (.*)\.myobp\.example\.com istio-ingressgateway.istio-system.svc.cluster.local answer auto } forward . /etc/resolv.conf } otherobp.example.org:1053 { log kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } rewrite stop { name regex (.*)\.otherobp\.example\.org istio-ingressgateway.istio-system.svc.cluster.local answer auto } forward . /etc/resolv.conf } ## Edit the Openshift's DNS custom resource kubectl edit dnses.operator/default ## Add the new instance domain to the existing .spec.servers.zones servers: - forwardPlugin: policy: Random upstreams: - 192.0.2.233 name: obp-server zones: - myobp.example.com - otherobp.example.org
DNS 구성
Oracle Blockchain Platform Enterprise Edition 인스턴스를 생성한 후 구성요소의 공용 호스트 이름을 OpenShift 로컬 네트워크에서 분석할 수 있도록 DNS를 구성해야 합니다.
- 다음 명령을 실행합니다.
oc new-project obp-coredns - 다음 명령을 실행하여
obp-coredns네임스페이스에 사용자정의coredns서버를 배치합니다.
다음 매니페스트 파일을 명령과 함께 사용합니다.kubectl apply -f <coredns-deployment-yaml-file>apiVersion: v1 kind: ConfigMap metadata: name: coredns namespace: obp-coredns data: Corefile: |- .:1053 { errors health { lameduck 5s } ready kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } prometheus :9153 forward . /etc/resolv.conf cache 30 loop reload loadbalance } import custom/*.server --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: obp-coredns name: obp-coredns namespace: obp-coredns spec: progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: app: obp-coredns strategy: type: RollingUpdate template: metadata: labels: app: obp-coredns spec: containers: - args: - -conf - /etc/coredns/Corefile image: docker.io/coredns/coredns:latest imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 5 httpGet: path: /health port: 8080 scheme: HTTP initialDelaySeconds: 60 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 name: coredns ports: - containerPort: 1053 name: dns protocol: UDP - containerPort: 1053 name: dns-tcp protocol: TCP - containerPort: 9153 name: metrics protocol: TCP readinessProbe: failureThreshold: 3 httpGet: path: /ready port: 8181 scheme: HTTP periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 resources: limits: memory: 170Mi requests: cpu: 100m memory: 70Mi securityContext: allowPrivilegeEscalation: false capabilities: add: - NET_BIND_SERVICE drop: - all readOnlyRootFilesystem: true terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /etc/coredns name: config-volume readOnly: true - mountPath: /etc/coredns/custom name: custom-config-volume readOnly: true dnsPolicy: Default restartPolicy: Always schedulerName: default-scheduler securityContext: {} serviceAccount: obp-coredns serviceAccountName: obp-coredns terminationGracePeriodSeconds: 30 volumes: - configMap: defaultMode: 420 items: - key: Corefile path: Corefile name: coredns name: config-volume - configMap: defaultMode: 420 name: coredns-custom optional: true name: custom-config-volume --- apiVersion: v1 kind: Service metadata: labels: app: obp-coredns name: obp-coredns namespace: obp-coredns spec: ports: - name: dns port: 53 protocol: UDP targetPort: 1053 - name: dns-tcp port: 53 protocol: TCP targetPort: 1053 - name: metrics port: 9153 protocol: TCP targetPort: 9153 selector: app: obp-coredns sessionAffinity: None type: ClusterIP --- apiVersion: v1 kind: ServiceAccount metadata: name: obp-coredns namespace: obp-coredns --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: obp-coredns rules: - apiGroups: - "" resources: - endpoints - services - pods - namespaces verbs: - list - watch - apiGroups: - "" resources: - nodes verbs: - get - apiGroups: - discovery.k8s.io resources: - endpointslices verbs: - list - watch --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: obp-coredns roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: obp-coredns subjects: - kind: ServiceAccount name: obp-coredns namespace: obp-coredns - 블록체인 인스턴스에 대한 YAML 형식으로
coredns-custom-configmap파일을 생성합니다.
이전 예에서apiVersion: v1 kind: ConfigMap metadata: name: coredns-custom namespace: obp-coredns data: obp.server: |2 <instanceName>.<domain>:1053 { log kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } rewrite stop { name regex (.*)\.<instanceName>\.<domain>\ istio-ingressgateway.istio-system.svc.cluster.local answer auto } forward . /etc/resolv.conf }<instanceName>은 인스턴스의 이름이고<domain>은 상위 도메인입니다. - 다음 명령을 실행하여 사용자 정의
ConfigMap객체를 적용합니다.kubectl apply -f <coredns-custom-configmap-yaml-file> - 다음 명령을 실행하여 클러스터 IP 주소를 가져옵니다. IP 주소를 기록합니다.
kubectl get svc -n obp-coredns - 다음 명령을 실행하여 OpenShift DNS 사용자정의 리소스를 편집합니다.
kubectl edit dnses.operator/default - 다음 예와 같이 인스턴스 및 도메인 이름을 사용하도록 DNS 사용자정의 리소스의 영역 섹션을 업데이트합니다.
이전 예에서## Add the following section to the dns custom resource under spec servers: - forwardPlugin: policy: Random upstreams: - 192.0.2.233 name: obp-server zones: - <instanceName>.<domain><instanceName>은 인스턴스의 이름이고<domain>은 상위 도메인입니다. - 새 인스턴스를 추가하려면 다음 예와 같이
coredns-custom-configmap파일에 항목을 추가하고 새 인스턴스의 도메인에 대한 OpenShift DNS 사용자정의 리소스를 업데이트합니다.
DNS 변경사항을 적용하려면 인스턴스를 정지했다가 다시 시작해야 합니다.apiVersion: v1 kind: ConfigMap metadata: name: coredns-custom namespace: obp-coredns data: obp.server: |2 myobp.example.com:1053 { log kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } rewrite stop { name regex (.*)\.myobp\.example\.com istio-ingressgateway.istio-system.svc.cluster.local answer auto } forward . /etc/resolv.conf } otherobp.example.org:1053 { log kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } rewrite stop { name regex (.*)\.otherobp\.example\.org istio-ingressgateway.istio-system.svc.cluster.local answer auto } forward . /etc/resolv.conf } ## Edit the Openshift's DNS custom resource kubectl edit dnses.operator/default ## Add the new instance domain to the existing .spec.servers.zones servers: - forwardPlugin: policy: Random upstreams: - 192.0.2.233 name: obp-server zones: - myobp.example.com - otherobp.example.org
kubectl get virtualservice -n <instance-namespace> -o json | jq -r
.items[].spec.hosts[0]클러스터에 다른 노드 추가
- 다음 명령을 실행하여 보류 중 상태의 포드를 확인합니다.
또한 사용 가능한 포드가 없는지 확인할 수 있습니다.kubectl get pods -n <instancename> | grep Pendingkubectl get pods -n instancename - 그런 다음 사용 가능한 워커 노드를 확인합니다.
kubectl get nodes | grep worker - 새 포드를 가져올 수 있는 노드가 있는지 확인하려면 각 워커 노드에 대해 다음 명령을 실행합니다.
여기서 <worker_node>은 워커 노드의 이름입니다. 작업자 노드가 100% 용량을 초과하지 않는지 확인합니다.kubectl describe node $<worker_node> - 노드를 추가하려면 먼저 클러스터에서 MachineSets 수를 가져옵니다.
oc get machinesets -n openshift-machine-api - 노드가 2개 미만인 MachineSets의 경우 확장해 보십시오.
여기서 <obpee00-qtthx-worker-eastus2>는 노드 2개까지 확장하려는 MachineSet의 예제 이름입니다.oc scale --replicas=2 machineset <obpee00-qtthx-worker-eastus2> -n openshift-machine-api - 준비 및 사용 가능한 노드 목록이 선택한 노드 수에 도달할 때까지 MachineSets를 다시 질의합니다.
- 이제 실패한 인스턴스를 재배치할 수 있습니다.
인스턴스가 생성되고 인스턴스 목록에 나열되면 인스턴스 이름 옆의 메뉴에서 서비스 콘솔을 실행할 수 있습니다. Oracle Blockchain Platform 사용의 콘솔이란?에 설명된 대로 콘솔을 사용하여 네트워크를 구성합니다.