abstract | authors | completed_date | components | draft | excerpt | keywords | last_updated | primary_tag | pta | pwg | related_content | related_links | runtimes | series | services | subtitle | tags | title | translators | type | |||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2020-07-03 |
|
true|false |
|
|
|
|
tutorial |
-
Follow the steps below to launch the cluster console which is also called RedHat OpenShift Container Platform.
-
Login to IBM Cloud Account and navigate to Dashboard as shown.
- Click on Clusters and select the cluster which you have created under prerequisites. In our case, cluster name is cp-rhm-poc.
- After you launch the cluster, click on OpenShift web console on the top right hand side.
- We can see the RedHat OpenShift Container Platform (Web Console). Click on question mark icon on the top right hand side and select Command Line Tools.
- Navigate to the section
oc - OpenShift Command Line Interface (CLI)
and download the respective oc binary onto your local system.
NOTE: This is needed to manage OpenShift projects from a terminal and is further extended to natively support OpenShift Container Platform features.
- We are all set to proceed to next step which is to register the OpenShift cluster on RedHat Marketplace platform.
NOTE: This is mandatory to install any operators from RedHat Marketplace platform using the OpenShift cluster.
- Sign up and login to RHM portal at Link and click on workspace and then click on cluster. We need to add our new OpenShift cluster and register it on RHM platform.
- Update the cluster name, generate the pull secret as per the instructions and save it as shown.
- Copy the curl command which starts with
curl -sL https
and append the pull secret towards the end.
NOTE: The entire script should be handy to be used in next step.
- We need to start the cluster first to register it. Open a terminal and type
oc login
, update theusername
andpassword
which are used for accessing the cluster and hit enter.
- The cluster is up and running at this point. We need to run the entire script which is from previous step and hit enter. It will take a couple of mins and we can see that we have successfully registered the cluster on RHM portal.
- We need to create a project to be used and managed from command line. Click on Create Project and give a name as
Crunchydb-test-project
.
- Navigate to OpenShift web console which was launched during previous step. Select operatorhub under Operators and type 'Crunchy' in the search bar.
- Click on Crunchy Postgres Operator (non custom) and click install.
- Create Operator Subscription by choosing All namespaces or specific namespace (select default project crunchy-project) and click subscribe.
- After a couple of minutes, the operator gets installed on the cluster. We can verify by clicking on Installed Operators under
Operators
and see that the operator is successfully installed with status showing as Succeeded.
-
Login to the ROKS(IBM Managed) Openshift cluster through CLI(command line Iterface). To login you would require token which can be genrated after you login to Openshift Cluster web console. See below screenshot to
copy the path
. -
A new window will open with the login token details. See below screenshot for details. Copy the login token as per the below screenshot.
-
In terminal, paste the login command, Once you login you would see a similar screen as shown below.
- (i). Use the new namespace where we have isntalled the Crunchy Postgres operator.
- (ii). Run the below command in CLI(command line Iterface). Once it runs successfully, check for the logs and be sure there are no errors in the ansible script. Wait for the pod state to change to complete state.
oc create -f postgres-operator.yml
oc get po NAME READY STATUS RESTARTS AGE pgo-deploy-zl6sz 0/1 Completed 0 24h
-
(iii). switch to pgo namespace.
-
(iv). Edit
pgo-config configmap
and updateDisableFSGroup
tofalse
. -
(v). Restart postgress operator pod. postgres-operator-f7d8c5667-4hhrk
Note:
Reason for above step (iv, v):
Crunchy PostgreSQL for Kubernetes is set up to work with the "restricted" SCC by default, but we may need to make modifications. In this mode, we will want to ensure that "DisableFSGroup" is set to false mentioned "pgo-config" ConfigMap. Making changes to the "pgo-config" ConfigMap, we will have to restart the "postgres-operator" Pod.
-
(vi). Download the pgo binary mentioned in the document URL
-
(vii). Make sure the pvc are in bound state. Run the below command:
oc get pvc
-
(viii). Create database using below command.
pgo create cluster -n pgo hippo
This will create database (pods) in pgo namespace. -
(ix). To validate run below commands. a .
pgo show cluster -n pgo hippo
b.pgo test -n pgo hippo
Attached is the postgres-operator.yml updated file. (edited) Download postgres-operator.yml
-
Let us view the results of the commands we ran in the earlier steps via the pgAdmin 4 console. The console can be accessed at localhost with port forwarding.
-
Run the following command in Terminal:
$ pgo create pgadmin hippo
-
This creates a pgAdmin 4 deployment unique to this PostgreSQL cluster and synchronizes the PostgreSQL user information into it.
-
To access pgAdmin 4, you can set up a
port-forward
to the Service, which follows the pattern<clusterName>-pgadmin
, to port5050
:
$ kubectl port-forward -n pgo svc/hippo-pgadmin 5050:5050
Forwarding from 127.0.0.1:5050 -> 5050
Forwarding from [::1]:5050 -> 5050
- Open http://localhost:5050 on your browser and use your database username (e.g.
hippo
) and password (e.g.datalake
) to log in.
(Note: if your password does not appear to work, you can retry setting up the user with the pgo update user command: pgo update user -n pgo --username=hippo --password=datalake hippo
)
- Once logged in, you can see the pgAdmin 4 console as shown.