Deployment

Deploy the solution to an existing Kuberentes cluster


Follow this section to deploy the VIAI Edge solution only if all the criteria below are met. At this time, deploying the solution to an existing kubernetes cluster attached to Anthos uses a different script set. Combining both is a work in progress.

Requirements

  • You already have a Kubernetes cluster running.
  • The kubernetes is already attached to Anthos.
  • The required NVIDIA drivers are already installed on the kubernetes cluster.


Deploying the Visual Inspection AI Edge application

Since the existing cluster has been attached to Anthos, we will connect to the existing cluster and apply Kubernetes YAML files to the cluster remotely.

You can do this in Cloud Shell or a Workstation with Google Cloud SDK installed. If you are on a workstation, you need to follow step 1 below to install gke-gcloud-auth-plugin. If you are on Cloud Shell, you can skip step 1.

  1. Install gke-cloud-auth-plugin

     echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
    
     curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
    
     sudo apt-get update && sudo apt-get install google-cloud-cli
    
     sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin
    
  2. If you are using a different machine than you used to generate the VIAI application assets, copy the contents of the output folder to the local machine.

  3. Run the commands below:

     gcloud auth login
     gcloud container hub memberships get-credentials ${MEMBERSHIP} --project ${DEFAULT_PROJECT}
    
     cd $OUTPUT_FOLDER/kubernetes/
     kubectl apply -f ./namespace.yaml
     kubectl apply -f ./secret_pubsub.yaml
     kubectl apply -f ./secret_image_pull.yaml
     kubectl apply -f ./viai-camera-integration.yaml
     kubectl apply -f ./mosquitto.yaml
    

    Where:

    • MEMBERSHIP The membership name of the existing edge server.
    • DEFAULT_PROJECT the ID of the Google Cloud project to provision the resources to deploy the solution.
    • OUTPUT_FOLDER The folder that contains application assets generated at the previous step.

At this point the cluster is ready, you can continue in the Connecting the cameras section.