Enable Kubernetes extension for VSTS. Kubernetes endpoint for kubectl config and kubectl apply build task. Mainly aim for using Linux Hosted Agent(preview).
I tested via windows environment.
npm test // Compile Typescript and Test these
npm run deploy // Deploy kubectl and node_modules into task directory
npm run build // Build *.vsix file
If you want to debug these. NOTE: I'm using GitBash for this developmnet. You can see the debug output.
export TASK_TEST_TRACE=1
Go to the Market place Market Place Manage Then upload and share with your VSTS account. Tsuyoshi Ushio's publisher site
Now I just start this project. Just initial commit. However, you can see the image of the endpoint and build task.
- Flexbile Command Excecution except for
kubectl apply
- Enable to select the version of kubectl and automatically installed.
Choose Kubernetes endpoint.
Kubernetes Connection pops up. Then fill the box.
- Connection name: Endpoint name (Anything is OK)
- Server URL : K8s Cluster URL for memo (Not used for the task until now)
- kubeconfig : Copy & paste your config file
You can get config file from your k8s master node .kube/config
.
See Microsoft Azure Container Service Engine - Kubernetes Walkthrough
Then copy the file content and paste on kubeconfig column.
Link your repo which has kubecntl command.
Please chmod +x kubectl
before adding kubectl to your repo.
Then you can use the endpoint, specify the kubectl command and YAML file
for deployment. Internally, it calls kubectl apply
command.
If you want to change the YAML file dynamically, you can use Replace tokens on the VSTS Marketplace.