5.2. namespace への Ansible Automation Platform Operator のインストール
この手順を使用して、namespace を Operator にサブスクライブします。
OpenShift クラスターのデフォルト namespace に Ansible Automation Platform をデプロイすることはできません。aap 名前空間の使用を推奨します。カスタム namespace を使用できますが、Ansible Automation Platform のみを実行する必要があります。
手順
Operator にプロジェクトを作成します。
oc new-project ansible-automation-platform-
sub.yamlという名前のファイルを作成します。 以下の YAML コードを
sub.yamlファイルに追加します。--- apiVersion: v1 kind: Namespace metadata: labels: openshift.io/cluster-monitoring: "true" name: ansible-automation-platform --- apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: ansible-automation-platform-operator namespace: ansible-automation-platform spec: targetNamespaces: - ansible-automation-platform --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: ansible-automation-platform namespace: ansible-automation-platform spec: channel: 'stable-2.4' installPlanApproval: Automatic name: ansible-automation-platform-operator source: redhat-operators sourceNamespace: openshift-marketplace --- apiVersion: automationcontroller.ansible.com/v1beta1 kind: AutomationController metadata: name: example namespace: ansible-automation-platform spec: replicas: 1このファイルは
、ansible-automation-platformという名前のSubscriptionオブジェクトを作成し、ansible-automation-platform名前空間をansible-automation-platform-operatorオペレーターにサブスクライブします。次に、
ansible-automation-platformnamespace にexampleという名前のAutomationControllerオブジェクトを作成します。Automation Controller の名前を
例から変更するには、sub.yamlのkind: AutomationControllerセクションにある name フィールドを編集し、<automation_controller_name> を希望する名前に置き換えます。apiVersion: automationcontroller.ansible.com/v1beta1 kind: AutomationController metadata: name: <automation_controller_name> namespace: ansible-automation-platformoc applyコマンドを実行して、sub.yamlファイルで指定されたオブジェクトを作成します。oc apply -f sub.yaml
namespace が ansible-automation-platform-operator Operator に正常にサブスクライブされたことを確認するには、oc get subs コマンドを実行します。
$ oc get subs -n ansible-automation-platform
ネームスペースを Operator に登録する方法の詳細は、Red Hat OpenShift Container Platform Operators ガイドの CLI を使用した OperatorHub からのインストールを 参照してください。
OpenShift Container Platform CLI を使用して、作成した Automation Controller の Web アドレスとパスワードを取得できます。