This documentation is for a release that is no longer maintained
See documentation for the latest supported version.Chapter 3. Red Hat Developer Hub integration with Amazon Web Services (AWS)
You can integrate your Red Hat Developer Hub application with Amazon Web Services (AWS), which can help you streamline your workflows within the AWS ecosystem. Integrating the Developer Hub resources with AWS provides access to a comprehensive suite of tools, services, and solutions.
The integration with AWS requires the deployment of Developer Hub in Elastic Kubernetes Service (EKS) using one of the following methods:
- The Helm chart
- The Red Hat Developer Hub Operator
3.1. Deploying Red Hat Developer Hub in Elastic Kubernetes Service (EKS) using Helm Chart Copy linkLink copied to clipboard!
When you deploy Developer Hub in Elastic Kubernetes Service (EKS) using Helm Chart, it orchestrates a robust development environment within the AWS ecosystem.
Prerequisites
- You have an EKS cluster with AWS Application Load Balancer (ALB) add-on installed. For more information, see Application load balancing on Amazon Developer Hub and Installing the AWS Load Balancer Controller add-on.
- You have configured a domain name for your Developer Hub instance. The domain name can be a hosted zone entry on Route 53 or managed outside of AWS. For more information, see Configuring Amazon Route 53 as your DNS service documentation.
- You have an entry in the AWS Certificate Manager (ACM) for your preferred domain name. Make sure to keep a record of your Certificate ARN.
-
You have subscribed to
registry.redhat.io
. For more information, see Red Hat Container Registry Authentication. -
You have set the context to the EKS cluster in your current
kubeconfig
. For more information, see Creating or updating a kubeconfig file for an Amazon EKS cluster. -
You have installed
kubectl
. For more information, see Installing or updating kubectl. - You have installed Helm 3 or the latest. For more information, see Using Helm with Amazon EKS.
Procedure
Go to your terminal and run the following command to add the Helm chart repository containing the Developer Hub chart to your local Helm registry:
helm repo add openshift-helm-charts https://charts.openshift.io/
helm repo add openshift-helm-charts https://charts.openshift.io/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a pull secret using the following command:
kubectl create secret docker-registry rhdh-pull-secret \ --docker-server=registry.redhat.io \ --docker-username=<user_name> \ --docker-password=<password> \ --docker-email=<email>
kubectl 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 file named
values.yaml
using the following template:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command in your terminal to deploy Developer Hub using the latest version of Helm Chart and using the values.yaml file created in the previous step:
helm install rhdh \ openshift-helm-charts/redhat-developer-hub \ [--version 1.1.4] \ --values /path/to/values.yaml
helm install rhdh \ openshift-helm-charts/redhat-developer-hub \ [--version 1.1.4] \ --values /path/to/values.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteFor the latest chart version, see https://github.com/openshift-helm-charts/charts/tree/main/charts/redhat/redhat/redhat-developer-hub
Verification
Wait until the DNS name is responsive, indicating that your Developer Hub instance is ready for use.
3.2. Deploying Red Hat Developer Hub on Elastic Kubernetes Service (EKS) using the Operator Copy linkLink copied to clipboard!
You can deploy the Developer Hub on EKS using the Red Hat Developer Hub Operator with or without Operator Lifecycle Manager (OLM) framework. Following that, you can proceed to install your Developer Hub instance in EKS.
3.2.1. Installing the Red Hat Developer Hub Operator with the OLM framework Copy linkLink copied to clipboard!
Prerequisites
-
You have set the context to the EKS cluster in your current
kubeconfig
. For more information, see Creating or updating a kubeconfig file for an Amazon EKS cluster. -
You have installed
kubectl
. For more information, see Installing or updating kubectl. -
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?
Procedure
Run the following command in your terminal to create the
rhdh-operator
namespace where the Operator is installed:kubectl create namespace rhdh-operator
kubectl create namespace rhdh-operator
Copy 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
CatalogSource
resource that contains the Operators from the Red Hat Ecosystem:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an
OperatorGroup
resource as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
Subscription
resource using the following code:Copy 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 -w
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the operator pod shows
ImagePullBackOff
status, then you might need permissions to pull the image directly within the Operator deployment’s manifest.TipYou can include the required secret name in the
deployment.spec.template.spec.imagePullSecrets
list and verify the deployment name usingkubectl get deployment -n rhdh-operator
command:kubectl -n rhdh-operator patch deployment \ rhdh.fast --patch '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"rhdh-pull-secret"}]}}}}' \ --type=merge
kubectl -n rhdh-operator patch deployment \ rhdh.fast --patch '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"rhdh-pull-secret"}]}}}}' \ --type=merge
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the default configuration of the operator to ensure that Developer Hub resources can start correctly in EKS using the following steps:
Edit the
backstage-default-config
ConfigMap in therhdh-operator
namespace using the following command:kubectl -n rhdh-operator edit configmap backstage-default-config
kubectl -n rhdh-operator edit configmap backstage-default-config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Locate the
db-statefulset.yaml
string and add thefsGroup
to itsspec.template.spec.securityContext
, as shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Locate the
deployment.yaml
string and add thefsGroup
to its specification, as shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Locate the
service.yaml
string and change thetype
toNodePort
as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save and exit.
Wait for a few minutes until the changes are automatically applied to the operator pods.
3.2.2. Installing the Red Hat Developer Hub Operator without the OLM framework Copy linkLink copied to clipboard!
Prerequisites
You have installed the following commands:
-
git
-
make
-
sed
-
Procedure
Clone the Operator repository to your local machine using the following command:
git clone --depth=1 https://github.com/janus-idp/operator.git rhdh-operator && cd rhdh-operator
git clone --depth=1 https://github.com/janus-idp/operator.git rhdh-operator && cd rhdh-operator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command and generate the deployment manifest:
make deployment-manifest
make deployment-manifest
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The previous command generates a file named
rhdh-operator-<VERSION>.yaml
, which is updated manually.Run the following command to apply replacements in the generated deployment manifest:
sed -i "s/backstage-operator/rhdh-operator/g" rhdh-operator-*.yaml sed -i "s/backstage-system/rhdh-operator/g" rhdh-operator-*.yaml sed -i "s/backstage-controller-manager/rhdh-controller-manager/g" rhdh-operator-*.yaml
sed -i "s/backstage-operator/rhdh-operator/g" rhdh-operator-*.yaml sed -i "s/backstage-system/rhdh-operator/g" rhdh-operator-*.yaml sed -i "s/backstage-controller-manager/rhdh-controller-manager/g" rhdh-operator-*.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Open the generated deployment manifest file in an editor and perform the following steps:
Locate the
db-statefulset.yaml
string and add thefsGroup
to itsspec.template.spec.securityContext
, as shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Locate the
deployment.yaml
string and add thefsGroup
to its specification, as shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Locate the
service.yaml
string and change thetype
toNodePort
as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the default images with the images that are pulled from the Red Hat Ecosystem:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Add the image pull secret to the manifest in the Deployment resource as follows:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the manifest to deploy the operator using the following command:
kubectl apply -f rhdh-operator-VERSION.yaml
kubectl apply -f rhdh-operator-VERSION.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to verify that the Operator is running:
kubectl -n rhdh-operator get pods -w
kubectl -n rhdh-operator get pods -w
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2.3. Installing the Developer Hub instance in EKS Copy linkLink copied to clipboard!
After the Red Hat Developer Hub Operator is installed and running, you can create a Developer Hub instance in EKS.
Prerequisites
- You have an EKS cluster with AWS Application Load Balancer (ALB) add-on installed. For more information, see Application load balancing on Amazon Elastic Kubernetes Service and Installing the AWS Load Balancer Controller add-on.
- You have configured a domain name for your Developer Hub instance. The domain name can be a hosted zone entry on Route 53 or managed outside of AWS. For more information, see Configuring Amazon Route 53 as your DNS service documentation.
- You have an entry in the AWS Certificate Manager (ACM) for your preferred domain name. Make sure to keep a record of your Certificate ARN.
-
You have subscribed to
registry.redhat.io
. For more information, see Red Hat Container Registry Authentication. -
You have set the context to the EKS cluster in your current
kubeconfig
. For more information, see Creating or updating a kubeconfig file for an Amazon {eks} cluster. -
You have installed
kubectl
. For more information, see Installing or updating kubectl.
Procedure
Create a ConfigMap named
app-config-rhdh
containing the Developer Hub configuration using the following template:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Secret named
secrets-rhdh
and add a key namedBACKEND_SECRET
with aBase64-encoded
string as value:Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEnsure that you use a unique value of
BACKEND_SECRET
for 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 a Custom Resource file using the following template:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an Ingress resource using the following template, ensuring to customize the names as needed:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the previous template, replace ` <rhdh_dns_name>` with your Developer Hub domain name and update the value of
alb.ingress.kubernetes.io/certificate-arn
with your certificate ARN.
Verification
Wait until the DNS name is responsive, indicating that your Developer Hub instance is ready for use.
3.3. Monitoring and logging with Amazon Web Services (AWS) in Red Hat Developer Hub Copy linkLink copied to clipboard!
In the Red Hat Developer Hub, monitoring and logging are facilitated through Amazon Web Services (AWS) integration. With features like Amazon CloudWatch for real-time monitoring and Amazon Prometheus for comprehensive logging, you can ensure the reliability, scalability, and compliance of your Developer Hub application hosted on AWS infrastructure.
This integration enables you to oversee, diagnose, and refine your applications in the Red Hat ecosystem, leading to an improved development and operational journey.
3.3.1. Monitoring with Amazon Prometheus Copy linkLink copied to clipboard!
Red Hat Developer Hub provides Prometheus metrics related to the running application. For more information about enabling or deploying Prometheus for EKS clusters, see Prometheus metrics in the Amazon documentation.
To monitor Developer Hub using Amazon Prometheus, you need to create an Amazon managed service for the Prometheus workspace and configure the ingestion of the Developer Hub Prometheus metrics. For more information, see Create a workspace and Ingest Prometheus metrics to the workspace sections in the Amazon documentation.
After ingesting Prometheus metrics into the created workspace, you can configure the metrics scraping to extract data from pods based on specific pod annotations.
3.3.1.1. Configuring annotations for monitoring Copy linkLink copied to clipboard!
You can configure the annotations for monitoring in both Helm deployment and Operator-backed deployment.
- Helm deployment
To annotate the backstage pod for monitoring, update your
values.yaml
file as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Operator-backed deployment
Procedure
As an administrator of the operator, edit the default configuration to add Prometheus annotations as follows:
Update OPERATOR_NS accordingly
# Update OPERATOR_NS accordingly OPERATOR_NS=rhdh-operator kubectl edit configmap backstage-default-config -n "${OPERATOR_NS}"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Find the
deployment.yaml
key in the ConfigMap and add the annotations to thespec.template.metadata.annotations
field as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save your changes.
Verification
To verify if the scraping works:
Use
kubectl
to port-forward the Prometheus console to your local machine as follows:kubectl --namespace=prometheus port-forward deploy/prometheus-server 9090
kubectl --namespace=prometheus port-forward deploy/prometheus-server 9090
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Open your web browser and navigate to
http://localhost:9090
to access the Prometheus console. -
Monitor relevant metrics, such as
process_cpu_user_seconds_total
.
3.3.2. Logging with Amazon CloudWatch logs Copy linkLink copied to clipboard!
Logging within the Red Hat Developer Hub relies on the winston library. By default, logs at the debug level are not recorded. To activate debug logs, you must set the environment variable LOG_LEVEL
to debug in your Red Hat Developer Hub instance.
3.3.2.1. Configuring the application log level Copy linkLink copied to clipboard!
You can configure the application log level in both Helm deployment and Operator-backed deployment.
- Helm deployment
To update the logging level, add the environment variable
LOG_LEVEL
to your Helm chart’svalues.yaml
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Operator-backed deployment
You can modify the logging level by including the environment variable
LOG_LEVEL
in your custom resource as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.2.2. Retrieving logs from Amazon CloudWatch Copy linkLink copied to clipboard!
The CloudWatch Container Insights are used to capture logs and metrics for Amazon EKS. For more information, see Logging for Amazon EKS documentation.
To capture the logs and metrics, install the Amazon CloudWatch Observability EKS add-on in your cluster. Following the setup of Container Insights, you can access container logs using Logs Insights or Live Tail views.
CloudWatch names the log group where all container logs are consolidated in the following manner:
/aws/containerinsights/<ClusterName>/application
Following is an example query to retrieve logs from the Developer Hub instance:
fields @timestamp, @message, kubernetes.container_name | filter kubernetes.container_name in ["install-dynamic-plugins", "backstage-backend"]
fields @timestamp, @message, kubernetes.container_name
| filter kubernetes.container_name in ["install-dynamic-plugins", "backstage-backend"]
3.4. Using Amazon Cognito as an authentication provider in Red Hat Developer Hub Copy linkLink copied to clipboard!
In this section, Amazon Cognito is an AWS service for adding an authentication layer to Developer Hub. You can sign in directly to the Developer Hub using a user pool or fedarate through a third-party identity provider.
Although Amazon Cognito is not part of the core authentication providers for the Developer Hub, it can be integrated using the generic OpenID Connect (OIDC) provider.
You can configure your Developer Hub in both Helm Chart and Operator-backed deployments.
Prerequisites
You have a User Pool or you have created a new one. For more information about user pools, see Amazon Cognito user pools documentation.
NoteEnsure that you have noted the AWS region where the user pool is located and the user pool ID.
You have created an App Client within your user pool for integrating the hosted UI. For more information, see Setting up the hosted UI with the Amazon Cognito console.
When setting up the hosted UI using the Amazon Cognito console, ensure to make the following adjustments:
-
In the Allowed callback URL(s) section, include the URL
https://<rhdh_url>/api/auth/oidc/handler/frame
. Ensure to replace<rhdh_url>
with your Developer Hub application’s URL, such as,my.rhdh.example.com
. -
Similarly, in the Allowed sign-out URL(s) section, add
https://<rhdh_url>
. Replace<rhdh_url>
with your Developer Hub application’s URL, such asmy.rhdh.example.com
. - Under OAuth 2.0 grant types, select Authorization code grant to return an authorization code.
Under OpenID Connect scopes, ensure to select at least the following scopes:
- OpenID
- Profile
- Helm deployment
Procedure
Edit or create your custom
app-config-rhdh
ConfigMap as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit or create your custom
secrets-rhdh
Secret using the following template:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add references of both the ConfigMap and Secret resources in your
values.yaml
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Upgrade the Helm deployment:
helm upgrade rhdh \ openshift-helm-charts/redhat-developer-hub \ [--version 1.1.4] \ --values /path/to/values.yaml
helm upgrade rhdh \ openshift-helm-charts/redhat-developer-hub \ [--version 1.1.4] \ --values /path/to/values.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Operator-backed deployment
Add the following code to your
app-config-rhdh
ConfigMap:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following code to your
secrets-rhdh
Secret:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure your Custom Resource contains references to both the
app-config-rhdh
ConfigMap andsecrets-rhdh
Secret:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: If you have an existing Developer Hub instance backed by the Custom Resource and you have not edited it, you can manually delete the Developer Hub deployment to recreate it using the operator. Run the following command to delete the Developer Hub deployment:
kubectl delete deployment -l app.kubernetes.io/instance=<CR_NAME>
kubectl delete deployment -l app.kubernetes.io/instance=<CR_NAME>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
In the Allowed callback URL(s) section, include the URL
Verification
- Navigate to your Developer Hub web URL and sign in using OIDC authentication, which prompts you to authenticate through the configured AWS Cognito user pool.
- Once logged in, access Settings and verify user details.