Do you want to run kubectl vsphere commands from a container? Do you want to be able to specify containers and also call the VM Service in the same YAML file? Well you have come to the right place. I built a simple container that takes 5 variables and sends it to kubectl vsphere in a container.
Pre-Reqs:
- vSphere 7.0.2 with Workload Management Deployed see guides here
- A namespace deployed and the VM Service Configured see guide here
- A working template configured and tested that it deploys see guide here
- A quite place where you will not be interrupted see my guide here
Clone my Git repository locally
Run the container with five inputs
docker run kubectlvsphere serveraddress username password namespace locationofyamlfile
docker run kubectlvsphere 192.168.110.200 jenkins@vsphere.local VMware1! tanzu https://raw.githubusercontent.com/vmtocloud/jenkins_tanzu_stuff/main/centos-vm.yaml
You can easily modify this container by editing the start.sh file to your needs then rebuilding the container
enjoy!