.NET Day 19 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥ by Marc Müller

.NET Day 19 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥ by Marc Müller

DOCKER + AZURE DEVOPS + KUBERNETES = ♥

E6cffbf3b7a5fbfee4707033ef1636f5?s=128

dotnetday

May 28, 2019
Tweet

Transcript

  1. Marc Müller Principal Consultant @muellermarc

  2. https://globaldevopsbootcamp.com

  3. None
  4. None
  5. Write Code Customer use the code Write Code Customer use

    the code
  6. 100 deployments per day!

  7. None
  8. None
  9. ▪ ▪ ▪ ▪ ▪ ▪ ▪

  10. None
  11. None
  12. ▪ Versioned artifact ▪ Isolated deployable unit ▪ Container image

    is bit by bit identical when deployed ▪ Abstraction of data center resources ▪ ▪ Orchestration is “Cattle Business” ▪ ▪
  13. Server Host OS Hypervisor Server Host OS Docker Engine Guest

    OS Guest OS Guest OS Bins/Libs Bins/Libs App A App A’ App B Bins/Libs Bins/Libs App A App A’ App B App B’ App B App B’ App B App B’ Containers are isolated, but share OS and, where appropriate, bins/libraries Bins/Libs Image Source: https://sec.ch9.ms/sessions/build/2016/B822.pptx
  14. My ASP.NET Core Application microsoft/dotnet:2.1.4- aspnetcore-runtime microsoft/dotnet:2.1-runtime- deps-alpine3.7 alpine:3.7

  15. FROM microsoft/dotnet:2.1-aspnetcore- runtime WORKDIR /app COPY output/app . ENTRYPOINT ["dotnet",

    "HelloWorld.dll"] FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base WORKDIR /app EXPOSE 80 FROM microsoft/dotnet:2.1-sdk AS build WORKDIR /src COPY ["HelloWorld/HelloWorld.csproj", "HelloWorld/"] RUN dotnet restore "HelloWorld/HelloWorld.csproj" COPY . . WORKDIR "/src/HelloWorld" RUN dotnet build "HelloWorld.csproj" -c Release -o /app FROM build AS publish RUN dotnet publish "HelloWorld.csproj" -c Release -o /app FROM base AS final WORKDIR /app COPY --from=publish /app . ENTRYPOINT ["dotnet", "HelloWorld.dll"]
  16. docker build –t <reponame>:<tag> . docker image ls REPOSITORY TAG

    IMAGE ID HelloWorld latest 326387cea398
  17. None
  18. Developer PC / Laptop Docker Engine Container Container Container

  19. ▪ ▪ ▪

  20. ▪ ▪ ▪ ▪ ▪ ▪

  21. None
  22. ▪ ▪ ▪ ▪ ▪

  23. None
  24. App1 App2

  25. None
  26. ▪ ▪ ▪ ▪ ▪ ▪ ▪

  27. ▪ ▪ ▪ ▪

  28. ▪ ▪ 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
  29. ▪ ▪ Replication Controller / Deployment (Replication Set) Pod Container

    Pod Container Pod Container
  30. ▪ ▪ ▪

  31. ▪ ▪ ▪ ▪ ▪ ▪ Service Pod Container Pod

    Container Pod Container A B A B A B A B
  32. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

  33. None
  34. ▪ ▪ ▪ ▪ ▪ ▪ Source: https://helm.sh/

  35. Source: https://docs.helm.sh/developing_charts/#charts

  36. None
  37. None
  38. None
  39. None
  40. Azure DevOps Azure Resource Group DCOS Master DCOS Master Master

    Agent Cert-Manager App1 App1 App1 App1 App1 App2 Git Build Release Internet Azure Load Balancer Ingress
  41. Azure DevOps Build Azure DevOps Release Docker Registry Build App

    Test Build Container Repo Helm Upgrade Publish to Target AKS (Cluster) Helm Chart (Config) Push Host / Cluster Pull Config Artifact
  42. None
  43. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

  44. None
  45. Release v2 Deploy DB Schema Deploy Binaries Prod Environment v2

    Binaries v1 Prod Environment v2 Binaries v2 Release v2 Deploy Binaries Deploy DB Schema Prod Environment v1 Binaries v1 Binaries v2 Factory Prod Environment v2 Binaries v1 Binaries v2 Factory
  46. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

  47. ▪ ▪

  48. None
  49. ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

  50. None
  51. None
  52. None
  53. ▪ ▪ ▪ ▪

  54. None
  55. None
  56. None
  57. None
  58. None
  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. None
  66. None
  67. None
  68. None
  69. None
  70. None
  71. None
  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. None
  100. None
  101. None
  102. None
  103. None
  104. None
  105. None
  106. None
  107. None
  108. None
  109. None
  110. None
  111. None
  112. None
  113. None