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

VSTS/TFS Release Automation with Docker and Azu...

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

August 29, 2017
Tweet

More Decks by Azure Zurich User Group

Other Decks in Technology

Transcript

  1. 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
  2. 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
  3. ▪ ▪ 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
  4. ▪ ▪ ▪ ▪ ▪ ▪ Service Pod Container Pod

    Container Pod Container A 1.2 A 1.2 A 1.2 A 1.2
  5. 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
  6. VSTS Build Agent Build Pool Build Pool Build Pool Build

    Definition Build Definition Build Queue Docker Engine Build Agent
  7. kube-lego requests certificates for Kubernetes Ingress resources Automatic checking for

    certificates Available for !!! Non-production use cases !!!
  8. 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