Upgrade to Pro — share decks privately, control downloads, hide ads and more …

VSTS/TFS Release Automation with Docker and Azure by Marc Müller

VSTS/TFS Release Automation with Docker and Azure by Marc Müller

Docker provides a lot of benefits for modern development processes and hosting scenario. This talk will cover the full DevOps roundtrip for services hosted with docker. From local development with Docker containers to build automation over to release automation into a modern Docker cluster, all based on ASP.NET Core, Visual Studio, Team Foundation Server / VSTS and Azure.

Speaker: Marc Müller

Marc serves as Principal Consultant for Microsoft ALM and for .NET, Windows and Azure solutions at 4tecture GmbH (http://www.4tecture.ch/) and has been recognised by Microsoft as a Most Valuable Professional (MVP) for Visual Studio ALM. His in-depth knowledge of ALM and know-how regarding enterprise architectures and component-based distributed systems have proven valuable assets on countless projects over recent years. As a coach, consultant and instructor, his specialisms include the training and coaching of ALM and .NET project teams.

Azure Zurich User Group
PRO

August 29, 2017
Tweet

More Decks by Azure Zurich User Group

Other Decks in Technology

Transcript

  1. None
  2. Marc Müller Principal Consultant @muellermarc

  3. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

  4. None
  5. None
  6. App1 App2

  7. Build/CI, Integrate, Test 3. 1. Monitor and Diagnose Outer-Loop Push

    Code Production environments Run, Manage 5. 6. Container Service Service Fabric Batch App Services Coming soon … … Code Run Validate Debug Inner-Loop CD, Deploy 4. Visual Studio Team Services Source Code Control (SCC) 2. Azure Container Registry Image Source: https://sec.ch9.ms/sessions/69613110-c334-4f25-bb36-08e5a93456b5/206BuildDebugDeployASPNETCorewithDocker.pptx
  8. VSTS Build VSTS Release Management Docker Registry Build App Test

    Build Container Repo Container Info Publish to Target Host Container Info Push Host Pull Config Artifact
  9. None
  10. https://docs.microsoft.com/en-us/azure/container-service/kubernetes/container-service-intro-kubernetes

  11. ▪ ▪ ▪ ▪ ▪ ▪ ▪

  12. ▪ ▪ ▪ ▪

  13. ▪ ▪ Pod Container Pod Container Container 10.0.10.14 10.0.10.16 localhost

    Multi container Pods should only be used for highly coupled containers! Pod Container 10.0.10.15
  14. ▪ ▪ Replication Controller / Deployment (Replication Set) Pod Container

    Pod Container Pod Container
  15. ▪ ▪ ▪

  16. ▪ ▪ ▪ ▪ ▪ ▪ Service Pod Container Pod

    Container Pod Container A 1.2 A 1.2 A 1.2 A 1.2
  17. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

  18. None
  19. ▪ ▪ ▪ Image Source: https://docs.microsoft.com/en-us/azure/container-service/container-service-intro

  20. VSTS Azure Resource Group DCOS Master DCOS Master Master Agent

    VSTS Agent App1 App1 App1 App1 App1 App2 Git Build Release Internet Azure Load Balancer Ingress LeGo
  21. None
  22. ▪ ▪ ▪ ▪

  23. None
  24. None
  25. None
  26. ▪ ▪ ▪

  27. None
  28. ▪ ▪ ▪

  29. None
  30. ▪ ▪ ▪

  31. None
  32. ▪ ▪ ▪

  33. None
  34. ▪ ▪ ▪

  35. None
  36. None
  37. ▪ ▪

  38. None
  39. None
  40. None
  41. None
  42. ▪ ▪ ▪

  43. None
  44. None
  45. ▪ ▪ ▪

  46. None
  47. None
  48. None
  49. None
  50. Image Source: https://docs.docker.com/registry/spec/api/

  51. None
  52. ▪ ▪ ▪ ▪ ▪ ▪

  53. None
  54. None
  55. ▪ ▪ ▪ ▪ ▪ ▪

  56. None
  57. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

  58. VSTS Build Agent Build Pool Build Pool Build Pool Build

    Definition Build Definition Build Queue Docker Engine Build Agent
  59. None
  60. None
  61. ▪ ▪ ▪

  62. None
  63. None
  64. None
  65. None
  66. None
  67. Setup VSTS Services ▪ Docker Registry Connection ▪ Kubernetes Connection

  68. None
  69. None
  70. None
  71. ▪ ▪ ▪

  72. None
  73. None
  74. None
  75. None
  76. None
  77. None
  78. None
  79. None
  80. None
  81. None
  82. None
  83. None
  84. None
  85. None
  86. None
  87. None
  88. None
  89. None
  90. None
  91. None
  92. None
  93. None
  94. None
  95. None
  96. None
  97. None
  98. None
  99. ▪ ▪ ▪ ▪ ▪

  100. None
  101. None
  102. None
  103. None
  104. None
  105. kube-lego requests certificates for Kubernetes Ingress resources Automatic checking for

    certificates Available for !!! Non-production use cases !!!
  106. None
  107. None
  108. None
  109. None
  110. None
  111. None
  112. None
  113. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

    ▪ ▪
  114. None
  115. None
  116. We are looking for great talents to join our team!

    Apply to [email protected] www.4tecture.ch/jobs
  117. None
  118. None
  119. Param( [string]$vstspat = "xxxxxxx", [string]$subscriptionname = "xxxxxxx", [string]$rsakeyfile = "xxxxxxx",

    [string]$vstsaccount = "xxxxxxx" ) ### setup the cli settings kubectl config unset contexts.demo-4t-k8s az account set --subscription $subscriptionname az account show #az login #if needed ### setup kubernetes cluster az group create -n "KubernetesDemo" -l "westeurope" az acs create -n KubernetesDemo -d demo-4t-k8s -g KubernetesDemo --generate-ssh-keys --orchestrator-type kubernetes az acs kubernetes get-credentials -g=KubernetesDemo -n=KubernetesDemo --ssh-key-file=$rsakeyfile az acr create --name 4tKubernetesDemoRegistry --resource-group KubernetesDemo --sku Basic az acr update -n 4tKubernetesDemoRegistry --admin-enabled true $acrusername = az acr credential show -n 4tKubernetesDemoRegistry --query username $acrpassword = az acr credential show -n 4tKubernetesDemoRegistry --query passwords[0].value kubectl create secret docker-registry 4tkubernetesdemoregistry --docker-username=$acrusername --docker-password=$acrpassword--docker-server='4tkubernetesdemoregistry.azurecr.io' -- docker-email='[email protected]' ### deploy k8s configurations kubectl apply -f .\devfun_namespaces.yaml kubectl apply -f nginx-ingress-defaultbackend.yaml kubectl apply -f nginx-ingress-controller.yaml kubectl apply -f nginx-ingress-service.yaml kubectl -n kube-system get po kubectl apply -f vsts_namespaces.yaml kubectl create secret generic vsts --from-literal=VSTS_TOKEN=$vstspat --from-literal=VSTS_ACCOUNT=$vstsaccount --namespace=vsts kubectl apply -f vsts_agent.yaml kubectl apply -f lego_namespaces.yaml kubectl apply -f lego_configmap.yaml kubectl apply -f lego_deployment.yaml kubectl apply -f devfun_ingress-dev.yaml kubectl apply -f devfun_ingress-test.yaml kubectl apply -f devfun_ingress-prod.yaml
  120. None