Deployment

Customizing the application

Run on Setup Workstation

StorageClassName

Anthos cluster on Bare Metal does not configure default Storage Class. You must update this value accordingly. The YAML files are stored in the /setup/kubernetes/viai-camera-integration folder.

  ---
  apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
      name: viai-camera-config
  spec:
      storageClassName: local-shared
      accessModes:
          - ReadWriteOnce
      resources:
          requests:
              storage: 100Mi
  ...
  ---
  apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
      name: viai-camera-data
  spec:
      storageClassName: local-shared
      accessModes:
          - ReadWriteOnce
      resources:
          requests:
              storage: 10Gi


ImagePullSecret (optional, customization step)

The setup procedure creates a new ImagePullSecret on the Anthos cluster with name of regcred. If you prefer other secrets, please update this value.

secret.yaml is located at setup/kubernetes/viai-camera-integration

  apiVersion: v1
  kind: Secret
  metadata:
      name: regcred
  data:
      .dockerconfigjson: ${IMAGE_PULL_SECRET}
  type: kubernetes.io/dockerconfigjson

Update viai-camera-integration.tmpl located in the same directory

  imagePullSecrets:
      - name: regcred
  hostNetwork: true


Kubernetes namespace

If your application must run in a specific namespace, update ${VIAI_PROVISIONING_FOLDER}/kubernetes/viai-camera-integration/namespace.yaml file to reflect the namespace:

  ---
  apiVersion: v1
  kind: Pod
  metadata:
      namespace: <<your-namespace>>
      name: viai-camera-integration

StorageClassName

The YAML files are stored in /kubernetes/viai-camera-integration directory. Anthos does not configure default Storage class, you must update storage class name to your default storage class. If you do not have a preferred StorageClassName, the Visual Inspection AI Edge solution uses local-shared as the default StorageClassName.

  • Option 1: If you use Google Container Registry to store container images: Edit the following file: "${VIAI_PROVISIONING_FOLDER}"/kubernetes/viai-camera-integration/viai-camera-integration-gcp.tmpl

  • Option 2: alternatively if you have a private container registry that will be used to store container images: Edit the following file: "${VIAI_PROVISIONING_FOLDER}"/kubernetes/viai-camera-integration/viai-camera-integration-private-repo.tmpl

Storage Size

Depending on your use case and storage resource availability, you may want to update the storage size allocated for Visual Inspection AI Edge solution on the edge server. Today the solution requires two storage resources.

  • viai-camera-config: Where your camera and application related configurations are stored and persisted.
  • viai-camera-data: Where your photos are stored locally on the edge server.

A sample yaml file with the highlighted example:

  ---
  apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: viai-camera-config
  spec:
    storageClassName: local-shared
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 100Mi
  ...
  ---
  apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: viai-camera-data
  spec:
    storageClassName: local-shared
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 10Gi

GPU Resource

By default, the model container template assumes you use a GPU model generated by Visual Inspection AI. The GPU model requires GPU resources to run. If you are using a CPU model which does not require GPU resources, update kubernetes/viai-model/viai-model.yaml.tmpl to remove the nvidia.com/gpu resource requests and limits.

  containers:
      - image: viai-inference-module
      resources:
          requests:
              nvidia.com/gpu: 1
          limits:
              nvidia.com/gpu: 1
      imagePullPolicy: Always
      name: viai-${SERVICE_NAME}-module
      ports:
          - containerPort: 8602
          - containerPort: 8603