Lab 11.1 - Install PostgreSQL using OperatorHub Resources

1. Login to the OKD web console as the admin user.

2. Click Operators → OperatorHub and then click Database to display the list of database operators available from OperatorHub. Type Postgres in the Filter by keyword field, and then click PostgreSQL Operator by Dev4Ddevs.com

3. Click Continue to view the community operator page, and then click Install.

4. Select the console-apps namespace, leave the other form fields unchanged and then click install.

Ensure the status succeded

5. Log out and log in back as the developer user.

6. Switch to Administrator preview and select the console-apps project to see the resources associated with the console-apps project.

7. Click Operators → Installed Operators, you will see that PostgreSQL already installed

And then click the PostgreSQL Operator by Dev4Devs.com link to display the Operator Details page.

8. Create the Database YAML on Database Database tab to specify the PostgreSQL image provided by Red Hat.

Edit the YAML with:

apiVersion: postgresql.dev4devs.com/v1alpha1
kind: Database
metadata:
  name: database
  namespace: console-apps
spec:
  databaseCpu: 30m
  databaseCpuLimit: 60m
  databaseMemoryLimit: 512Mi
  databaseMemoryRequest: 128Mi
  databaseName: example-db
  databaseNameKeyEnvVar: POSTGRESQL_DATABASE
  databasePassword: postgres
  databasePasswordKeyEnvVar: POSTGRESQL_PASSWORD
  databaseStorageRequest: 1Gi
  databaseUser: postgres
  databaseUserKeyEnvVar: POSTGRESQL_USER
  image: centos/postgresql-96-centos7
  size: 1

9. Click Create to add the Database resource. The PostgreSQL operator will read the specification and automatically create the new database's workload, network, and storage.

10. Click Workloads → Deployments and inspect the list of deployments.

11. Click Networking → Services and then click the database service name to see the details of the service created by the PostgreSQL operator.

12. Click Storage → Persistent Volume Claims and then click the database PVC to see the details of the Persistent Volume Claim created by the PostgreSQL operator

Daftar Materi