Statistics
4
Views
0
Downloads
0
Donations
Support
Share
Uploader

高宏飞

Shared on 2026-03-21

AuthorKumar, Neeraj

No description

Tags
devops
Publisher: BPB Publications
Publish Year: 2023
Language: 英文
File Format: PDF
File Size: 4.9 MB
Support Statistics
¥.00 · 0times
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

(This page has no text content)
(This page has no text content)
DevOps for Java Developers DevOps and DevSecOps best practices for Java developers Neeraj Kumar www.bpbonline.com
First Edition 2025 Copyright © BPB Publications, India ISBN: 978-93-65896-015 All Rights Reserved. No part of this publication may be reproduced, distributed or transmitted in any form or by any means or stored in a database or retrieval system, without the prior written permission of the publisher with the exception to the program listings which may be entered, stored and executed in a computer system, but they can not be reproduced by the means of publication, photocopy, recording, or by any electronic and mechanical means. LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY The information contained in this book is true to correct and the best of author’s and publisher’s knowledge. The author has made every effort to ensure the accuracy of these publications, but publisher cannot be held responsible for any loss or damage arising from any information in this book. All trademarks referred to in the book are acknowledged as properties of their respective owners but BPB Publications cannot guarantee the accuracy of this information. www.bpbonline.com
Dedicated to My father Dr. Nagendra Kumar and My mother Daisy Gupta
About the Author Neeraj Kumar has been working in software industry for more than 16 years, playing central roles in numerous projects as a technical leader, DevOps engineer and software engineer, delivering projects using automation engineering for big companies, including successful projects in Australia, South America, United Kingdom, Europe, and the United States. Currently, he is a senior DevOps architect/engineer and a technical advisor at one of the leading product based company. He is also an accomplished postgraduate completing a degree in computer applications and systems and holds two master’s degrees focused on software engineering (M.C.A) with engineering practices (M.B.A). In the meantime, he successfully got many certifications in cloud technologies and DevOps. Furthermore, the author participates as a speaker in various IT conferences and writes technical articles on DevOps and related topics. He also provides DevOps trainings to teams and individuals.
About the Reviewer Ron is a seasoned software engineer with over 20 years of experience in the Java ecosystem. From mainframes to Microservices, he's seen it all. His passion for software engineering and architecture drives his work. A certified Java expert (OCP and SCBCD/OCPBCD), Ron is proficient in a wide range of frameworks and libraries, from Apache to ZK. He's also keen on exploring alternative JVM languages like Kotlin. As a special agent and senior developer at Team Rockstars IT, Ron shares his knowledge as an international conference speaker and via his written works. He's the author of books 'Java Cloud-native migrations with Jakarta EE' and 'Virtual Threads, Structured Concurrency, and Scoped Values'.
Acknowledgement I want to express my deepest gratitude to my parents, whose guidance and support have been a cornerstone in my life, and to my family and friends for their unwavering support and encouragement throughout this book's writing. A special thanks goes to my incredible wife Kumud, whose love, patience and belief in me have been my true anchor on this journey. Also, I am deeply thankful for the constant support of my amazing sisters Anju and Anu. I am also grateful to BPB Publications for their guidance and expertise in bringing this book to fruition. It was a long journey of revising this book, with valuable participation and collaboration of reviewers, technical experts, and editors. I would also like to acknowledge the valuable contributions of my colleagues and co-worker during many years working in the tech industry, who have taught me so much and provided valuable feedback on my work. Finally, I would like to thank all the readers who have taken an interest in my book and for their support in making it a reality. Your encouragement has been invaluable.
Preface With rise of DevOps, cloud platform, and container technologies, the way we build, deploy, and secure applications is rapidly changing. DevOps brings together the essential practices, philosophies, and tools that streamline software creation and making it possible to develop and release the features with pace. This book aims to help you in understanding and using the latest DevOps techniques in simplifying your build and deployment process using Microservices, serverless, and cloud native technologies. It covers a wide range of topics, including the principles of DevOps, source code management, CI/CD, containerization, package management and DevSecOps, gaining insights into the essential tools that needed to build and deploy modern applications. For anyone developing with Spring boot, Micronaut, Quarkaus, and more, this book provides a solid foundation. As mobile devices are increasing, Mobile DevOps has become essential for the teams focused on creating a seamless user experience across platforms. This book dedicates a full chapter to Mobile DevOps, exploring its best practices and strategies for integrating DevOps into mobile development workflows. Throughout the book, you will learn about the key principles, best practices and various tools to implement DevOps in your software development tasks. Each chapter includes hands-on insights and real-world examples, guiding you through the DevOps lifecycle-from building applications to securing and managing the artifacts. Whether you’re a software developer looking to streamline your workflow or a DevOps professional aiming to build resilient, efficient applications,
this book offers the tools and insight you need to succeed. It’s my hope that this book will empower you to embrace DevOps, improve your process, and make your mark in modern software development. Chapter 1: Lead the Transformation with DevOps – provides a thorough understanding of DevOps by exploring its key concepts, importance, benefits and practical applications. The chapter also explains the role of automation in DevOps, the structure of DevOps team and DevOps strategy. Furthermore, the chapter also reviews the DevOps process, focus particularly on continuous integration and continuous delivery (CI/CD). Chapter 2: Slicing the Monolith - highlights the needs for flexibility, scalability and agility in software development and presents a detailed overview of shifting from Monolithic architecture to Microservices. The chapter outlines the key differences between the two, addressing the challenges of Monolithic systems and when Microservices are preferable. You'll find practical guidance for a smooth transition, best practices, and insights on how DevOps supports this shift. The chapter also covers frameworks like Spring Boot, Micronaut, and Quarkus, along with serverless architecture using AWS Lambda. Chapter 3: Manage Your Source Code - covers the basics of source control management, its historical evolution, and the shift towards distributed version control, particularly focusing on Git. You'll learn about code versioning best practices, how to choose the right source control tool, and the components of Git, including creating your first Git pull request. We explore various Git clients and workflows, wrapping up with essential best practices for effective source control management. Chapter 4: Containerization – explores the transformative role of containers in application development and management, emphasizing their lightweight and consistent nature across various environments. The chapter explains key concept of containers , it’s evolution and how it’s distinguish from virtual machines. Furthermore, chapter also covers Docker architecture and Kubernetes orchestration, with practical guidance on
setting up Docker and executing basic commands. The chapter also addresses essential topics like tagging, versioning, and image layers and best practices for building optimized container images. Chapter 5: Continuous Integration – highlights continuous integration (CI) as a foundational practice in software development, emphasizing its importance in enhancing efficiency and early error detection. The chapter covers key CI concepts and practices, focusing on declarative build scripts with tools like Ant, Maven, and Gradle for streamlined build processes. The chapter also covers continuous build processes and their role in supporting agile development, along with the essential role of test automation to ensure reliability. Furthermore, this chapter also discusses how to build a robust CI pipeline using Jenkins and strategies to implement and maintain effective CI workflows. Chapter 6: Package Management - emphasizes that software artifacts alone aren’t enough to ensure quality or competitive advantage—metadata is essential for tracking build details, dependency versions, and environments, enhancing the reproducibility and stability of build pipelines. The chapter covers dependency resolution basics using Java tools like Maven and Gradle, as well as managing dependencies for containers. The chapter also provides guidance on publishing Java artifacts to repositories, discussing Maven Central as a primary option and alternatives like Sonatype Nexus and JFrog Artifactory for internal artifact management. The chapter serves as a comprehensive guide to artifact generation, metadata, dependency management, and publication best practices. Chapter 7: Protecting Your Binaries - explains the importance of embedding security early in the software development process to address rising supply chain threats. The chapter covers key DevSecOps principles, emphasizing a "shift-left" approach to proactively reduce vulnerabilities. The chapter also allows readers to learn essential security methodologies like SAST and DAST, as well as tools like SonarQube for ongoing security checks to enhance security, minimize risks, and build resilient software adaptable to evolving cyber threats.
Chapter 8: Deployment Strategies - provides the readers with essential skills for deploying applications, particularly in Kubernetes environments. The chapter covers planning deployment strategies, building and pushing container images with Java tools like Jib and Eclipse JKube, and generating Kubernetes manifests using Dekorate. The chapter also discusses key deployment strategies, including rolling updates, blue-green, and canary deployments. The chapter also emphasizes health checks, system monitoring, and resource adjustment to maintain performance. Furthermore, it explores high availability and multi-cloud strategies to handle complex deployment scenarios. Chapter 9: Continuous Delivery and Deployment – explains the importance of continuous uptime, continuous integration (CI), continuous delivery (CD), and continuous deployment in software development. You will get to know the difference between continuous delivery and continuous deployment. The chapter also covers key differences, best practices, and challenges for continuous delivery and continuous deployment, with a Jenkins pipeline example to demonstrate CI/CD in action. Chapter 10: Mobile DevOps - is dedicated to the Mobile DevOps, focusing on the distinct challenges of Android and iOS. The chapter explains Android’s fragmented ecosystem, with thousands of devices from multiple manufacturers and demand of a highly automated DevOps pipeline for android and iOS. The chapter also covers robust CI/CD pipelines, continuous testing, and UI automation on real devices to ensure reliable user experiences. Furthermore the chapter highlights best Mobile DevOps practices.
Code Bundle and Coloured Images Please follow the link to download the Code Bundle and the Coloured Images of the book: https://rebrand.ly/b1e7de The code bundle for the book is also hosted on GitHub at https://github.com/bpbpublications/DevOps-for-Java-Developers. In case there’s an update to the code, it will be updated on the existing GitHub repository. We have code bundles from our rich catalogue of books and videos available at https://github.com/bpbpublications. Check them out! Errata We take immense pride in our work at BPB Publications and follow best practices to ensure the accuracy of our content to provide with an indulging reading experience to our subscribers. Our readers are our mirrors, and we use their inputs to reflect and improve upon human errors, if any, that may have occurred during the publishing processes involved. To let us maintain the quality and help us reach out to any readers who might be having difficulties due to any unforeseen errors, please write to us at : errata@bpbonline.com Your support, suggestions and feedbacks are highly appreciated by the BPB Publications’ Family. Did you know that BPB offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.bpbonline.com and as a print book
customer, you are entitled to a discount on the eBook copy. Get in touch with us at : business@bpbonline.com for more details. At www.bpbonline.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on BPB books and eBooks. Piracy If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at business@bpbonline.com with a link to the material. If you are interested in becoming an author If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit www.bpbonline.com. We have worked with thousands of developers and tech professionals, just like you, to help them share their insights with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea. Reviews Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions. We at BPB can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about BPB, please visit www.bpbonline.com. Join our book’s Discord space Join the book’s Discord Workspace for Latest updates, Offers, Tech happenings around the world, New Release and Sessions with the Authors: https://discord.bpbonline.com
Table of Contents 1. Lead the Transformation with DevOps Introduction Structure Objectives Understanding DevOps The need for DevOps Business need Application development need Scenario 1 Scenario 2 DevOps and automation DevOps team structure Team roles DevOps strategy Benefits of DevOps DevOps process Source code management Source code review Configuration management Build management Artifacts repository management Release management
Test automation Continuous integration Continuous delivery Continuous deployment Infrastructure as code Application performance monitoring Conclusion 2. Slicing the Monolith Introduction Structure Objectives Monolithic vs. Microservices based architecture Monolithic architecture Microservices architecture The need for Microservices Planning Monolithic to Microservices migration DevOps and Microservices Understanding DevOps and Microservices DevOps is the cultural shift Microservices is the modular approach The synergy of DevOps and Microservices Microservices frameworks Spring Boot Micronaut Quarkus Serverless Setting up
Conclusion 3. Manage Your Source Code Introduction Structure Objectives Source control management Three generations of source control management First generation: Local SCM software Second generation: Centralized SCM tools Third generation: Distributed SCM systems Code versioning Semantic versioning Best practices for code versioning Choosing your source control Git components Git server Git clients Making your first pull request Git tools Git command-line basics Preparing to work with Git from command line Working with a local repository Creating an initial repository Git command-line tutorial Git clients Git IDE integration Git workflows
Centralized workflow Feature branching Git-flow workflow Forking workflow Trunk-based development Best practices for source control management Conclusion 4. Containerization Introduction Structure Objectives Understanding containers and their usage History of containers Difference between containers and virtual machines Understanding virtual machines Working of virtual machine Components of virtual machine Pros and cons of virtual machine Understanding container Working of containers Pros and cons of container Choosing VMs vs containers Key container and image terminologies Docker architecture Dockerfile Sample Dockerfile Docker container orchestration using Kubernetes
Working of Kubernetes Docker on your machine Basic tagging and image version management Adding tags to images Image layers Run Kubernetes locally Best image building practices Conclusion 5. Continuous Integration Introduction Structure Objectives Continuous integration Continuous integration in development team Critical concepts of continuous integration Key practices of continuous integration Declarative build script Build with Apache Ant Key Ant terminology Build with Apache Maven Key Maven terminology Build with Gradle Key gradle terminology Continuous build Test automation Monitor and maintain tests Building pipeline with Jenkins