vania-janet/multiturn-rag-retrieval-data huggingface dataset:
2021/04/05 09:44:54 Terraform apply | sshcommand = ssh -J root@52.116.124.67  root@10.241.0.6
2021/04/05 09:44:54 Command finished successfully.
2021/04/05 09:45:00 Done with the workspace action

After the plan is successfully applied, it generates an sshcommand in the Outputs section in the Terraform code. You can use this command to log in to the Red Hat OpenShift cluster. If you specified IP addresses for ssh_allowed_ips property only, those IP address machines would be able to use this SSH command.





 Applying a plan using the API 



1. To apply a plan by using the IBM Cloud Schematics Python APIs, create a Python file and provide a name of your choice, for example, schematics_apply_plan.py.
2. Copy and paste the [Apply a plan using Schematics Python API](https://cloud.ibm.com/docs/hpc-openshift?topic=hpc-openshift-applying-plan&interface=apiexample-request-apply) example request to your Python file.
3. Change the following parameters as part of the request:



* Replace your IBM Cloud API key to the authenticator = IAMAuthenticator('<ibm-api-key>') variable.
* Change the API endpoint to the endpoint mentioned in [API endpoints](https://cloud.ibm.com/apidocs/schematics?code=pythonapi-endpoints) according to the location that you want your Schematics workspace to reside, for example, schematics_service.set_service_url('https://us.schematics.cloud.ibm.com').



4. Inside the schematics_service.apply_workspace_command function, provide the following parameters:
ibmcloud schematics logs --id <WORKSPACE_ID>





 Next steps 

After you've successfully generated a plan, you can begin [Applying a plan](https://cloud.ibm.com/docs/hpc-openshift?topic=hpc-openshift-applying-plan&interface=cli) to deploy your IBM Cloud resources to build a Red Hat® OpenShift® cluster instance.





 Generating a plan using the API 



1. To generate a plan by using IBM Cloud Schematics Python APIs, create a Python file and provide a name of your choice, for example, schematics_generate_plan.py.
2. Copy and paste the [Generate a plan using Schematics Python API](https://cloud.ibm.com/docs/hpc-openshift?topic=hpc-openshift-generate-plan&interface=apiexample-request-generate) example request to your Python file.
3. Change the following parameters as part of the request:



* Replace your IBM Cloud API key to the authenticator = IAMAuthenticator('<ibm-api-key>') variable.
* Change the API endpoint to the endpoint mentioned in [API endpoints](https://cloud.ibm.com/apidocs/schematics?code=pythonapi-endpoints) according to the location you want your Schematics workspace to reside, for example, schematics_service.set_service_url('https://us.schematics.cloud.ibm.com').



4. Inside the schematics_service.plan_workspace_command function, provide the following parameters:



* Provide the workspace ID that you created in the [Create a workspace](https://cloud.ibm.com/docs/hpc-openshift?topic=hpc-openshift-creating-workspace&interface=api) task or from the IBM Cloud console for Schematics, for example, us-south.workspace.Terraform-Schematics-Python-Workspace.b3bbc9f5.
cd /go/bin/terraform-ibm-openshift
5. Open the Terraform on IBM Cloud variables.tf file and review the default values that are set in the file. The variables.tf file specifies all information that you want to pass on to Terraform on IBM Cloud during the provisioning of your infrastructure resources. You can change the default values, but do not add sensitive data, such as your infrastructure user name and API key, to this file. The variables.tf file is usually stored under version control and shared across users.

vi variables.tf



 Variable Description Default value 

 app_count Enter the number of app nodes that you want to create. App nodes are used to run your app pods. 1 
 bastion_flavor Enter the flavor that you want to use for your Bastion virtual machine. The Bastion host is the only ingress point for SSH in the OpenShift cluster from external entities. When you connect to the OpenShift Container Platform infrastructure, the Bastion host forwards the request to the infrastructure or app server. For more information, see [Bastion instance](https://access.redhat.com/documentation/en-us/reference_architectures/2018/html/deploying_and_managing_openshift_3.9_on_google_cloud_platform/components_and_considerationsbastion_instance)![External link icon](https://cloud.ibm.com/docs-content/v1/content/4cd6263f39a034d265ddb4b0a5e6d50c55d13ee8/ibm-cloud-provider-for-terraform/icons/launch-glyph.svg). B1_4X16X100 
 datacenter Enter the zone where you want to provision your IBM Cloud classic infrastructure. To find existing zones, run ibmcloud ks zones. dal12 
 ibm_sl_api_key The IBM Cloud classic infrastructure API key to access classic infrastructure resources. Do not enter this information in this file. Instead, you are prompted to enter this information when you create the classic infrastructure resources.
* [vpcs command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_vpcs)
* [flavor command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_machine_types)



* [flavor get command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_flavor_get)
* [flavor ls command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_flavor_ls)



* [messages command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_messages)
* [locations command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_supported-locations)
* [versions command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_versions_command)
* [api command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_cli_api)
* [init command](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clics_init)
* [script commands](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-cliscript)



* [ibmcloud oc script update](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-cliscript_update)
Once the VMs are provisioned and attached to your location, you can assign them to IBM Cloud Satellite control plane or to the cloud services you want to use. To get started, see the [Automating your location set up with a Schematics template](https://cloud.ibm.com/docs/satellite?topic=satellite-locationssatloc-template).
* You can manually provision hosts either in your on-premises data center or in a public cloud. If you choose to manually provision the hosts for your location, make sure that your hosts meet the [minimum requirements](https://cloud.ibm.com/docs/satellite?topic=satellite-host-reqs) and that you allow the [required outbound network access](https://cloud.ibm.com/docs/satellite?topic=satellite-reqs-host-network).



3. [Create an IBM Cloud Satellite location](https://cloud.ibm.com/docs/satellite?topic=satellite-locations).
4. Attach your hosts to your location and [set up your location control plane](https://cloud.ibm.com/docs/satellite?topic=satellite-setup-control-plane).
5. [Attach at least 3 additional hosts to your location](https://cloud.ibm.com/docs/satellite?topic=satellite-attach-hosts) to use as the worker nodes for your Red Hat OpenShift on IBM Cloud cluster.







 Creating Red Hat OpenShift clusters on Satellite from the console 

Use the IBM Cloud console to create your Red Hat OpenShift clusters on your Satellite infrastructure.



1. [Complete the prerequisite steps](https://cloud.ibm.com/docs/openshift?topic=openshift-satellite-clusterssatcluster-prereqs).
2. From the [Red Hat OpenShift clusters console](https://cloud.ibm.com/kubernetes/clusters?platformType=openshift), click Create.
3. In the Infrastructure section, select Satellite.
4.
ibmcloud iam api-key-create myAK4sdh -d "This is your API Key for SAP Data Hub" 
--file myAK4sdh_file

b. For all subsequent logins use the API Key file that you created earlier during step a. The command is ibmcloud login --apikey @<APIKeyFilename>.

ibmcloud login --apikey @myAK4sdh_file







 Access the Red Hat OpenShift on IBM Cloud cluster 

After logging in to the jump host you must complete the following steps before you can work with your cluster.



1. Determine the cluster ID on which you want to install SAP Data Hub.

ibmcloud oc cluster ls

Name ID State Created Workers ...
RH_OS_DataHub_SAP_Test bmkg normal 3 months ago 3 ...
2. Download the Kubernetes configuration files and certificates to connect to your cluster.

The command is ibmcloud oc cluster config --cluster <clusterID> --admin. Copy the cluster ID from the previous step.

You can copy the export command from the response of the ibmcloud oc cluster config command.

ibmcloud oc cluster config --cluster bmkg --admin

export KUBECONFIG=/root/.bluemix/plugins/container-service/clusters/......-RH_OS_DataHub_SAP_Test.yml



You have created an Red Hat OpenShift on IBM Cloud cluster and prepared the jump host.







 Choosing the Dynamic Storage Provisioner 

Dynamic volume provisioning allows storage volumes to be created on-demand. IBM Cloud provides several [storage classes](https://cloud.ibm.com/docs/openshift?topic=openshift-storage_planning) that can be used as storage providers.

Use the steps below to define the default IBM Cloud storage class.



1. Select the appropriate storage class that will fit your needs.

For SAP Data Hub the ibmc-block-bronze storage class is recommended.
2.
IBM Cloud for tests 

Test out an IBM Cloud Satellite® location with virtual instances that you created in IBM Cloud.

Testing only: Satellite is an extension of IBM Cloud into other infrastructure providers. As such, adding IBM Cloud infrastructure hosts to Satellite is supported only for testing, demo, or proof of concept purposes. For production workloads in your Satellite location, use on-premises, edge, or other cloud provider hosts. You can also create Red Hat OpenShift on IBM Cloud clusters in the public cloud and add them to a Satellite Config cluster group to deploy the same app across your Satellite and IBM Cloud clusters.

If your hosts are running Red Hat CoreOS (RHCOS), you must manually attach them to your location.



 Manually adding IBM Cloud RHEL hosts to Satellite 

You can create your Satellite location by using hosts that you added from IBM Cloud.

All hosts that you want to add must meet the general host requirements, such as the RHEL 7 or 8 packages and networking setup. For more information, see [Host requirements](https://cloud.ibm.com/docs/satellite?topic=satellite-host-reqs).

Before you begin, [create a Satellite location](https://cloud.ibm.com/docs/satellite?topic=satellite-locations).



1. Follow the steps to create a [classic public virtual server](https://cloud.ibm.com/docs/virtual-servers?topic=virtual-servers-ordering-vs-public) or a virtual server instance in a [VPC](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-virtual-servers). Make sure that you select a supported RHEL 7 or 8 operating system or a supported Red Hat CoreOS (RHCOS) image, configure the machine with at least 4 CPU and 16 RAM, and add a boot disk with a size of at least 100 GB.
2. Wait for your virtual server instance to be provisioned.
3. Get the registration script to attach hosts to your IBM Cloud Satellite location. Note that the token in the script is an API key, which should be treated and protected as sensitive information.
[Install the Red Hat OpenShift (oc) and Kubernetes (kubectl) CLIs](https://cloud.ibm.com/docs/openshift?topic=openshift-cli-install).
3. To work with VPC, install the infrastructure-service plug-in. The prefix for running commands is ibmcloud is.

ibmcloud plugin install infrastructure-service
4. Update your Kubernetes Service plug-in to the latest version.

ibmcloud plugin update kubernetes-service







 Step 1: Create a cluster in a VPC 

Create an IBM Cloud Virtual Private Cloud (VPC) environment. Then, create a Red Hat OpenShift on IBM Cloud cluster on the VPC infrastructure. For more information about VPC, see [Getting Started with Virtual Private Cloud](https://cloud.ibm.com/docs/vpc?topic=vpc-getting-started).



1. Log in to the account, resource group, and IBM Cloud region where you want to create your VPC environment. The VPC must be set up in the same multizone metro location where you want to create your cluster. In this tutorial you create a VPC in us-south. For other supported regions, see [Multizone metros for VPC clusters](https://cloud.ibm.com/docs/openshift?topic=openshift-regions-and-zones). If you have a federated ID, include the --sso option.

ibmcloud login -r us-south [-g <resource_group>] [--sso]
2. Create a VPC for your cluster.
[Access your cluster](https://cloud.ibm.com/docs/openshift?topic=openshift-access_clusteraccess_cluster_sat) to access the Red Hat OpenShift web console or to run oc and kubectl commands from the CLI. If you enabled Satellite Config access, you must complete this step to synchronize the permissions.

If your location hosts have private network connectivity only, or if you use Amazon Web Services, Google Cloud Platform, or Microsoft Azure hosts, you must be connected to your hosts' private network, such as through VPN access, to connect to your cluster and access the Red Hat OpenShift web console. Alternatively, if your hosts have public network connectivity, you can test access to your cluster by changing your cluster's and location's DNS records to [use your hosts' public IP addresses](https://cloud.ibm.com/docs/openshift?topic=openshift-access_clustersat_public_access).
13. Optional: Set up an internal container image registry. For more information, see [Setting up the internal container image registry](https://cloud.ibm.com/docs/openshift?topic=openshift-satellite-clusterssatcluster-internal-registry) in the Red Hat OpenShift on IBM Cloud docs.
14. [Set up Satellite Config](https://cloud.ibm.com/docs/satellite?topic=satellite-setup-clusters-satconfig).







 Creating an API key 

Follow the steps to [create an API that can be used in your client account](https://cloud.ibm.com/docs/account?topic=account-userapikey&interface=ui).





 Setting up cluster admin and developer roles 

Follow the steps to set up the [cluster roles your client needs](https://cloud.ibm.com/docs/openshift?topic=openshift-usersexample-iam).
For Netweaver primary application server:



* ibm-redhat-7-6-amd64-sap-applications-3
* ibm-redhat-8-4-amd64-sap-applications-2
* ibm-sles-15-3-amd64-sap-applications-2



For HANA DB:



* ibm-redhat-7-6-amd64-sap-hana-3
* ibm-redhat-8-4-amd64-sap-hana-2
* ibm-sles-15-3-amd64-sap-hana-2



For both server instances there are:



* Two SSH keys configured to access as root user on SSH
* Three storage volumes as described in the input.auto.tfvars file.







 Before you begin 

Before you use the scripts:



* Log in to your previously created Deployment Server and verify that Terraform and Ansible are installed.
* If you have not already, create a Bastion Server to store the SAP kits. For more information, see [Automate SAP bastion server - SAP media storage repository](https://cloud.ibm.com/docs/sap?topic=sap-sap-bastion-server).
* Download the SAP kits from the SAP Portal to your Deployment Server. Make note of the download locations. Ansible decompresses all of the files. For more information, see the [JAVA README file](https://github.com/IBM-Cloud/sap-netweaver-java-hana) or the [ABAP README file](https://github.com/IBM-Cloud/sap-netweaver-abap-hana/blob/main/cli/README.md).
* [Create or retrieve an IBM Cloud API key](https://cloud.ibm.com/docs/account?topic=account-userapikeycreate_user_key). The API key is used to authenticate with the IBM Cloud platform and to determine your permissions for IBM Cloud services.
* To use the global functionality, you can use the ibmcloud oc init command again to target the global endpoint. Example to target the global endpoint again:

ibmcloud oc init --host https://containers.cloud.ibm.com





Red Hat OpenShift on IBM Cloud API:



* [Get started with the API](https://cloud.ibm.com/docs/openshift?topic=openshift-cs_api_installcs_api).
* [View documentation on the API commands](https://containers.cloud.ibm.com/global/swagger-global-api//).
* Generate a client of the API to use in automation by using the [swagger.json API](https://containers.cloud.ibm.com/global/swagger-global-api/swagger.json).



To interact with the global Red Hat OpenShift on IBM Cloud API, enter the command type and append global/v1/command to the endpoint.

Example of GET /clusters global API:

GET https://containers.cloud.ibm.com/global/v1/clusters

If you need to specify a region in an API call, remove the /global parameter from the path and pass the region name in the X-Region header. To list available regions, review the [Previous region](https://cloud.ibm.com/docs/openshift?topic=openshift-regions-and-zoneszones-mz) column in the Red Hat OpenShift on IBM Cloud locations table.
ibmcloud login --apikey @/APIKey4sdi_file
2. Install the Red Hat® OpenShift® on IBM Cloud® Container Registry and the container services plug-ins.

$ ibmcloud plugin install container-registry
$ ibmcloud plugin install container-service
3. For this example, the namespace name is sap_di_cr, which is an acronym for SAP Data Intelligence - Container Registry - OpenShift.

$ ibmcloud cr login

$ ibmcloud cr namespace-add sap_di_cr
4. Verify that the namespace is created.

ibmcloud cr namespace-list







 Accessing the Red Hat OpenShift on IBM Cloud cluster 

After logging in to the jump host you must complete the following steps before you can work with your cluster.



1. Determine the cluster ID on which you want to install SAP Data Intelligence.

ibmcloud oc cluster ls

Name ID State Created Workers ...
sap-di32-cluster bmkg normal 1 days ago 3 ...
...
2. Download the Kubernetes configuration files and certificates to connect the jump host to your cluster - copy the cluster name from the previous step.

ibmcloud oc cluster config --admin --cluster sap-di32-cluster
3. Logout of IBM Cloud.

ibmcloud logout



You have created a Red Hat OpenShift on IBM Cloud cluster, prepared the jump host and are now ready to prepare and install SAP Data Intelligence.



 Next Step 



* Continue with [Preparing and Installing SAP Data Intelligence](https://cloud.ibm.com/docs/sap?topic=sap-rhos-di-dataintelligence).
* If you aren't sure whether your account already has access to the IBM Cloud infrastructure portfolio, see [Understanding access to the infrastructure portfolio](https://cloud.ibm.com/docs/openshift?topic=openshift-access-credsunderstand_infra).
* If the account owner does not set the API key, [ensure that the user who sets the API key has the correct permissions](https://cloud.ibm.com/docs/openshift?topic=openshift-access-credsowner_permissions).
* For more information about using your Pay-As-You-Go or Subscription account to set the API key, see [Accessing the infrastructure portfolio with your IBM Cloud Pay-As-You-Go or Subscription account](https://cloud.ibm.com/docs/openshift?topic=openshift-access-credsdefault_account).
* If you don't have a Pay-As-You-Go or Subscription account or need to use a different IBM Cloud infrastructure account, see [Accessing a different IBM Cloud infrastructure account](https://cloud.ibm.com/docs/openshift?topic=openshift-access-credscredentials).







 Understanding how the API key works 

Red Hat OpenShift on IBM Cloud accesses the IBM Cloud infrastructure portfolio and other IBM Cloud services that you use for your cluster by using an [API key](https://cloud.ibm.com/docs/account?topic=account-manapikey). The API key impersonates, or stores the credentials of, a user with access to the infrastructure and other services. Red Hat OpenShift on IBM Cloud uses the API key to order resources in the service, such as new worker nodes or VLANs in IBM Cloud infrastructure.



 What is the API key used for? 

The API key is used to authorize underlying actions in the following IBM Cloud services.



* Infrastructure, such as classic or VPC compute, networking, and storage resources for your cluster.
[Architecture](https://cloud.ibm.com/docs-content/v1/content/f84e2238288b7f0355715a4c355609ce7ac48fb0/solution-tutorials/images/solution50-scalable-webapp-openshift/Architecture.png)

Figure 1. Architecture diagram of the tutorial



1. The developer deploys a web application using the code from a remote Git repository. Optionally, the dev can also push the code to a private Git repository on IBM Cloud.
2. A Docker container image is build from the code.
3. The image can pushed be pushed to a local container registry that comes with the cluster or to a namespace in IBM Cloud Container Registry.
4. The application is deployed to an Red Hat OpenShift on IBM Cloud cluster by pulling the image.
5. Users access the application.







 Before you begin 

This tutorial requires:



* IBM Cloud CLI,



* IBM Cloud Kubernetes Service plugin (kubernetes-service),
* (optional) Container Registry plugin (container-registry)



* Docker engine,
* oc to interact with Red Hat OpenShift on IBM Cloud,
* git to clone source code repository,
* (optional) IBM Cloud GitLab configured with your SSH key.Check the instructions under the Generate an SSH key pair and Add an SSH key to your GitLab account sections of the [documentation here](https://us-south.git.cloud.ibm.com/help/user/ssh.md)



You will find instructions to download and install these tools for your operating environment in the [Getting started with tutorials](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-tutorials) guide.

To avoid the installation of these tools, you can use the [Cloud Shell](https://cloud.ibm.com/shell) from the IBM Cloud console.
ibmcloud sat location ls

Example output

Retrieving locations...
OK
Name ID Status Ready Created Hosts (used/total) Managed From
mylocation brhtfum2015a6mgqj16g normal yes 4 days ago 3 / 6 Dallas
3. Create a Red Hat OpenShift cluster in your Satellite location. When you create the cluster, the cluster master is automatically created in your Satellite control plane.



* To ensure that hosts are automatically assigned as worker nodes in the default worker pool of your cluster, specify those hosts' labels in the --host-label options, and specify the number of worker nodes per zone in the --workers option.
* To enable cluster admin access for Satellite Config, include the --enable-admin-agent option. If you don't grant Satellite Config access, you can't later use the Satellite Config functionality to view or deploy Kubernetes resources for your clusters. If you want to enable access later, you can [create custom RBAC roles for Satellite Config](https://cloud.ibm.com/docs/satellite?topic=satellite-setup-clusters-satconfigcustom-access-cluster-wide).
* For more information about this command's options, see the [CLI reference documentation](https://cloud.ibm.com/docs/openshift?topic=openshift-kubernetes-service-clicli_cluster-create-satellite).



--operating-system REDHAT_7_64|REDHAT_8_64|RHCOS : Optional. The operating system of the worker nodes in your cluster. For a list of available operating sysems by cluster version, see [Available Red Hat OpenShift versions](https://cloud.ibm.com/docs/openshift?topic=openshift-openshift_versionsopenshift_versions_available). Note that to use your RHCOS hosts in your clusters, you must create a Red Hat CoreOS-enabled location and a cluster that runs version 4.9 or later.