Kubernetes for Developers Use Kubernetes to develop, test, and deploy your applications with the help of containers Joseph Heck BIRMINGHAM - MUMBAI Kubernetes for Developers Copyright © 2018 Packt Publishing All rights reserved No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews Every effort has been made in the preparation of this book to ensure the accuracy of the information presented However, the information contained in this book is sold without warranty, either express or implied Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals However, Packt Publishing cannot guarantee the accuracy of this information Commissioning Editor: Gebin George Acquisition Editor: Rahul Nair Content Development Editor: Sharon Raj Technical Editor: Prashant Chaudhari Copy Editor: Safis Editing Project Coordinator: Virginia Dias Proofreader: Safis Editing Indexer: Priyanka Dhadke Graphics: Tom Scaria Production Coordinator: Deepika Naik First edition: April 2018 Production reference: 1050418 Published by Packt Publishing Ltd Livery Place 35 Livery Street Birmingham B3 2PB, UK ISBN 978-1-78883-475-9 www.packtpub.com mapt.io Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career For more information, please visit our website Why subscribe? Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals Improve your learning with Skill Plans built especially for you Get a free eBook or video every month Mapt is fully searchable Copy and paste, print, and bookmark content PacktPub.com Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy Get in touch with us at service@packtpub.com for more details At www.PacktPub.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 Packt books and eBooks Contributors About the author Joseph Heck has broad development and management experience across start-ups and large companies He has architected, developed, and deployed a wide variety of solutions, ranging from mobile and desktop applications to cloud-based distributed systems He builds and directs teams and mentors individuals to improve the way they build, validate, deploy, and run software He also works extensively with and in open source, collaborating across many projects, including Kubernetes A common pattern for developing with Docker has been to mount a local directory that contains interpreted code (such as our Python and JavaScript examples in this book) and to have the container run that code, so that you can edit it on the fly and quickly restart and retry ksync mimics this capability by running both on your local development machine and within your cluster, watching for changes locally and reflecting them into Kubernetes ksync focuses on the development process for software within a single pod So while it won't help with deploying all the supporting applications, it may make the development process with a single component in Kubernetes much faster Telepresence Telepresence, available at https://www.telepresence.io, is another project that focuses on providing the developer with tighter access from their local machine into a Kubernetes cluster: Created by Datawire, which makes additional projects for developers to work with Kubernetes, Telepresence creates a twoway proxy that forwards connections and responses to a process that would be within a pod in Kubernetes to a process running on your local development machine Where ksync copies your code and runs it within Kubernetes, Telepresence lets you run the code on your own machine, transparently connecting it as though it were a pod running within Kubernetes Interacting with the Kubernetes project In discussing all these projects, the one where you can get the most information about how to work with Kubernetes is Kubernetes itself The project hosts a website that includes the formal documentation, a blog, a community calendar, tutorials, and more at https://kubernetes.io/: This site makes a great jumping off point to get more information, but certainly isn't the only resource available The Kubernetes project is really quite large, so large that it is nearly impossible for any single person to track all of the efforts, evolution, projects, and interests that are going on within the project To attempt to provide guidance, the Kubernetes project has set itself up with a number of groups to focus on these interests in the form of Special Interest Groups, or SIGs These groups are the semi-formal subprojects of Kubernetes, and each focuses on some specific subset of Kubernetes Not surprisingly, many of these SIGs overlap in specifics, and it is not uncommon to find a contributor within Kubernetes being active in a number of SIGs at once The complete list of SIGs is available online and is maintained at ht tps://github.com/kubernetes/community/blob/master/sig-list.md Each SIG has specific people called out as leaders, hosts regular meetings, and many of them maintain online notes and even recordings of their online meetings These SIGs all loosely coordinate to advance Kubernetes, and are in turn coordinated by a Kubernetes steering committee and a number of community managers There are also less formal working groups that pop up to focus on specific or short-lived interests that don't have any specific leadership or attendance All together, the SIGs and working groups can create a tremendous amount of information and depth that is available to look through, and a very open community of people to interact with regarding the project The community also manages a calendar of SIG meetings and events, available at https://kubernetes.io/community/, and publishes regularly on the Kubernetes blog at http://blog.kubernetes.io Slack A common and interactive means of Kubernetes contributors working together is by using online chat channels at Slack Kubernetes hosts a large number of interactive channels dedicated to SIGs, working groups, and projects within Kubernetes Anyone may join, and you can sign up for access at http://slack.k8s.io If you are new to Slack or Kubernetes, then the channels #kubernetesusers and #kubernetes-novices may be of particular interest The overall community team also hosts what they call office hours, which is a live stream hosted on YouTube, as well as the Slack channel, #officehours YouTube If you prefer video streams, the Kubernetes community offers a YouTube channel, available at https://www.youtube.com/c/KubernetesCommunity/ These include recorded videos from community meetings, as well as sessions from regular Kubernetes conferences A large number of SIGs also record their regular meetings and post those on YouTube, although they are not consistently coordinated through this channel If you want to find related content, it is best to track that down through each individual SIG, although you may be able to find what you're looking for under the channel's playlists at https: //www.youtube.com/channel/UCZ2bu0qutTOM0tHYa_jkIwg/playlists: Stack Overflow Members of the Kubernetes community also watch and offer answers to questions on Stack Overflow The office hours mentioned earlier encourage folks to post their questions on Stack Overflow and bring those to the office hours for interactive help You can find Kubernetes-related questions at https://stackoverflow.com/q uestions/tagged/kubernetes If you search for Kubernetes-related topics on Google, you may also find the results within questions already asked, and answered, on Stack Overflow Mailing lists and forums Kubernetes has a general mailing list/forum, as well as mailing lists for every SIG and frequently for each working group as well The common forums include: https://groups.google.com/forum/#!forum/kubernetes-users https://groups.google.com/forum/#!forum/kubernetes-dev The list of SIGs at https://github.com/kubernetes/community/blob/master/sig-list.m d also includes a reference to the individual mailing lists for each SIG There is no one path for information on Kubernetes, and the community works very hard to accommodate multiple ways to get information, ask questions, and encourage participation Summary In this chapter, we touched on some of the problems that you may run into when developing and deploying to Kubernetes, and then touched on a number of projects that may be of interest to help you or your team speed up their development process while also taking advantage of Kubernetes The final portion of this chapter discussed the Kubernetes project itself, how you can interact with it, and where to find more information to leverage this amazing set of tools Other Books You May Enjoy If you enjoyed this book, you may be interested in these other books by Packt: DevOps with Kubernetes Hideto Saito, Hui-Chuan Chloe Lee, Cheng-Yang Wu ISBN: 978-1-78839-664-6 Learn fundamental and advanced DevOps skills and tools Get a comprehensive understanding for container Learn how to move your application to container world Learn how to manipulate your application by Kubernetes Learn how to work with Kubernetes in popular public cloud Improve time to market with Kubernetes and Continuous Delivery Learn how to monitor, log, and troubleshoot your application with Kubernetes Mastering Kubernetes Gigi Sayfan ISBN: 978-1-78646-100-1 Architect a robust Kubernetes cluster for long-time operation Discover the advantages of running Kubernetes on GCE, AWS, Azure, and bare metal See the identity model of Kubernetes and options for cluster federation Monitor and troubleshoot Kubernetes clusters and run a highly available Kubernetes Create and configure custom Kubernetes resources and use third-party resources in your automation workflows Discover the art of running complex stateful applications in your container environment Deliver applications as standard packages Leave a review - let other readers know what you think Please share your thoughts on this book with others by leaving a review on the site that you bought it from If you purchased the book from Amazon, please leave us an honest review on this book's Amazon page This is vital so that other potential readers can see and use your unbiased opinion to make purchasing decisions, we can understand what our customers think about our products, and our authors can see your feedback on the title that they have worked with Packt to create It will only take a few minutes of your time, but is valuable to other potential customers, our authors, and Packt Thank you! .. .Kubernetes for Developers Use Kubernetes to develop, test, and deploy your applications with the help of containers Joseph Heck BIRMINGHAM - MUMBAI Kubernetes for Developers Copyright... with an API and command-line tools Kubernetes can be used on your laptop, or leveraged from one of the many cloud providers The benefit of using Kubernetes is being able to use the same set of. .. getting started with Kubernetes and explains how to resolve them, and provides an overview of a number of projects within the Kubernetes ecosystem that may be of interest to developers and the development