Skip to content

A validated pattern for using GitOps to deploy an AI/ML defect industrial detection solution, into an OpenShift cluster

Notifications You must be signed in to change notification settings

redhat-edge-computing/industrial-edge

 
 

Repository files navigation

Start Here

If you've followed a link to this repo, but are not really sure what it contains or how to use it, head over to http://hybrid-cloud-patterns.io/industrial-edge/ for additional context before continuing.

Prerequisites

  1. An OpenShift cluster ( Go to https://console.redhat.com/openshift/create )
  2. (Optional) A second OpenShift cluster
  3. A github account (and a token for it with repos permissions, to read from and write to your forks)
  4. A quay account with the following repos set as public:
  • http-ionic
  • httpd-ionic
  • iot-anomaly-detection
  • iot-consumer
  • iot-frontend
  • iot-software-sensor
  1. The helm binary, see https://helm.sh/docs/intro/install/

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 deploy

  1. Fork the manuela-dev repo on GitHub. It is necessary to fork this repo because the GitOps framework will push tags to this repo that match the versions of software that it will deploy.

  2. Fork this repo on GitHub. It is necessary to fork because your fork will be updated as part of the GitOps and DevOps processes.

  3. Clone the forked copy of this repo.

    git clone --recurse-submodules git@github.com:your-username/industrial-edge.git
    
  4. 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 values-secret.yaml.template ~/values-secret.yaml
vi ~/values-secret.yaml
  1. Customize the deployment for your cluster

    vi values-global.yaml
    git add values-global.yaml
    git commit values-global.yaml
    git push
    
  2. Preview the changes

    make show
    
  3. Login to your cluster using oc login or exporting the KUBECONFIG

    oc login
    

    or

    export KUBECONFIG=~/my-ocp-env/datacenter
    
  4. Apply the changes to your cluster

    make install
    
  5. Check the operators have been installed

    UI -> Installed Operators
    
  6. Obtain the ArgoCD urls and passwords

    The URLs and login credentials for ArgoCD change depending on the pattern name and the site names they control. Follow the instructions below to find them, however you choose to deploy the pattern.

    Display the fully qualified domain names, and matching login credentials, for all ArgoCD instances:

    ARGO_CMD=`oc get secrets -A -o jsonpath='{range .items[*]}{"oc get -n "}{.metadata.namespace}{" routes; oc -n "}{.metadata.namespace}{" extract secrets/"}{.metadata.name}{" --to=-\\n"}{end}' | grep gitops-cluster`
    eval $ARGO_CMD
    

    The result should look something like:

    NAME                       HOST/PORT                                                                                         PATH      SERVICES                   PORT    TERMINATION            WILDCARD
    datacenter-gitops-server   datacenter-gitops-server-industrial-edge-datacenter.apps.mycluster.mydomain.com          datacenter-gitops-server   https   passthrough/Redirect   None
    # admin.password
    2F6kgITU3DsparWyC
    
    NAME                    HOST/PORT                                                                                   PATH   SERVICES                PORT    TERMINATION            WILDCARD
    factory-gitops-server   factory-gitops-server-industrial-edge-factory.apps.mycluster.mydomain.com          factory-gitops-server   https   passthrough/Redirect   None
    # admin.password
    K4ctDIm3fH7ldhs8p
    
    NAME                      HOST/PORT                                                                              PATH   SERVICES                  PORT    TERMINATION            WILDCARD
    cluster                   cluster-openshift-gitops.apps.mycluster.mydomain.com                          cluster                   8080    reencrypt/Allow        None
    kam                       kam-openshift-gitops.apps.mycluster.mydomain.com                              kam                       8443    passthrough/None       None
    openshift-gitops-server   openshift-gitops-server-openshift-gitops.apps.mycluster.mydomain.com          openshift-gitops-server   https   passthrough/Redirect   None
    # admin.password
    WNklRCD8EFg2zK034
    
  7. Check all applications are synchronised

Pattern Layout and Structure

https://slides.com/beekhof/hybrid-cloud-patterns

Uninstalling

Probably wont work

  1. Turn off auto-sync

    helm upgrade manuela . --values ~/values-secret.yaml --set global.options.syncPolicy=Manual

  2. 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

  3. Wait until the deletions succeed

    manuela-datacenter should be the only remaining application

  4. Complete the uninstall

    helm delete manuela

  5. Check all namespaces and operators have been removed

Diagrams

The following diagrams show the different components deployed on the datacenter and the factory.

Logical

Logical

Schematic with Networks

Schema - Networks

Schematic with Dataflows

Schema - Dataflow

Editing the diagrams.

To edit the diagrams in Draw.io you can load them here and save a local copy

About

A validated pattern for using GitOps to deploy an AI/ML defect industrial detection solution, into an OpenShift cluster

Topics

Resources

Stars

Watchers

Forks

Languages

  • Dockerfile 43.3%
  • Shell 38.7%
  • Makefile 18.0%