|
| 1 | +--- |
| 2 | +title: Getting Started |
| 3 | +weight: 10 |
| 4 | +aliases: /portworx-dr/getting-started/ |
| 5 | +--- |
| 6 | + |
| 7 | +:toc: |
| 8 | +:imagesdir: /images |
| 9 | +:_content-type: ASSEMBLY |
| 10 | +include::modules/comm-attributes.adoc[] |
| 11 | + |
| 12 | +[id="deploying-portworx-dr-pattern"] |
| 13 | +== Deploying the RamenDR Starter Kit Pattern |
| 14 | + |
| 15 | +.Prerequisites |
| 16 | + |
| 17 | +* An OpenShift cluster |
| 18 | + ** To create an OpenShift cluster, go to the https://console.redhat.com/[Red Hat Hybrid Cloud console]. |
| 19 | + ** Select *OpenShift \-> Red Hat OpenShift Container Platform \-> Create cluster*. |
| 20 | +* A GitHub account with a personal access token that has repository read and write permissions. |
| 21 | +* The Helm binary, for instructions, see link:https://helm.sh/docs/intro/install/[Installing Helm] |
| 22 | +* Additional installation tool dependencies. For details, see link:https://validatedpatterns.io/learn/quickstart/[Patterns quick start]. |
| 23 | + |
| 24 | +It is desirable to have a cluster for deploying the GitOps management hub assets and a separate cluster(s) for the managed cluster(s). |
| 25 | + |
| 26 | +[id="preparing-for-deployment"] |
| 27 | +== Preparing for deployment |
| 28 | +.Procedure |
| 29 | + |
| 30 | +. Fork the link:https://github.com/validatedpatterns/portworx-dr[portworx-dr] repository on GitHub. You must fork the repository because your fork is updated as part of the GitOps and DevOps processes. |
| 31 | + |
| 32 | +. Clone the forked copy of this repository. |
| 33 | ++ |
| 34 | +[source,terminal] |
| 35 | +---- |
| 36 | +$ git clone git@github.com:your-username/portworx-dr.git |
| 37 | +---- |
| 38 | + |
| 39 | +. Go to your repository: Ensure you are in the root directory of your Git repository by using: |
| 40 | ++ |
| 41 | +[source,terminal] |
| 42 | +---- |
| 43 | +$ cd /path/to/your/repository |
| 44 | +---- |
| 45 | + |
| 46 | +. Run the following command to set the upstream repository: |
| 47 | ++ |
| 48 | +[source,terminal] |
| 49 | +---- |
| 50 | +$ git remote add -f upstream git@github.com:validatedpatterns/portworx-dr.git |
| 51 | +---- |
| 52 | + |
| 53 | +. Verify the setup of your remote repositories by running the following command: |
| 54 | ++ |
| 55 | +[source,terminal] |
| 56 | +---- |
| 57 | +$ git remote -v |
| 58 | +---- |
| 59 | ++ |
| 60 | +.Example output |
| 61 | ++ |
| 62 | +[source,terminal] |
| 63 | +---- |
| 64 | +origin git@github.com:kquinn1204/portworx-dr.git (fetch) |
| 65 | +origin git@github.com:kquinn1204/portworx-dr.git (push) |
| 66 | +upstream git@github.com:validatedpatterns/portworx-dr.git (fetch) |
| 67 | +upstream git@github.com:validatedpatterns/portworx-dr.git (push) |
| 68 | +---- |
| 69 | + |
| 70 | +. Make a local copy of secrets template outside of your repository to hold credentials for the pattern. |
| 71 | ++ |
| 72 | +[WARNING] |
| 73 | +==== |
| 74 | +Do not add, commit, or push this file to your repository. Doing so may expose personal credentials to GitHub. |
| 75 | +==== |
| 76 | ++ |
| 77 | +Run the following commands: |
| 78 | ++ |
| 79 | +[source,terminal] |
| 80 | +---- |
| 81 | +$ cp values-secret.yaml.template ~/values-secret.yaml |
| 82 | +---- |
| 83 | + |
| 84 | +. Populate this file with secrets, or credentials, that are needed to deploy the pattern successfully: |
| 85 | ++ |
| 86 | +[source,terminal] |
| 87 | +---- |
| 88 | +$ vi ~/values-secret.yaml |
| 89 | +---- |
| 90 | + |
| 91 | +.. Edit the `vm-ssh` section to include the username, private key, and public key. To ensure the seamless flow of the pattern, the value associated with the `privatekey` and `publickey` has been updated with `path`. For example: |
| 92 | ++ |
| 93 | +[source,yaml] |
| 94 | +---- |
| 95 | + - name: vm-ssh |
| 96 | + vaultPrefixes: |
| 97 | + - global |
| 98 | + fields: |
| 99 | + - name: username |
| 100 | + value: 'cloud-user' |
| 101 | + - name: privatekey |
| 102 | + path: '/path/to/private-ssh-key' |
| 103 | + - name: publickey |
| 104 | + path: '/path/to/public-ssh-key' |
| 105 | +---- |
| 106 | ++ |
| 107 | +Paste the path to your locally stored private and public keys. If you do not have a key pair, generate one using `ssh-keygen`. |
| 108 | + |
| 109 | +.. Edit the `cloud-init` section to include the `userData` block to use with cloud-init. For example: |
| 110 | ++ |
| 111 | +[source,yaml] |
| 112 | +---- |
| 113 | + - name: cloud-init |
| 114 | + vaultPrefixes: |
| 115 | + - global |
| 116 | + fields: |
| 117 | + - name: userData |
| 118 | + value: |- |
| 119 | + #cloud-config |
| 120 | + user: 'cloud-user' |
| 121 | + password: 'cloud-user' |
| 122 | + chpasswd: { expire: False } |
| 123 | +---- |
| 124 | + |
| 125 | +.. Edit the `aws` section to refer to the file containing your AWS credentials: |
| 126 | ++ |
| 127 | +[source,yaml] |
| 128 | +---- |
| 129 | + - name: aws |
| 130 | + fields: |
| 131 | + - name: aws_access_key_id |
| 132 | + ini_file: ~/.aws/credentials |
| 133 | + ini_key: aws_access_key_id |
| 134 | + - name: aws_secret_access_key |
| 135 | + ini_file: ~/.aws/credentials |
| 136 | + ini_key: aws_secret_access_key |
| 137 | + - name: baseDomain |
| 138 | + value: aws.example.com |
| 139 | + - name: pullSecret |
| 140 | + path: ~/pull_secret.json |
| 141 | + - name: ssh-privatekey |
| 142 | + path: ~/.ssh/privatekey |
| 143 | + - name: ssh-publickey |
| 144 | + path: ~/.ssh/publickey |
| 145 | +---- |
| 146 | + |
| 147 | +.. Edit the `openshiftPullSecret` section to refer to the file containing your OpenShift pull secret: |
| 148 | ++ |
| 149 | +[source,yaml] |
| 150 | +---- |
| 151 | + - name: openshiftPullSecret |
| 152 | + fields: |
| 153 | + - name: .dockerconfigjson |
| 154 | + path: ~/pull_secret.json |
| 155 | +---- |
| 156 | + |
| 157 | +. Create and switch to a new branch named `my-branch`, by running the following command: |
| 158 | ++ |
| 159 | +[source,terminal] |
| 160 | +---- |
| 161 | +$ git checkout -b my-branch |
| 162 | +---- |
| 163 | + |
| 164 | +. The pattern will infer the baseDomain of your cluster based on the clusterDomain which is tracked by the pattern |
| 165 | +operator. Previously, this required the pattern to be forked to be useful - but this is no longer the case (you may |
| 166 | +still wish to change other settings in the RDR chart's values file, such as `aws.region` settings. This file is at |
| 167 | +link:https://github.com/validatedpatterns/portworx-dr/blob/main/charts/hub/rdr/values.yaml[hub/rdr/values.yaml]. If you do make customizations to this or other files, it is necessary to fork the pattern so that the changes |
| 168 | +will be seen by ArgoCD. If you made any changes to this or any other files tracked by git, git add them and then commit the changes by running the following command: |
| 169 | ++ |
| 170 | +[source,terminal] |
| 171 | +---- |
| 172 | +$ git commit -m "any updates" |
| 173 | +---- |
| 174 | + |
| 175 | +. Push the changes to your forked repository: |
| 176 | ++ |
| 177 | +[source,terminal] |
| 178 | +---- |
| 179 | +$ git push origin my-branch |
| 180 | +---- |
| 181 | + |
| 182 | +The preferred way to install this pattern is by using the script `./pattern.sh` script. |
| 183 | + |
| 184 | +[id="deploying-cluster-using-patternsh-file"] |
| 185 | +== Deploying the pattern by using the pattern.sh file |
| 186 | + |
| 187 | +To deploy the pattern by using the `pattern.sh` file, complete the following steps: |
| 188 | + |
| 189 | +. Log in to your cluster by following this procedure: |
| 190 | + |
| 191 | +.. Obtain an API token by visiting link:https://oauth-openshift.apps.<your-cluster>.<domain>/oauth/token/request[https://oauth-openshift.apps.<your-cluster>.<domain>/oauth/token/request]. |
| 192 | + |
| 193 | +.. Log in to the cluster by running the following command: |
| 194 | ++ |
| 195 | +[source,terminal] |
| 196 | +---- |
| 197 | +$ oc login --token=<retrieved-token> --server=https://api.<your-cluster>.<domain>:6443 |
| 198 | +---- |
| 199 | ++ |
| 200 | +Or log in by running the following command: |
| 201 | ++ |
| 202 | +[source,terminal] |
| 203 | +---- |
| 204 | +$ export KUBECONFIG=~/<path_to_kubeconfig> |
| 205 | +---- |
| 206 | + |
| 207 | +. Deploy the pattern to your cluster. Run the following command: |
| 208 | ++ |
| 209 | +[source,terminal] |
| 210 | +---- |
| 211 | +$ ./pattern.sh make install |
| 212 | +---- |
0 commit comments