You can use images that are stored in Harbor Registry to deploy vSphere Pods in namespaces on the Supervisor Cluster.

Prerequisites

  • Push images to a project in Harbor Registry that has the same name as the namespace where you want to deploy your application. See Push Images to the Embedded Harbor Registry.
  • Add the contents of the vspere-plugin.zip to the execution file path of your environment.

Procedure

  1. Create a YAML file that contains the following parameters:
    ...
    namespace: <namespace-name>
    ...
    spec:
    ...
    image: <image registry URL>/<namespace name>/<image name>
  2. Login to the Supervisor Cluster:
    kubectl vsphere login --server=https://<server_adress> --vsphere-username <your user account name>
  3. Switch to the namespace where you want to deploy the application.
    kubectl config use-context <namespace>
  4. Deploy a vSphere Pod from that YAML file:
    kubectl apply -f <yaml file name>.yaml
  5. Run the following command to verify that the image is pulled from the Harbor Registry and the vSphere Pod is in running state:
    kubectl describe pod/<yaml name>

Results

The YAML file that you created is deployed to the specified namespace by using the image from the project on Harbor Registry that is named after the namespace.

Example:

Create and deploy the following YAML file on the namespace demoapp1 by using the busybox image from the demoapp1 project in Harbor Registry:

apiVersion: v1
kind: Pod
metadata:
  name: busybox
  namespace: demoapp1
spec:
  containers:
  - name: busybox
    image: <harbor_IP>/demoapp1/busybox:latest
    command:
      - sleep
      - "3600"
    imagePullPolicy: IfNotPresent
  restartPolicy: Always