Why do Microsofts AKS samples separate manifests for deployment and service?

11/11/2020

As discussed in this question, it's best practice to register the services before the actual deployment: https://stackoverflow.com/questions/50409392/why-should-i-specify-service-before-deployment-in-a-single-kubernetes-configurat

However in these official Microsoft examples there is a deployment task, that has the order the other way around.

    - task: KubernetesManifest@0
      displayName: Deploy
      inputs:
        action: deploy
        manifests: manifests/deployment.yml|manifests/service.yml

Does it not matter for AKS if service or deployment are executed first?

The official guidelines for docker it's stated that this is relevant..

Does Microsoft AKS handle it differently/better than plain k8s? Are the services automatically registered first, since they can be recognized as such? Else why split it in 2 files if one could not guarantee the order of execution?

-- SwissCoder
azure-aks
azure-devops
kubernetes

1 Answer

11/12/2020

I'm afraid there is a misunderstanding of the input in manifests parameter. manifests/deployment.yml|manifests/service.yml means manifests/deployment.yml or manifests/service.yml. The sample is trying to say you can input manifests/deployment.yml or manifests/service.yml, there is no order here. In addition, if you run the pipeline, you'll find format manifests/deployment.yml|manifests/service.yml is not supported.

-- Cece Dong - MSFT
Source: StackOverflow