Chapter 1. Installing the Developer Hub Operator with the OLM framework
You can install the Developer Hub Operator on GKE using the Operator Lifecycle Manager (OLM) framework. Following that, you can proceed to deploy your Developer Hub instance in GKE.
For information about the OLM, see Operator Lifecycle Manager(OLM) documentation.
Prerequisites
-
You have subscribed to
registry.redhat.io. For more information, see Red Hat Container Registry Authentication. - You have installed the Operator Lifecycle Manager (OLM). For more information about installation and troubleshooting, see How do I get Operator Lifecycle Manager?
-
You have installed
kubectl. For more information, see Install kubetl. - You have installed the Google Cloud CLI. For more information, see Install the gcloud CLI.
- You have logged in to your Google account and created a GKE Autopilot or GKE Standard cluster.
Procedure
Connect to your GKE cluster using the following command:
gcloud container clusters get-credentials <cluster-name> \ --location=<cluster-location>gcloud container clusters get-credentials <cluster-name> \1 --location=<cluster-location>2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command configures your Kubernetes client to point to your GKE cluster.
Run the following command in your terminal to create the
rhdh-operatornamespace where the Operator is installed:kubectl create namespace rhdh-operator
kubectl create namespace rhdh-operatorCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a pull secret using the following command:
kubectl -n rhdh-operator create secret docker-registry rhdh-pull-secret \ --docker-server=registry.redhat.io \ --docker-username=<user_name> \ --docker-password=<password> \ --docker-email=<email>kubectl -n rhdh-operator create secret docker-registry rhdh-pull-secret \ --docker-server=registry.redhat.io \ --docker-username=<user_name> \1 --docker-password=<password> \2 --docker-email=<email>3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow The created pull secret is used to pull the Developer Hub images from the Red Hat Ecosystem.
Create a
CatalogSourceresource that contains the Operator from the Red Hat Ecosystem:Example
CatalogSourceresourceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create an
OperatorGroupresource as follows:Example
OperatorGroupresourceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
Subscriptionresource using the following code:Example
SubscriptionresourceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to verify that the created Operator is running:
kubectl -n rhdh-operator get pods -w
kubectl -n rhdh-operator get pods -wCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the Operator pod shows
ImagePullBackOffstatus, you might need permission to pull the image directly within the Operator deployment’s manifest.TipYou can include the required secret name in the
deployment.spec.template.spec.imagePullSecretslist and verify the deployment name usingkubectl get deployment -n rhdh-operatorcommand. For example:kubectl -n rhdh-operator patch deployment \ rhdh.fast --patch '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"rhdh-pull-secret"}]}}}}' \ --type=mergekubectl -n rhdh-operator patch deployment \ rhdh.fast --patch '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"rhdh-pull-secret"}]}}}}' \ --type=mergeCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.1. Deploying the Developer Hub instance on GKE with the Operator Copy linkLink copied to clipboard!
You can deploy your Developer Hub instance in GKE using the Operator.
Prerequisites
- A cluster administrator has installed the Red Hat Developer Hub Operator.
-
You have subscribed to
registry.redhat.io. For more information, see Red Hat Container Registry Authentication. -
You have installed
kubectl. For more information, see Install kubetl. - You have configured a domain name for your Developer Hub instance.
- You have reserved a static external Premium IPv4 Global IP address that is not attached to any virtual machine (VM). For more information see Reserve a new static external IP address
You have configured the DNS records for your domain name to point to the IP address that has been reserved.
NoteYou need to create an
Arecord with the value equal to the IP address. This process can take up to one hour to propagate.
Procedure
Create a
app-config.yamlconfig map containing theapp-config.yamlDeveloper Hub configuration file by using the following template:app-config.yamlfragmentCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
<my_product_secrets>secret and add a key namedBACKEND_SECRETwith aBase64-encodedstring value as shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
<my_product_secrets>is your preferred Developer Hub secret name, where<my_product_secrets>specifies the identifier for your secret configuration within Developer Hub.
ImportantEnsure that you use a unique value of
BACKEND_SECRETfor each Developer Hub instance.You can use the following command to generate a key:
node-p'require("crypto").randomBytes(24).toString("base64")'node-p'require("crypto").randomBytes(24).toString("base64")'Copy to Clipboard Copied! Toggle word wrap Toggle overflow To enable pulling the PostgreSQL image from the Red Hat Ecosystem Catalog, add the image pull secret in the default service account within the namespace where the Developer Hub instance is being deployed:
kubectl patch serviceaccount default \ -p '{"imagePullSecrets": [{"name": "rhdh-pull-secret"}]}' \ -n <your_namespace>kubectl patch serviceaccount default \ -p '{"imagePullSecrets": [{"name": "rhdh-pull-secret"}]}' \ -n <your_namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create your
Backstagecustom resource (CR) file using the following template:Custom resource fragment
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
<my_product_secrets>is your preferred Developer Hub secret name, where<my_product_secrets>specifies the identifier for your secret configuration within Developer Hub.
Set up a Google-managed certificate by creating a
ManagedCertificateobject which you must attach to the Ingress as shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about setting up a Google-managed certificate, see Setting up a Google-managed certificate.
Create a
FrontendConfigobject to set a policy for redirecting to HTTPS. You must attach this policy to the Ingress.Example of a
FrontendConfigobjectCopy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about setting a policy to redirect to HTTPS, see HTTP to HTTPS redirects.
Create an ingress resource using the following template, customizing the names as needed:
Example of an ingress resource configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
Wait for the
ManagedCertificateto be provisioned. This process can take a couple of hours. -
Access RHDH with
https://<rhdh_domain_name>
Additional information
For more information on setting up GKE using Ingress with TLS, see Secure GKE Ingress.