Chapter 2. Installing Developer Hub on GKE with the Helm chart When you install the Developer Hub Helm chart in Google Kubernetes Engine (GKE), it orchestrates the deployment of a Developer Hub instance, which provides a robust developer platform within the GKE ecosystem. Prerequisites 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 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. 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 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. Note You need to create an A record with the value equal to the IP address. This process can take up to one hour to propagate. You have installed Helm 3 or the latest. For more information, see Installing Helm . 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/ Create a pull secret using the following command: kubectl -n <your-namespace> create secret docker-registry rhdh-pull-secret \ 1 --docker-server=registry.redhat.io \ --docker-username=<user_name> \ 2 --docker-password=<password> \ 3 --docker-email=<email> 4 1 Enter your GKE namespace in the command. 2 Enter your username in the command. 3 Enter your password in the command. 4 Enter your email address in the command. The created pull secret is used to pull the Developer Hub images from the Red Hat Ecosystem. Set up a Google-managed certificate by creating a ManagedCertificate object that you must attach to the ingress. Example of attaching a ManagedCertificate object to the ingress apiVersion: networking.gke.io/v1 kind: ManagedCertificate metadata: name: <rhdh_certificate_name> spec: domains: - <rhdh_domain_name> For more information about setting up a Google-managed certificate, see Setting up a Google-managed certificate . Create a FrontendConfig object to set a policy for redirecting to HTTPS. You must attach this policy to the ingress. Example of attaching a FrontendConfig object to the ingress apiVersion: networking.gke.io/v1beta1 kind: FrontendConfig metadata: name: <ingress_security_config> spec: sslPolicy: gke-ingress-ssl-policy-https redirectToHttps: enabled: true For more information about setting a policy to redirect to HTTPS, see HTTP to HTTPS redirects . Create a file named values.yaml using the following template: Example values.yaml file global: host: <rhdh_domain_name> route: enabled: false upstream: service: type: NodePort ingress: enabled: true annotations: kubernetes.io/ingress.class: gce kubernetes.io/ingress.global-static-ip-name: <ADDRESS_NAME> networking.gke.io/managed-certificates: <rhdh_certificate_name> networking.gke.io/v1beta1.FrontendConfig: <ingress_security_config> className: gce backstage: image: pullSecrets: - rhdh-pull-secret podSecurityContext: fsGroup: 2000 postgresql: image: pullSecrets: - rhdh-pull-secret primary: podSecurityContext: enabled: true fsGroup: 3000 volumePermissions: enabled: true Run the following command in your terminal to deploy Developer Hub using the latest version of Helm Chart and using the values.yaml file: helm -n <your_namespace> install -f values.yaml <your_deploy_name> \ openshift-helm-charts/redhat-developer-hub \ --version 1.4.2 For the latest Helm Chart version, see this Helm Charts repository. Verification Confirm that the deployment is complete. kubectl get deploy <you_deploy_name>-developer-hub -n <your_namespace> Verify that the service and ingress were created. kubectl get service -n <your_namespace> kubectl get ingress -n <your_namespace> Note Wait for the ManagedCertificate to be provisioned. This process can take a couple of hours. Access RHDH with https://<rhdh_domain_name> To upgrade your deployment, use the following command: helm -n <your_namespace> upgrade -f values.yaml <your_deploy_name> openshift-helm-charts/redhat-developer-hub --version <UPGRADE_CHART_VERSION> To delete your deployment, use the following command: helm -n <your_namespace> delete <your_deploy_name>

Commands:
helm repo add openshift-helm-charts https://charts.openshift.io/
-n <your-namespace> create secret docker-registry rhdh-pull-secret \ 1 --docker-server=registry.redhat.io --docker-username=<user_name> \ 2 --docker-password=<password> \ 3 --docker-email=<email> 4
apiVersion: networking.gke.io/v1 kind: ManagedCertificate metadata: name: <rhdh_certificate_name> spec: domains: - <rhdh_domain_name>
apiVersion: networking.gke.io/v1beta1 kind: FrontendConfig metadata: name: <ingress_security_config> spec: sslPolicy: gke-ingress-ssl-policy-https redirectToHttps: enabled: true
global: host: <rhdh_domain_name> route: enabled: false upstream: service: type: NodePort ingress: enabled: true annotations: kubernetes.io/ingress.class: gce kubernetes.io/ingress.global-static-ip-name: <ADDRESS_NAME> networking.gke.io/managed-certificates: <rhdh_certificate_name> networking.gke.io/v1beta1.FrontendConfig: <ingress_security_config> className: gce backstage: image: pullSecrets: - rhdh-pull-secret podSecurityContext: fsGroup: 2000 postgresql: image: pullSecrets: - rhdh-pull-secret primary: podSecurityContext: enabled: true fsGroup: 3000 volumePermissions: enabled: true
helm -n <your_namespace> install -f values.yaml <your_deploy_name> openshift-helm-charts/redhat-developer-hub --version 1.4.2
get deploy <you_deploy_name>-developer-hub -n <your_namespace>
get service -n <your_namespace> get ingress -n <your_namespace>
helm -n <your_namespace> upgrade -f values.yaml <your_deploy_name> openshift-helm-charts/redhat-developer-hub --version <UPGRADE_CHART_VERSION>
helm -n <your_namespace> delete <your_deploy_name>