- 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.
-
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 [email protected]: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
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
Rather than provide instructions on creating a factory cluster it is assumed
that an OpenShift cluster has already been created. Use the openshift-install
program provided at cloud.redhat.com
There are a couple of ways to join the factory to the datacenter.
- Using the ACM user interface
- Using the
clusteradm
tool
- From the datacenter openshift console select ACM from the top right
- Select the "Import cluster" option beside the highleded Create Cluster button.
- On the "Import an existing cluster" page, enter the cluster name and choose Kubeconfig as the "import mode". After pressiming import you will be asked to copy a command that will be used on the factory cluster.
-
On the factory we recommend you edit a shell command file, e.g.
join-cluster.sh
and paste the copied command into the file and save. Then run the command by running that shell script.sh join-cluster.sh
This will cause the factoy to be joined with the datacenter (hub). It will also result in OpenShift GitOps to be installed on the factory cluster. This in turn will push the application components to the cluster.
You can also use clusteradm
to join a cluster. The folloing instructions explain what needs to be done. clusteradm
is still in testing.
-
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
-
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>
-
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
The following diagrams show the different components deployed on the datacenter and the factory.
To edit the diagrams in Draw.io you can load them here and save a local copy