You can use images that are stored in Registry Service to deploy vSphere Pods in namespaces on the Supervisor Cluster.
- Push images to a project in Registry Service that has the same name as the namespace where you want to deploy your application. See Push Images to a Namespace on the Registry Service.
- Add the contents of the vspere-plugin.zip to the execution file path of your environment.
- Create a YAML file that contains the following parameters:
... namespace: <namespace-name> ... spec: ... image: <image registry URL>/<namespace name>/<image name>
- Login to the Supervisor Cluster:
kubectl vsphere login --server=https://<server_adress> --vsphere-username <your user account name>
- Switch to the namespace where you want to deploy the application.
kubectl config use-context <namespace>
- Deploy a vSphere Pod from that YAML file:
kubectl apply -f <yaml file name>.yaml
- Run the following command to verify that the image is pulled from the Registry Service and the vSphere Pod is in running state:
kubectl describe pod/<yaml name>
The YAML file that you created is deployed to the specified namespace by using the image from the project on Registry Service that is named after the namespace.
Create and deploy the following YAML file on the namespace demoapp1 by using the busybox image from the demoapp1 project in Registry Service:
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