Environment Install and Setup: DEV and PROD Cluster
Parasol-insurance-dev cluster
Follow the following steps to complete the install and setup:
-
After the cluster is running and ready, log in as the admin
-
Copy the login token as shown in the image. Paste it in the terminal and run it. This should log you into the cluster through the terminal.
If you have certificate errors to login to the cluster, remember to use |
Setting up ai-accelerator project for Dev cluster
Instructions to fork ai-accelerator
-
Log into your git account and fork the following repository:
https://github.com/redhat-ai-services/ai-accelerator.git
-
Once forked, clone the repository to your local machine.
git clone https://github.com/{Git_ID}/ai-accelerator.git
-
Navigate to the cloned folder with the command:
cd ai-accelerator/
The ai-accelerator project uses Kustomize and GitOps/ArgoCD to deploy our project. It uses the bootstrap.sh
script to deploy GitOps on the cluster. After GitOps is installed onto the cluster, it will then apply an overlay.
The overlay determines which folder/versions to apply to the cluster. This allows you to reuse components and files across multiple instances with different setups.
In our case, we want to set up a parasol-insurance-dev overlay.
-
Open the the redhat-ai-services/ai-accelerator fork that was cloned earlier in your code editor.
-
Change the git
repoUrl
atcomponents/argocd/apps/base/tenants-applicationset.yaml
to your forked repository URL. -
Next lets create a new overlay named
parasol-insurance-dev
. Copycomponets/argocd/apps/overlays/rhoai-fast
and paste it ascomponents/argocd/apps/overlays/parasol-insurance-dev
. -
Change the
line 7
of thepatch-cluster-config-app-of-apps.yaml
file topath: parasol-insurance-dev
. -
Change the
line 3
of thepatch-tenants-applicationset.yaml
file tovalue: tenants/*/*/overlays/parasol-insurance-dev
. -
Next, create a new folder under the
bootstrap/overlays
folder namedparasol-insurance-dev
. -
In the
bootstrap/overlays/parasol-insurance-dev
folder, create a new file namedkustomization.yaml
add the below to the file.kustomization.yamlapiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ../../base - ../../../clusters/overlays/parasol-insurance-dev
As you can see, the Kustomization resource from above is referencing the clusters/overlays/parasol-insurance-dev
folder. Let’s create that folder -
Create a new folder named
parasol-insurance-dev
in theclusters/overlays
folder. -
In the
clusters/overlays/parasol-insurance-dev
folder, create a new file namedkustomization.yaml
add the below content to the file:kustomization.yamlapiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: openshift-gitops resources: - ../../base - ../../../components/argocd/apps/overlays/parasol-insurance-dev patches: # set the repo and branch for applications - path: patch-application-repo-revision.yaml target: group: argoproj.io kind: Application replacements: - source: kind: Application fieldPath: spec.source.repoURL targets: - select: kind: ApplicationSet fieldPaths: - spec.template.spec.source.repoURL - select: kind: ApplicationSet name: tenants fieldPaths: - spec.generators.*.git.repoURL - source: kind: Application fieldPath: spec.source.targetRevision targets: - select: kind: ApplicationSet fieldPaths: - spec.template.spec.source.targetRevision - select: kind: ApplicationSet name: tenants fieldPaths: - spec.generators.*.git.revision
-
In the
clusters/overlays/parasol-insurance-dev
folder, create a new file namedpatch-applicationset-manual-sync.yaml
add the below content to the file:patch-applicationset-manual-sync.yaml- op: remove path: /spec/template/spec/syncPolicy
-
In the
clusters/overlays/parasol-insurance-dev
, create a new file namedpatch-application-manual-sync.yaml
add the below content to the file:patch-application-manual-sync.yaml- op: remove path: /spec/syncPolicy
-
In the
clusters/overlays/parasol-insurance-dev
folder, create a new file namedpatch-application-repo-revision.yaml
add the below content to the file. Replace the repoURL with your fork URL.patch-application-repo-revision.yaml- op: replace path: /spec/source/repoURL value: 'https://github.com/{GIT_ID}/ai-accelerator.git' - op: replace path: /spec/source/targetRevision value: main
Replace
{GIT_ID}
with your GitHub ID. -
In the
tenants
folder, create a new folder namedparasol-insurance
. Here is where we’ll be adding our new resources. -
In the
tenants/parasol-insurance
folder, create a folder namednamespaces
-
In the
tenants/parasol-insurance/namespaces
folder, create thebase
andoverlays
folders.Remember to add the base
andoverlays
files and folders. Make sure you have theparasol-insurance-dev
overlay in theoverlays
folder for Argo to pick up what it needs for the parasol-insurance-dev environment. -
In the
tentans/parasol-insurance/namespaces/base
folder, create a new file namedkustomization.yaml
add the below content to the file:kustomization.yamlapiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - parasol-insurance.yaml
-
In the
tenants/parasol-insurance/namespaces/base
folder, create a new file namedparasol-insurance.yaml
add the below content to the file:parasol-insurance.yamlapiVersion: v1 kind: Namespace metadata: name: parasol-insurance labels: opendatahub.io/dashboard: "true" kubernetes.io/metadata.name: parasol-insurance modelmesh-enabled: "true"
-
In the
tenants/parasol-insurance/namespaces/overlays
folder, create a new folder namedparasol-insurance-dev
. -
In the
tenants/parasol-insurance/namespaces/overlays/parasol-insurance-dev
folder, create a new file namedkustomization.yaml
add the below content to the file:kustomization.yamlapiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ../../base
The
opendatahub.io/dashboard: "true"
label is used to identify the namespace as a RHOAI data science project.Our first component for the parasol-insurance tenant is the namespace.
This namespace is defined to be created in the
parasol-insurance-dev
environment as per theparasol-insurance-dev
overlay. -
Push the changes to your forked repository.
push_changesgit add . git commit -m "Add parasol-insurance-dev overlay" git push origin main
-
Make sure you are logged into the Dev cluster and run the bootstrap script by running the bootstrap.sh script.
./bootstrap.sh ... 1. bootstrap/overlays/parasol-insurance-dev/ 2. bootstrap/overlays/rhoai-eus-2.8-aws-gpu/ 3. bootstrap/overlays/rhoai-eus-2.8/ 4. bootstrap/overlays/rhoai-fast-aws-gpu/ 5. bootstrap/overlays/rhoai-fast/
For parasol-insurance-dev environments type the number 1 and press Enter.
-
After the script is done, you can check the ArgoCD console to see the applications deployed. It will install RHOAI and relevent operators.
Notice that the
parasol-insurance-namespaces
application was also deployed. -
Navigate to RHOAI, and validate that there is a data science project created with the name parasol-insurance.
To check your work please refer to This Dev Branch |
Parasol-insurance-prod cluster
The steps to set up the parasol-insurance-prod cluster are the same as parasol-insurance-dev, except change dev to prod in the kustomization files and folders.
Make the changes for prod in your forked repository and use it to set up the prod cluster.
When running the bootstrap script, select bootstrap/overlays/parasol-insurance-prod
To check your work please refer to This Prod Branch |