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

August 29, 2017
Tweet

More Decks by Azure Zurich User Group

Other Decks in Technology

Transcript

  1. Marc Müller
    Principal Consultant
    @muellermarc

    View full-size slide










  2. View full-size slide

  3. 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

    View full-size slide

  4. 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

    View full-size slide

  5. https://docs.microsoft.com/en-us/azure/container-service/kubernetes/container-service-intro-kubernetes

    View full-size slide








  6. View full-size slide





  7. View full-size slide



  8. 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

    View full-size slide



  9. Replication Controller / Deployment
    (Replication Set)
    Pod Container
    Pod Container
    Pod Container

    View full-size slide







  10. Service
    Pod Container
    Pod Container
    Pod Container
    A
    1.2
    A
    1.2
    A
    1.2
    A
    1.2

    View full-size slide









  11. View full-size slide




  12. Image Source: https://docs.microsoft.com/en-us/azure/container-service/container-service-intro

    View full-size slide

  13. 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

    View full-size slide





  14. View full-size slide

  15. Image Source: https://docs.docker.com/registry/spec/api/

    View full-size slide







  16. View full-size slide







  17. View full-size slide









  18. View full-size slide

  19. VSTS Build Agent
    Build Pool
    Build Pool
    Build Pool
    Build
    Definition
    Build
    Definition
    Build
    Queue
    Docker Engine
    Build
    Agent

    View full-size slide

  20. Setup VSTS Services
    ▪ Docker Registry Connection
    ▪ Kubernetes Connection

    View full-size slide






  21. View full-size slide

  22. kube-lego requests certificates
    for Kubernetes Ingress resources
    Automatic checking for certificates
    Available for
    !!! Non-production use cases !!!

    View full-size slide













  23. View full-size slide

  24. We are looking for
    great talents to
    join our team!
    Apply to [email protected]
    www.4tecture.ch/jobs

    View full-size slide

  25. 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

    View full-size slide