|
| 1 | +[id='proc-rhdh-deploy-gke-helm_{context}'] |
| 2 | += Installing {product-short} on {gke-short} with the Helm chart |
| 3 | + |
| 4 | +When you install the {product-short} Helm chart in {gke-brand-name} ({gke-short}), it orchestrates the deployment of a {product-short} instance, which provides a robust developer platform within the {gke-short} ecosystem. |
| 5 | + |
| 6 | +.Prerequisites |
| 7 | +* You have subscribed to `registry.redhat.io`. For more information, see https://access.redhat.com/RegistryAuthentication[{company-name} Container Registry Authentication]. |
| 8 | +* You have installed `kubectl`. For more information, see https://kubernetes.io/docs/tasks/tools/#kubectl[Install kubetl]. |
| 9 | +* You have installed the Google Cloud CLI. For more information, see https://cloud.google.com/sdk/docs/install[Install the gcloud CLI]. |
| 10 | +* You have logged in to your Google account and created a https://cloud.google.com/kubernetes-engine/docs/how-to/creating-an-autopilot-cluster[GKE Autopilot] or https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-zonal-cluster[GKE Standard] cluster. |
| 11 | + |
| 12 | + |
| 13 | +* You have configured a domain name for your {product-short} instance. |
| 14 | +* You have reserved a static external Premium IPv4 Global IP address that is not attached to any VM. For more information see https://cloud.google.com/vpc/docs/reserve-static-external-ip-address#reserve_new_static[Reserve a new static external IP address] |
| 15 | +* You have configured the DNS records for your domain name to point to the IP address that has been reserved. |
| 16 | ++ |
| 17 | +[NOTE] |
| 18 | +==== |
| 19 | +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. |
| 20 | +==== |
| 21 | +* You have installed Helm 3 or the latest. For more information, see https://helm.sh/docs/intro/install[Installing Helm]. |
| 22 | + |
| 23 | +.Procedure |
| 24 | +. Go to your terminal and run the following command to add the Helm chart repository containing the {product-short} chart to your local Helm registry: |
| 25 | ++ |
| 26 | +-- |
| 27 | +[source,terminal] |
| 28 | +---- |
| 29 | +helm repo add openshift-helm-charts https://charts.openshift.io/ |
| 30 | +---- |
| 31 | +-- |
| 32 | + |
| 33 | +. Create a pull secret using the following command: |
| 34 | ++ |
| 35 | +-- |
| 36 | +[source,terminal] |
| 37 | +---- |
| 38 | +kubectl -n <your-namespace> create secret docker-registry rhdh-pull-secret \ <1> |
| 39 | + --docker-server=registry.redhat.io \ |
| 40 | + --docker-username=<user_name> \ <2> |
| 41 | + --docker-password=<password> \ <3> |
| 42 | + --docker-email=<email> <4> |
| 43 | +---- |
| 44 | +<1> Enter your {gke-short} namespace in the command. |
| 45 | +<2> Enter your username in the command. |
| 46 | +<3> Enter your password in the command. |
| 47 | +<4> Enter your email address in the command. |
| 48 | + |
| 49 | +The created pull secret is used to pull the {product-short} images from the {company-name} Ecosystem. |
| 50 | +-- |
| 51 | + |
| 52 | +. Set up a Google-managed certificate by creating a `ManagedCertificate` object that you must attach to the ingress. |
| 53 | ++ |
| 54 | +-- |
| 55 | +.Example of attaching a `ManagedCertificate` object to the ingress |
| 56 | +[source,yaml,subs="attributes+"] |
| 57 | +---- |
| 58 | +apiVersion: networking.gke.io/v1 |
| 59 | +kind: ManagedCertificate |
| 60 | +metadata: |
| 61 | + name: <rhdh_certificate_name> |
| 62 | +spec: |
| 63 | + domains: |
| 64 | + - <rhdh_domain_name> |
| 65 | +---- |
| 66 | +-- |
| 67 | +For more information about setting up a Google-managed certificate, see https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs?hl=en#setting_up_a_google-managed_certificate[Setting up a Google-managed certificate]. |
| 68 | + |
| 69 | +. Create a `FrontendConfig` object to set a policy for redirecting to HTTPS. You must attach this policy to the ingress. |
| 70 | ++ |
| 71 | +-- |
| 72 | +.Example of attaching a `FrontendConfig` object to the ingress |
| 73 | +[source,yaml,subs="attributes+"] |
| 74 | +---- |
| 75 | +apiVersion: networking.gke.io/v1beta1 |
| 76 | +kind: FrontendConfig |
| 77 | +metadata: |
| 78 | + name: <ingress_security_config> |
| 79 | +spec: |
| 80 | + sslPolicy: gke-ingress-ssl-policy-https |
| 81 | + redirectToHttps: |
| 82 | + enabled: true |
| 83 | +---- |
| 84 | +-- |
| 85 | +For more information about setting a policy to redirect to HTTPS, see https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-configuration?hl=en#https_redirect[HTTP to HTTPS redirects]. |
| 86 | + |
| 87 | +. Create a file named `values.yaml` using the following template: |
| 88 | ++ |
| 89 | +.Example `values.yaml` file |
| 90 | +[source,yaml,subs="attributes+"] |
| 91 | +---- |
| 92 | +global: |
| 93 | + host: <rhdh_domain_name> |
| 94 | +route: |
| 95 | + enabled: false |
| 96 | +upstream: |
| 97 | + service: |
| 98 | + type: NodePort |
| 99 | + ingress: |
| 100 | + enabled: true |
| 101 | + annotations: |
| 102 | + kubernetes.io/ingress.class: gce |
| 103 | + kubernetes.io/ingress.global-static-ip-name: <ADDRESS_NAME> |
| 104 | + networking.gke.io/managed-certificates: <rhdh_certificate_name> |
| 105 | + networking.gke.io/v1beta1.FrontendConfig: <ingress_security_config> |
| 106 | + className: gce |
| 107 | + backstage: |
| 108 | + image: |
| 109 | + pullSecrets: |
| 110 | + - rhdh-pull-secret |
| 111 | + podSecurityContext: |
| 112 | + fsGroup: 2000 |
| 113 | + postgresql: |
| 114 | + image: |
| 115 | + pullSecrets: |
| 116 | + - rhdh-pull-secret |
| 117 | + primary: |
| 118 | + podSecurityContext: |
| 119 | + enabled: true |
| 120 | + fsGroup: 3000 |
| 121 | + volumePermissions: |
| 122 | + enabled: true |
| 123 | +---- |
| 124 | +. Run the following command in your terminal to deploy {product-short} using the latest version of Helm Chart and using the `values.yaml` file: |
| 125 | ++ |
| 126 | +[source,terminal,subs="attributes+"] |
| 127 | +---- |
| 128 | +helm -n <your_namespace> install -f values.yaml <your_deploy_name> \ |
| 129 | + openshift-helm-charts/redhat-developer-hub \ |
| 130 | + --version {product-chart-version} |
| 131 | +---- |
| 132 | ++ |
| 133 | +For the latest Helm Chart version, see this https://github.com/openshift-helm-charts/charts/tree/main/charts/redhat/redhat/redhat-developer-hub[Helm Charts] repository. |
| 134 | + |
| 135 | +.Verification |
| 136 | +* Confirm that the deployment is complete. |
| 137 | ++ |
| 138 | +[source,terminal,subs="attributes+"] |
| 139 | +---- |
| 140 | +kubectl get deploy <you_deploy_name>-developer-hub -n <your_namespace> |
| 141 | +---- |
| 142 | + |
| 143 | +* Verify that the service and ingress were created. |
| 144 | ++ |
| 145 | +[source,terminal,subs="attributes+"] |
| 146 | +---- |
| 147 | +kubectl get service -n <your_namespace> |
| 148 | +kubectl get ingress -n <your_namespace> |
| 149 | +---- |
| 150 | ++ |
| 151 | +[NOTE] |
| 152 | +Wait for the `ManagedCertificate` to be provisioned. This process can take a couple of hours. |
| 153 | + |
| 154 | +* Access {product-very-short} with `https://<rhdh_domain_name>` |
| 155 | + |
| 156 | +* To upgrade your deployment, use the following command: |
| 157 | ++ |
| 158 | +[source,terminal,subs="attributes+"] |
| 159 | +---- |
| 160 | +helm -n <your_namespace> upgrade -f values.yaml <your_deploy_name> openshift-helm-charts/redhat-developer-hub --version <UPGRADE_CHART_VERSION> |
| 161 | +---- |
| 162 | + |
| 163 | +* To delete your deployment, use the following command: |
| 164 | ++ |
| 165 | +[source,terminal,subs="attributes+"] |
| 166 | +---- |
| 167 | +helm -n <your_namespace> delete <your_deploy_name> |
| 168 | +---- |
0 commit comments