A.3. 環境の設定
本章では、Red Hat Openshift Container Platform の環境設定に関する詳細について説明します。
A.3.1. Red Hat OpenShift Container Platform クラスターの準備 リンクのコピーリンクがクリップボードにコピーされました!
以下の手順を実行して、Red Hat OpenShift Container Platform クラスターを準備します。
マスターまたはクライアントで、以下のコマンドを実行し、クラスター管理者としてログインします。
# oc login以下は例になります。
# oc login Authentication required for https://dhcp46-24.lab.eng.blr.redhat.com:8443 (openshift) Username: test Password: Login successful. You have access to the following projects and can switch between them with 'oc project <project_name>': * default kube-system logging management-infra openshift openshift-infra Using project "default".マスターまたはクライアントで以下のコマンドを実行し、コンテナー化されたすべての Red Hat Gluster Storage サービスが含まれるプロジェクトを作成します。
# oc new-project <project_name>以下は例になります。
# oc new-project storage-project Now using project "storage-project" on server "https://master.example.com:8443"プロジェクトが作成されたら、マスターノードで以下のコマンドを実行し、Red Hat Gluster Storage コンテナーが特権モードでしか実行できないように、特権付きコンテナーのデプロイメントができるようにします。
# oc adm policy add-scc-to-user privileged -z defaultマスターで以下の手順を実行し、ルーターを設定します。
注記ルーターがすでに存在する場合は、手順 5 に進みます。ルーターがすでにデプロイされているかどうかを確認するには、以下のコマンドを実行します。
# oc get dc --all-namespacesすべての namespace のすべてのルーターを一覧表示するには、以下のコマンドを実行します。
# oc get dc --all-namespaces --selector=router=router NAME REVISION DESIRED CURRENT TRIGGERED BY glusterblock-storage-provisioner-dc 1 1 0 config heketi-storage 4 1 1 config以下のコマンドを実行して、ルーターのデプロイメントを有効にします。
# oc adm policy add-scc-to-user privileged -z router以下のコマンドを実行して、ルーターをデプロイします。
# oc adm router storage-project-router --replicas=1/etc/origin/master/master-config.yaml にある config.yaml ファイルのサブドメイン名を編集します。
以下は例になります。
subdomain: "cloudapps.mystorage.com"OpenShift Container Platform 3.7 および 3.9 の場合は、以下のコマンドを実行してサービスを再起動します。
# systemctl restart atomic-openshift-master-api atomic-openshift-master-controllers注記
ルーター設定の詳細は、https://access.redhat.com/documentation/ja-jp/openshift_container_platform/3.11/html/configuring_clusters/setting-up-a-router を参照してください。
以下のコマンドを実行して、ルーターが実行中かどうかを確認します。
# oc get dc <_router_name_>以下は例になります。
# oc get dc storage-project-router NAME REVISION DESIRED CURRENT TRIGGERED BY glusterblock-storage-provisioner-dc 1 1 0 config heketi-storage 4 1 1 config
ルーターが起動するまで、*/etc/dnsmasq.conf * ファイルを編集しないでください。
ルーターの実行後に、OpenShift クラスターのサービスにアクセスするように、クライアントを設定する必要があります。クライアントで以下の手順を実行し、DNS を設定します。
以下のコマンドを実行して、ルーターの IP アドレスを検索します。
# oc get pods -o wide --all-namespaces | grep router storage-project storage-project-router-1-cm874 1/1 Running 119d 10.70.43.132 dhcp43-132.lab.eng.blr.redhat.com/etc/dnsmasq.conf ファイルを編集し、以下の行をファイルに追加します。
address=/.cloudapps.mystorage.com/<Router_IP_Address>Router_IP_Address は、ルーターが実行されているノードの IP アドレスです。
以下のコマンドを実行して
dnsmasqサービスを再起動します。# systemctl restart dnsmasq/etc/resolv.conf を編集し、以下の行を追加します。
nameserver 127.0.0.1
DNS の設定に関する詳細は、https://access.redhat.com/documentation/ja-jp/openshift_container_platform/3.11/html/installing_clusters/install-config-install-prerequisites#prereq-dns を参照してください。