Rahul Sharma and Akshay Mathur
Traefik API Gateway for Microservices
With Java and Python Microservices Deployed in Kubernetes
1st ed.
Logo of the publisher
Rahul Sharma
Patpargunj, Delhi, India
Akshay Mathur
Gurgaon, Haryana, India
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/978-1-4842-6375-4 . For more detailed information, please visit http://www.apress.com/source-code .
ISBN 978-1-4842-6375-4 e-ISBN 978-1-4842-6376-1
https://doi.org/10.1007/978-1-4842-6376-1
Rahul Sharma, Akshay Mathur 2021
Apress Standard
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza, Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
To our families, for all the personal time spent on this book
Introduction
Microservice architecture has brought dynamism to the application ecosystem. New services are built and deployed while older ones are deprecated and removed from the enterprise application estate. But front-end load balancers havent been able to adapt to the components in the enterprise architecture. Most current load balancers have a static configuration. They require configuration updates as the application landscape changes. Thus, there are operational complexities when working with microservices. These are a few of the challenges of getting a microservices-based solution to work. The dynamic nature of the ecosystem requires dynamic tools that can autoconfigure themselves.
Traefik bases its foundations on the dynamic nature of the Microservice architecture. It has built first-class support for service discovery, telemetry, and resiliency. It is a modern HTTP reverse proxy and load balancer that eases microservices deployment. Its integration has been great, with many existing tools.
The book covers Traefik setup, basic workings, and integration with microservices. It is intended for developers, project managers, and DevOps personnel interested in solutions for their operational challenges. The book is not specific to any programming language, even though all the examples use Java or Python.
Acknowledgments
This book would not have been possible without the support of many people. I would like to take this opportunity and express my gratitude to each of them.
I would like to thank Divya Modi for believing in the project and making it work. She has been instrumental in starting the project. Moreover, during the project, her editorial support provided a constant push throughout the process. It would have been difficult to deliver the project without your support.
I would like to thank Celestin Suresh John for providing me this wonderful opportunity. Your guidance made sure that we got the correct path outlined from the start.
I would like to thank Brijesh Pant and Laura C. Berendson for sharing valuable feedback. Your advice has helped to deliver the ideas in a better manner.
I would also like to thank my co-author Akshay Mathur for his knowledge and support. Your experience and willingness have made this a successful project. The brainstorming sessions we had helped to express the ideas.
I wish to thank my parents, my loving and supportive wife, Swati, and my son, Rudra. They are a constant source of encouragement and inspiration. Thanks for providing the time and listening to my gibberish when things were not working according to the plan.
Lastly, I would like to thank my friends, who have been my source of knowledge. The discussion we had often helped me to deliberate on various topics. Often our debates have provided the testbed for evaluations.
Rahul Sharma
Id like to express my gratitude to my co-author Rahul Sharma for bringing me on board this project. While we had discussed the possibility, the actual opportunity still came suddenly, and Id like to thank him for his guidance through the process. It was as fun and nerve-wracking as Id envisioned, and he had my back the whole way as I channeled my inner Douglas Adams and (to borrow from a great man) enjoyed the sound of deadlines whooshing by.
Divya Modi was a constant source of support and encouragement. She gently helped us stay on track and was a picture of calm and confidence, helping us get to completion. And still entertained multiple last-minute requests as I kept tweaking the title.
To our reviewers, Brijesh Pant and Laura C. Berendson, thank you for all the constructive feedback in making this book better.
Id also like to thank my ever-patient family, especially my mother, my wife, Neha, and my daughter, Inara, who kept wondering when I would actually be done and free to talk to them, as I kept fiddling till the last minute and repeating, Almost there!.
Im grateful to the two mentors who pulled me up to the level of authoring a bookAditya Kalia and Shekhar Gulati.
Finally, our gratitude to the Traefik team for releasing an excellent product to the community. We hope this book helps in any small way to drive further adoption.
Akshay Mathur
Table of Contents
About the Authors
Rahul Sharma
is a seasoned Java developer with over 15 years of industry experience. In his career, he has worked with companies of various sizes, from enterprises to start-ups. During this time, he has developed and managed microservices on the cloud (AWS/GCE/DigitalOcean) using open source software. He is an open-source enthusiast and shares his experience at local meetups. He has co-authored Java Unit Testing with JUnit 5 (Apress, 2017) and Getting Started with Istio Service Mesh (Apress, 2019).