Wednesday, 9 October 2019

azure devops pipeline for kubernetes



You need to setup service connection first:










- task: Kubernetes@1
displayName: Deploy in Dev
inputs:
connectionType: 'Kubernetes Service Connection'
kubernetesServiceEndpoint: 'AKS-DEV'
namespace: 'yournamespace'
command: 'set'
arguments: 'image deployment/yoursexapp yoursexapp-container=yoursexapp.azurecr.io/yoursexapp:$(Build.BuildId)'
secretType: 'dockerRegistry'
containerRegistryType: 'Azure Container Registry'



because this will link and use your docker hub, you can do it by follow below link:

https://baiduhix.blogspot.com/2019/10/azure-docker-hub-and-link-it-to-azure.html


above $(Build.BuildId) is a build in var which will help you auto tag your docker image and auto pick it in k8s

5 comments: