This document describes recommended practices for developing and testing against this pattern.
While you may bring your own (BYO) OpenShift cluster, Red Hat associates and partners may utilize Red Hat Demo Platform (RHDP) to provision OpenShift environments for use as targets for pattern development and testing.
The following Catalog Item (CI) has been verified and is recommended when provisioning OpenShift clusters as it meets the prerequisites set form within the pattern:
The following options should be selected:
- Activity: Practice / Enablement
- Purpose: Trying out a technical solution
- Salesforce ID: Can be omitted (See note below)
- OpenShift Version: 4.20+
- Features
- Enable Cert Manager
- Enable Cert Manager API
- Control Plane Count: 3
NOTE: The Salesforce ID requirement is not needed by those that that are members of the RHDP development team.
Once a cluster has been provisioned, there are additional steps which need to be performed in order to avoid overlapping capabilities that are implemented within this pattern:
While cert-manager is a key feature offered within this pattern, RHDP deploys an instance to support the generation of API and Ingress certificates. Utilize the following steps to remove the conflicting resources.
- Login to the Web Console of the provisioned OpenShift cluster with the provided authentication details.
- Under Operators on the left hand navigation ad select Installed Operators
- Locate cert-manager Operator for Red Hat OpenShift and click the kabob (3 vertical dots) from the right hand column and select Uninstall Operator
- The
OperatorGroupassociated with Cert Manager must also be uninstalled. Under Home on the left hand navigation, select API Explorer - From the project dropdown at the top of the screen, select
cert-manager-operatoras the Project - In the search textbox, enter
OperatorGroupand select the link underneath the Name column associated with API Versionv1in the Version column. - Click on the Instances tab
- Locate any instances and click the kabob (3 vertical dots) from the right hand column and select Delete OperatorGroup
RHDP enables an inactivity timeout on tokens generated from the OpenShift OAuth server which logs a user out of the Web Console and CLI. To avoid such timeouts, the setting can be disabled by executing the following command:
oc patch oauth cluster --type json -p='[{"op": "remove", "path": "/spec/tokenConfig/accessTokenInactivityTimeout"}]'The updated setting will become enabled upon next login.
By default, NooBaa requires 100 Gi of disk space: 50 Gi for the database and 50 Gi for the default BackingStore. While this might make sense for production, in our development environment we will only be using a few images for testing, so it may be excessive.
If we want to save some space, we can add these overrides to the noobaa-mcg component in the values-hub.yaml file:
noobaa-mcg:
name: noobaa-mcg
namespace: openshift-storage
project: hub
path: charts/noobaa-mcg
annotations:
argocd.argoproj.io/sync-wave: "5"
overrides:
- name: noobaa.dbSize
value: 10Gi
- name: noobaa.pvPool.resources.requests.storage
value: 25GiAll sensitive credentials in this pattern are generated automatically and stored in HashiCorp Vault during deployment. There are no static default passwords. This section explains how to retrieve credentials for testing and exploration.
The Vault initialization data, including the root token, is stored in a Kubernetes Secret in the imperative namespace. Run the following command to extract the root token:
oc extract -n imperative secret/vaultkeys --to=- --keys=vault_data_json 2>/dev/null \
| jq -r ".root_token"Save this value — you will need it to authenticate to Vault in the steps below.
Get the Vault route URL and open it in a browser:
echo "https://$(oc get route -n vault vault -o jsonpath='{.spec.host}')"On the login screen select Token as the authentication method and paste the root token retrieved above.
You can query Vault directly from inside the vault-0 pod without installing any local tooling. First export the token into a shell variable:
VAULT_TOKEN=$(oc extract -n imperative secret/vaultkeys --to=- --keys=vault_data_json 2>/dev/null \
| jq -r ".root_token")Then use oc exec to run Vault commands. For example, to list the top-level secret paths:
oc exec -n vault vault-0 -- env VAULT_TOKEN="$VAULT_TOKEN" vault kv list secret/To read a specific secret, use vault kv get. For example, to read the Keycloak user credentials:
oc exec -n vault vault-0 -- env VAULT_TOKEN="$VAULT_TOKEN" \
vault kv get secret/hub/infra/users/keycloak-usersSecrets are organized by component under the secret/ KV mount. The table below lists the paths relevant to testing the default pattern deployment.
| Path | Contents |
|---|---|
secret/apps/qtodo/qtodo-db |
admin-password, db-password — PostgreSQL credentials for the qtodo app |
secret/apps/qtodo/qtodo-truststore |
truststore-password — Keycloak TLS truststore password for qtodo |
secret/hub/infra/keycloak/keycloak |
admin-password, db-password — Keycloak admin and database credentials |
secret/hub/infra/users/keycloak-users |
qtodo-admin-password, qtodo-user1-password, rhtpa-user-password, rhtas-user-password — application user passwords provisioned in Keycloak |
secret/hub/infra/acs/acs-central |
admin-password — ACS Central admin password |
secret/hub/infra/quay/quay-users |
quay-admin-password, quay-user-password — Quay registry credentials (optional component) |
secret/hub/infra/rhtpa/rhtpa-db |
db-password — RHTPA PostgreSQL password (optional component) |
secret/hub/infra/rhtpa/rhtpa-oidc-cli |
client-secret — RHTPA Keycloak OIDC client secret (optional component) |
Several secrets are automatically synchronized from Vault to Kubernetes Secrets by the External Secrets Operator (ESO). These can be read directly without going through Vault and are useful when you just need a quick credential lookup.
Keycloak user passwords (synced to keycloak-system):
oc get secret -n keycloak-system keycloak-users -o json \
| jq -r '.data | map_values(@base64d)'ACS Central admin password (synced to stackrox):
oc get secret -n stackrox central-htpasswd -o jsonpath='{.data.password}' | base64 -dNote
The root token grants unrestricted access to all secrets in Vault. Use it only for development and testing. For day-to-day exploration of a specific component's credentials, prefer the narrower ESO-synced Kubernetes Secrets shown above.
Metrics are captured to track the use of any of the Validated Patterns. It is important than an accurate depiction of pattern use by customers, partners and those from the community are captured. Red Hat associates should not factor into this calculation and support is available in the Validated Patterns framework to opt out of being captured.
To implement the opt-out capability, create a file in the location ~/.config/validated-patterns/pattern-uuid. The file does not need to have to be populated with any specific content. Its mere presence is all that is necessary for usage of the pattern to not be tracked.