Performance Evaluation Using Docker and Kubernetes Disha Yaduraiah
Total Page:16
File Type:pdf, Size:1020Kb
FRIEDRICH-ALEXANDER-UNIVERSITAT¨ ERLANGEN-NURNBERG¨ TECHNISCHE FAKULTAT¨ • DEPARTMENT INFORMATIK Lehrstuhl f¨urInformatik 10 (Systemsimulation) Performance Evaluation using Docker and Kubernetes Disha Yaduraiah Masterarbeit Performance Evaluation using Docker and Kubernetes Masterarbeit im Fach Computational Engineering vorgelegt von Disha Yaduraiah angefertigt am Lehrstuhl f¨urInformatik 10 Prof. Dr. Ulrich R¨ude Chair of System Simulation Dr. Andrew John Hewett Dr.-Ing. habil. Harald K¨ostler Senior Software Architect ERASMUS Koordinator Siemens Healthcare GmbH Services Department of Computer Science Erlangen, Germany Erlangen, Germany Aufgabensteller: Dr.-Ing. habil. Harald K¨ostler Betreuer: Dipl.-Inform. Christian Godenschwager Bearbeitungszeitraum: 01 Dez 2017 - 01 Juni 2018 Erkl¨arung Ich versichere, dass ich die Arbeit ohne fremde Hilfe und ohne Benutzung anderer als der angegebenen Quellen angefertigt habe und dass die Arbeit in gleicher oder ¨ahnlicher Form noch keiner anderen Pr¨ufungsbeh¨ordevorgelegen hat und von dieser als Teil einer Pr¨ufungsleistungangenommen wurde. Alle Ausf¨uhrungen,die w¨ortlich oder sinngem¨aߨubernommen wurden, sind als solche gekennzeichnet. Declaration I declare that the work is entirely my own and was produced with no assistance from third parties. I certify that the work has not been submitted in the same or any similar form for assessment to any other examining body and all references, direct and indirect, are indicated as such and have been cited accordingly. Erlangen, 30 May, 2018 ......................................... (Disha Yaduraiah) iii Abstract Containerization technology has now made it possible to run multiple applications on the same servers with easy packaging and shipping ability. Unlike the old techniques of hard- ware virtualization, containers rest on the top of a single Linux instance leaving with a light-weight image containing applications. The DevOps methodology of Continuous Inte- gration/Continuous Delivery pipeline designed to encourage developers to integrate their code into a shared repository early and often, and to deploy the code quickly and efficiently. Containers combined with DevOps, are revolutionizing the way applications are built and deployed. With cloud orchestration tool like Kubernetes, we can monitor and manage container clustering and scheduling. Benchmarks are used to evaluate the performance of Kubernetes cluster and discuss how High Performance Computing (HPC) applications can be containerized using Docker and Kubernetes. v Acknowledgements I would first like to thank my thesis advisor Dr.-Ing. habil. Harald K¨ostlerat Informatik 10 Friedrich-Alexander University, Erlangen-N¨urnberg. He consistently allowed this research to be my own work, by providing timely evaluation and guidance. I would also like to acknowledge Dr. Andrew John Hewett , Senior Project Architect at Siemens Healthineers for giving me a chance to do my Master thesis project with Siemens Healthineers and constantly guiding me with valuable comments. I would like to thank Siemens AG for providing me with all necessary resources for completing my work. I would also like to thank the experts who were involved in the validation survey for this research project: Prof. Dr. Ulrich R¨ude,Head of System Simulation, Dipl.-Inform. Christian Godenschwager. Without their passionate participation and input, the validation survey could not have been successfully conducted. Finally, I must express my very profound gratitude to my parents and to my friends and family for providing me with unfailing support and continuous encouragement throughout my years of study and through the process of researching and writing this thesis. This accomplishment would not have been possible without them. Thank you. vii Contents Erkl¨arung iii Abstract v Acknowledgements vii 1 Introduction1 1.1 Motivation for virtualization .......................... 1 1.2 Overview of the Thesis ............................. 2 1.3 Related Work .................................. 3 2 Background7 2.1 Platform-as-a-Service .............................. 7 2.2 .NET Core Applications ............................. 8 2.3 Virtualization Technologies ........................... 9 2.4 Containerization ................................. 11 2.4.1 Docker Containers ........................... 12 2.4.2 Problems resolved using Docker .................... 14 2.4.3 Docker Security Considerations .................... 15 2.4.4 Performance of Containers ....................... 17 2.4.5 Docker Hub ............................... 19 2.5 Container-Management-System ......................... 21 2.5.1 KUBERNETES Architecture ..................... 22 ix 2.5.2 Creating a POD ............................. 23 2.5.3 Kubernetes Model ............................ 25 2.5.4 Advantages of Kubernetes cluster ................... 26 3 Implementation 28 3.1 Problems in Manual Deployment ........................ 28 3.2 Deployment Pipeline ............................... 29 3.3 CI/CD Pipeline ................................. 31 3.4 Build and Release pipeline ........................... 33 3.4.1 CI/CD Process Definition ....................... 35 3.4.2 Installing Docker and Kubernetes ................... 37 3.5 WALBERLA Framework ............................ 39 4 Testing 42 4.1 AKS cluster (single node VM, 7GB memory) ................. 42 4.2 .NET Project ................................... 43 4.3 UniformGrid Benchmark ............................ 45 4.3.1 Roofline model ............................. 47 5 Conclusion 53 Bibliography 55 Appendix A 60 Appendix B 74 Appendix C 80 Curriculum Vitae 93 List of Figures 2.1 Hypervisor-based virtualization......................... 10 2.2 Comparison between Virtual Machines and Docker Container........ 11 2.3 Docker Ecosystem................................ 13 2.4 Comparison VM Vs Containers......................... 18 2.5 Docker Pipeline................................. 19 2.6 Docker registry relationship with all users................... 21 2.7 Kubernetes Architecture............................ 22 2.8 Pod Flow using kubectl command....................... 24 2.9 Simplified Unified Modeling Language (UML) class diagram of the Kuber- netes resource model............................... 25 3.1 Deployment Pipeline............................... 30 3.2 CI/CD Pipeline................................. 34 3.3 Build definiton.................................. 35 3.4 Release Pipeline................................. 36 3.5 Structure of Build and Release pipeline.................... 37 3.6 Master-Slave inside Kubernetes cluster.................... 40 4.1 Azure Kubernetes Service with autoscaler................... 43 4.2 Outside world communication with External Load Balancer......... 44 4.3 Performance results with 8 vCPUs....................... 49 4.4 Performance results with 2 vCPUs....................... 50 Chapter 1 Introduction With the technology growing rapidly, the developer's main focus is on virtualization, load- balancing, scaling-out the deployments, managing dependencies, providing cross-platform stability and capability and so on. This can be now achieved by containerization. Container technology offers an alternative method for virtualization, in which a single operating sys- tem (OS) on a host can run many different applications from the cloud. When compared to virtual machines, containers provide the opportunity to virtualize the operating system it- self. Containers offer a logical packaging mechanism in which applications can be abstracted from the environment in which they actually run. This decoupling allows container-based applications to be deployed easily and consistently, regardless of the target environment. Running applications in the cloud efficiently require much more than deploying software in virtual machines. Continuous management monitors application and infrastructural met- rics to provide automated and responsive reactions to failures (health management) and changing environmental conditions (auto-scaling) minimizing human intervention [1] which is supported with an orchestrator like Kubernetes. Kubernetes is a novel architecture that enables scalable and resilient self-management of microservices applications on the cloud. 1.1 Motivation for virtualization The challenges of managing a data center, including network management, hardware ac- quisition, energy efficiency, and scalability with business demands which are costly to im- 1 2 CHAPTER 1. INTRODUCTION plement in a way that easily expands and contracts as a function of demand. Also as business aggregate and collaborate in global contexts, data center scalability is constrained by cost, the ability to efficiently manage environments and satisfy regulatory requirements, and geographic limitations. Cloud solutions can form the basis of a next-generation data center strategy, bringing agility, elasticity, and economic viability. There are several ad- vantages in embracing the cloud, but in essence, they typically fall into two categories namely operational (flexibility/speed) or economical (costs) reasons. From the former per- spective, cloud computing offers fast self-service provisioning and task automation through APIs which allow deploying and remove resources instantly, reduce wait time for provision- ing dev/test/production environments, enabling improved agility and time-to-market facing business changes. Bottom line is increased productivity. From the economic perspective, the pay-per-use model means that no upfront investment is needed for acquiring IT