Prerequisites
- An OpenShift cluster ( Go to https://console.redhat.com/openshift/create )
- (Optional) A second OpenShift cluster
- A github account
- A quay account
The use of this blueprint depends on having at least one running Red Hat OpenShift cluster. It is desirable to have a cluster for deploying the data center assets and a seperate cluster(s) for the factory assets.
If you do not have a running Red Hat OpenShift cluster you can start one on a public or private cloud by using Red Hat's cloud service.
How to use
-
Fork this repo on GitHub. It is necessary to fork because your fork will be updated as part of the GitOps and DevOps processes.
-
Clone the forked copy
git clone git@github.com:your-username/blueprints.git
-
Create a local copy of the Helm values file that can safely include credentials
DO NOT COMMIT THIS FILE You do not want to push personal credentials to GitHub.
cp blueprints/manufacturing-edge-ai-ml/main/values.yaml ~/values-secret.yaml
vi ~/values-secret.yaml
- Preview the changes
cd blueprints/manufacturing-edge-ai-ml/main helm template manuela . --values ~/values-secret.yaml --debug
Datacenter
TIP: It is recommended to have two shells open so that you can switch between datacenter and factory clusters to run commands.
-
Login to your cluster using oc login or exporting the KUBECONFIG
oc login
orexport KUBECONFIG=~/my-ocp-env/datacenter
-
Apply the changes to your cluster
helm install manuela . --values ~/values-secret.yaml
-
Check the operators have been installed
UI -> Installed Operators
-
Obtain the ArgoCD secret
oc -n openshift-gitops extract secrets/openshift-gitops-cluster --to=-
-
Obtain the Cluster ArgoCD location and log in
oc get -n openshift-gitops routes/openshift-gitops-server
-
Check all applications are synchronised
-
To deploy a edge cluster you will need to get the datacenter (or hub) cluster's token. You will need to install
clusteradm
. On the existing datacenter cluster:clusteradm get token
Factory
-
When you run the
clusteradm
command above it replies with the token and also shows you the command to use on the factory. So first you must login to the factory clusteroc login
orexport KUBECONFIG=~/my-ocp-env/factory
-
Then request to that the factory join the datacenter hub
clusteradm join --hub-token <token from clusteradm get token command > <factory cluster name>
-
Back on the hub cluster accept the join reguest
clusteradm accept --clusters <factory-cluster-name>
-
Use Helm to deploy the factory cluster assets.
Structure
Uninstalling
-
Turn off auto-sync
helm upgrade manuela . --values ~/values-secret.yaml --set gitops.syncPolicy=Manual
-
Remove the ArgoCD applications (except for manuela-datacenter)
a. Browse to ArgoCD a. Go to Applications a. Click delete a. Type the application name to confirm a. Chose "Foreground" as the propagation policy a. Repeat
-
Wait until the deletions succeed
manuela-datacenter
should be the only remaining application -
Complete the uninstall
helm delete manuela
-
Check all namespaces and operators have been removed