I was trying to set up a VSTS CI/CD pipeline for a .net core web api running in a docker container deployed onto a Kubernetes cluster hosted in Azure AKS. I set up my release tasks like this:
2018-01-27T00:31:50.0571239Z ##[error]error: Error loading config file “/home/abel/myagent/_work/_temp/kubectlTask/1517013107991/config”: yaml: line 3: found unexpected ‘:’
2018-01-27T00:31:50.1226297Z ##[error]/home/abel/myagent/_work/_temp/kubectlTask/1517013107991/kubectl failed with return code: 1
What the what???? What does that even mean? What config are they talking about? The only yaml that I could think of was my deploy_dev.yaml file
But that totally didn’t make any sense. Plus, when I looked at it, the yaml file was perfectly formatted. After banging my head against my desk for what seemed like forever and trying to figure out what was going on, turns out I borked my end point when I created it.
I recreated the kubernetes endpoint
Entered in Server URL, looked up my config by going to C:\Users\abel\.kube, looked at my config file
To make sure I downloaded the correct config file, I connected up to my AKS cluster. To do that and to get a quick tutorial on AKS in azure, follow the directions here.
Clicked OK, ran my release and Voila! Everything worked!
Trying to use VSTS Deploy to Kubernetes task and get a mysterious error that says
error: Error loading config file “/home/abel/myagent/_work/_temp/kubectlTask/1517013107991/config”: yaml: line 3: found unexpected ‘:’
Check your Kubernetes endpoint! the config file is referring to the kubernetes config!