Azure-devops-docs: No aks version specified so example fails on deployment.yml

Created on 3 Aug 2020  Â·  1Comment  Â·  Source: MicrosoftDocs/azure-devops-docs

When following the example documentation for azure environments deployments the Deploy to Kubernetes cluster step will fail on the error

no matches for kind "Deployment" in version "apps/v1beta1"

which is due to the default aks version as of time of writing using kubernetes 1.16 which takes Deployment out of version apps/v1beta1 and into apps/v1
kubernetes versions have been updated making the ./manifests/deployment.yml out of date. it currently

Workaround

update the ./manifests/deployment.yml to reference apps/v1 instead of apps/v1beta1 adn add a selector field that matches the template metatdata label. example:

#./manifests/deployment.yml
apiVersion : apps/v1
kind: Deployment
metadata:
  name: raboleypipelinesjavascriptdocker 
spec:
  replicas: 1
  selector:
    matchLabels:
      app: raboleypipelinesjavascriptdocker 
  template:
    metadata:
      labels:
        app: raboleypipelinesjavascriptdocker 
    spec:
      containers:
        - name: raboleypipelinesjavascriptdocker 
          image: rabenvcr.azurecr.io/raboleypipelinesjavascriptdocker
          ports:
          - containerPort: 8080

Fix

Pin the version the kubernetes cluster will use, and then update the Deployment version to whatever works in that version. and update the deployment.yml example manifest generated to use the correct syntax.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 devops-cicd-ecosystemtech devopprod doc-bug

Most helpful comment

I have raised a fix to the azure devops template so that the starter template creates an updated apps/v1 deployment. It will take around two weeks to rollout to all regions. I have also a raised a fix on the docs page itself. @msebolt can we close this issue?

>All comments

I have raised a fix to the azure devops template so that the starter template creates an updated apps/v1 deployment. It will take around two weeks to rollout to all regions. I have also a raised a fix on the docs page itself. @msebolt can we close this issue?

Was this page helpful?
0 / 5 - 0 ratings