title: azure devops release pipeline keeps failing at kubectl apply?
body: <p>In azure devops portal, my release pipeline keeps failing at kubectl apply.It says the server could not find the requested resource.</p>
  
  <p>NOTE: I haven't created a kubernetes clusture in azure portal yet.so when I went to the portal to create one, it is asking for paid subscription.</p>
  
  <p>logs of the release pipeline</p>
  
  <pre><code>2019-05-30T06:07:09.1230513Z ##[section]Starting: kubectl apply
  2019-05-30T06:07:09.1348192Z ==============================================================================
  2019-05-30T06:07:09.1348303Z Task         : Deploy to Kubernetes
  2019-05-30T06:07:09.1348381Z Description  : Deploy, configure, update your Kubernetes cluster in Azure Container Service by running kubectl commands.
  2019-05-30T06:07:09.1348441Z Version      : 0.151.2
  2019-05-30T06:07:09.1348510Z Author       : Microsoft Corporation
  2019-05-30T06:07:09.1348566Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=851275)
  2019-05-30T06:07:09.1348638Z ==============================================================================
  2019-05-30T06:07:12.7827969Z [command]d:\a\_temp\kubectlTask\1559196429507\kubectl.exe --kubeconfig d:\a\_temp\kubectlTask\1559196429507\config apply -f d:\a\r1\a\_devops-sample-CI\drop\Tomcat.yaml
  2019-05-30T06:07:15.1191531Z deployment "tomcat-deployment" configured
  2019-05-30T06:07:15.1300152Z error: error validating "d:\\a\\r1\\a\\_devops-sample-CI\\drop\\Tomcat.yaml": error validating data: the server could not find the requested resource; if you choose to ignore these errors, turn validation off with --validate=false
  2019-05-30T06:07:15.1454497Z ##[error]d:\a\_temp\kubectlTask\1559196429507\kubectl.exe failed with return code: 1
  2019-05-30T06:07:15.1634357Z ##[section]Finishing: kubectl apply
  </code></pre>
  
  <p>Tomcat.yaml</p>
  
  <pre><code>apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: tomcat-deployment
    labels:
      app: tomcat
  spec:
    replicas: 1
    selector:
      matchLabels:
        app: tomcat
    template:
      metadata:
        labels:
          app: tomcat
      spec:
        containers:
        - name: tomcat
          image: suji165475/devops-sample:113
          ports:
          - containerPort: 80
  
  ---
  
  kind: Service
  apiVersion: v1
  metadata:
    name: tomcat-service
  spec:
    type: LoadBalancer
    selector:
      app: tomcat
    ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  
  </code></pre>
  
  <p>why is the server saying that it couldn't find the requested resource even though I have made sure that I created the build artifact(containing tomcat.yaml in drop folder) properly from the build ci pipeline?? Could this be due to the fact that I havent created the kubernetes clusture yet or is this due to some other reason??</p>
  
  <p>also would using nodeport instead of LoadBalancer work on azure devops??</p>