Prepares a PVC from Fedora Cloud URL source and installs additional dependencies with virt-customize. Then it creates a VM from this PVC and deploys a flaskr server application in this VM.
- KubeVirt
v0.36.0
- Tekton Pipelines
v0.11.0
modify-data-object --- disk-virt-customize --- create-vm-from-manifest --- execute-in-vm
|
generate-ssh-keys--
modify-data-object
task imports a PVC from Fedora Cloud URL source. The name of the PVC is generated.disk-virt-customize
task runs virt-customize commands on the PVC that install git, vim, pip and flask python framework.generate-ssh-keys
task generates two secrets with private and public keys. The name of the secrets are generated. The task itself runs in parallel with1.
and2.
tasks.create-vm-from-manifest
task creates a VM calledflasker-vm-*
from the prepared PVC with a public key attached.execute-in-vm
task starts a VM and makes SSH connection to it.- clones flask repository
- initializes flaskr application
- deploys the server on port 5000
kubectl apply -f server-deployer-pipeline.yaml
kubectl create -f server-deployer-pipelinerun.yaml
To expose and interact with the deployed application run the following snippet
and visit http://localhost:8001/api/v1/namespaces/${VM_NAMESPACE}/services/flaskr/proxy/
.
VM name and namespace can be found in the PipelineRun's results once it has finished.
virtctl expose vm ${VM_NAME} --name=flaskr --port 5000
kubectl proxy -p 8001