The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes

所需积分/C币:38 2019-01-23 11:29:03 13.26MB PDF
43
收藏 收藏
举报

The DevOps 2.3 Toolkit: Kubernetes 和 The DevOps 2.4 Toolkit: Continuous Deployment To Kubernetes 的续集。
Contents Preface Overview,,,,,,,,,,,,,,,,,, About the author 翻D 翻普 4 Dedication Audience 567 Requirements Autoscaling Deployments and StatefulSets Based On Resource Usage Creating A Cluster 10 Observing metrics Server Data 11 Auto-Scaling Pods based On resource utilization 19 To Replicas Or Not To Replicas In Deployments And StatefulSets? ·· 33 What now? Auto-Scaling Nodes Of A Kubernetes Cluster 41 Creating A Cluster ,,,,,,,41 Setting Up Cluster autoscaling 43 Scaling Up The cluster 46 The Rules Governing Nodes Scale-Up ··· Scaling down the cluster 56 The Rules Governing Nodes Scale-Down 61 Can We Scale Up Too Much Or De-Scale To Zero Nodes? Cluster Autoscaler Compared in GKE, EKS, and aks 62 What now? Collecting And Querying Metrics And Sending Alerts Creating A Cluster 66 Choosing The Tools For Storing And Querying Metrics And Alerting 67 A Quick Introduction To Prometheus And alertmanager 68 Which Metric Types should We u Alerting On Latency-Related Issues CONTENTS Alerting On Traffic-Related issues 104 Alerting On Error-Related Issues 翻D垂 114 Alerting On Saturation-Related Issues ,118 Alerting On Unschedulable Or Failed Pods 142 Upgrading Old Pods 148 Measuring Containers Memory And CPU Usage 153 Comparing Actual Resource Usage With Defined Requests ,.,,,,.157 Comparing Actual Resource Usage With Defined Limits ,169 What Now? 173 Debugging Issues Discovered Through Metrics And Alerts 174 Creating A Cluster 174 上 acing A Disaster .175 Using Instrumentation To Provide more Detailed Metrics ,179 Using Internal Metrics To Debug Potential Issues What now? .194 Extending HorizontalPodAutoscaler With Custom Metrics 195 Creating A Cluster 195 USing HorizontalPodAutoscaler Without Metrics Adapter ,,..,197 Exploring Prometheus Adapter 198 Creating HorizontalPodAutoscaler With Custom Metrics ....................205 Combining metric Server Data With Custom Metrics 翻D垂 221 The Complete Horizontal PodAutoscaler Flow Of Events 223 Reaching Nirvana ,,,,,,,224 What Now? .,.,,,,,,,,,,,,,,,,225 Visualizing Metrics And Alerts 226 Creating A Cluste 227 Which Tools should We use For dashboards? 227 Installing And Setting Up Grafana 228 Importing And Customizing Pre-Made dashboards 232 Creating Custom Dashboards ...238 Creating Semaphore Dashboards A Better Dashboard For Big Screens 250 Prometheus Alerts vs. Grafana Notifications vs Semaphores vS Graph Alerts 253 What Now? 254 Collecting And Querying Logs 256 Creating A Cluster 256 Exploring logs Through kubectl 258 Choosing A Centralized Logging Solution 260 Exploring Logs collection And Shipping 262 Exploring Centralized Logging Through Papertrail 262 CONTENTS Combining gcp stack Driver With a gKe Cluster 269 Combining AWS CloudWatch With An EKS Cluster............271 Combining Azure Log Analytics With An AKS Cluster .276 Exploring Centralized Logging Through Elasticsearch, Fluentd, and Kibana Switching To Elasticsearch For Storing Metrics 288 What Should We Expect From Centralized Logging? 2 What Now? ,,,,292 What did We do? 29生 Contributions .295 Preface Kubernetes is probably the biggest project we know. It is vast, and yet many think that after a few weeks or months of reading and practice they know all there is to know about it. It's much bigger than that, and it is growing faster than most of us can follow. How far did you get in Kubernetes adoption? From my experience, there are four main phases in Kubernetes adoption In the first phase, we create a cluster and learn intricacies of Kube API and different types of resources(e.g, Pods, Ingress, Deployments, StatefulSets, and so on). Once we are comfortable with the way Kubernetes works, we start deploying and managing our applications. By the end of this phase, we can shout look at me, I have things running in my production Kubernetes cluster, nd nothing blew up I explained most of this phase in The DevOps 2.3 Toolkit: Kubernetes The second phase is often automation. Once we become comfortable with how Kubernetes works and we are running production loads, we can move to automation. We often adopt some form of continuous delivery(CD)or continuous deployment(CDP). We create Pods with the tools we need, we build our software and container images, we run tests, and we deploy to production wh nen were finished, most of our processes are automated, and we do not perform manual deployments to Kubernetes anymore. We can say that things are working and Im not even touching my keyboard. i did my best to provide some insights into Cd and Cdp with Kubernetes in The devops 2.4 Toolkit: Continuous Deployment To Kubernetes The third phase is in many cases related to monitoring, alerting, logging, and scaling. The fact that we can run(almost) anything in Kubernetes and that it will do its best to make it fault tolerant and highly available, does not mean that our applications and clusters are bulletproof. We need to monitor the cluster and we need alerts that will notify us of potential issues when we do discover that there is a problem, we need to be able to query metrics and logs of the whole system. We can fix an issue only once we know what the root cause is In highly dynamic distributed systems like Kubernetes, that is not as easy as it looks Further on, we need to learn how to scale(and de-scale) everything. The number of Pods of an application should change over time to accommodate fluctuations in traffic and demand. Node should scale as well to fulfill the needs of our applications Kubernetes already has the tools that provide metrics and visibility into logs. It allows us to create auto-scaling rules. Yet, we might discover that Kuberentes alone is not enough and that we might need to extend our system with additional processes and tools. This phase is the subject of this book By the time you finish reading it, you'll be able to say that your clusters and applications are truly hElps: //ann. o/2GvZDjy https://amzn.to/2nkiivi Preface dynamic and resilient and that they require minimal manual involvement. We'll try to make our system self-adaptive I mentioned the fourth phase. That, dear reader, is everything else. The last phase is mostly about keeping up with all the other goodies Kubernetes provides It's about following its roadmap and adapting our processes to get the benefits of each new release Eventually, you might get stuck and will be in need of help. Or you might want to write a review or comment on the books content. Please join the DevOps20 Slack workspace and post your thoughts, ask questions, or participate in a discussion. If you prefer a more one-on-one communication, you canuseSlacktosendmeaprivatemessageorsendanemailtoviktor@farcic.com.Allthebooks i wrote are very dear to me and i want you to have a good experience reading them. Part of that experience is the option to reach out to me. Don t be shy Please note that this one, just as the previous books, is self-published. i believe that having no intermediaries between the writer and the reader is the best way to go. It allows me to write faster, update the book more frequently and have more direct communication with you. Your feedback is part of the process. No matter whether you purchased the book while only a few or all chapters were written, the idea is that it will never be truly finished. As time passes, it will require updates so that it is aligned with the change in technology or processes. When possible, I will try to keep it up to date and release updates whenever that makes sense. Eventually, things might change so much that updates are not a good option anymore, and that will be a sign that a whole new book is requir I will keep writing as long as I continue getting your support http://'slack.devops20toolkit.com Overview We'll explore some of the skills and knowledge required for operating Kubernetes clusters. We'll deal with subjects that are often not studied at the very beginning but only after we get bored with Kubernetes core features like Pod, ReplicaSets, Deployments, Ingress, PersistentVolumes, and so on. We'll master subjects we often dive into after we learn the basics and after we automate all the processes. We'll explore monitoring, alerting, logging, auto-scaling, and other subjects aimed at making our cluster resilient, self-sufficient, and self-adaptive About the author Viktor Farcic is a Principal Consultant at CloudBeesi, a member of the Docker Captains group, and author He coded using a plethora of languages starting with Pascal(yes, he is old), Basic(before it got visual prefix), ASP (before it got. Net suffix), C, C++, Perl, Python, ASP.Net, visual Basic, C#, JavaScript Java, Scala, etc. He never worked with Fortran. His current favorite is Go His big passions are containers, distributed systems, microservices, continuous delivery and deploy ment (CD)and test-driven development (tdD) He often speaks at community gatherings and conferences He wrote The devOps Toolkit Series and Test-Driven Java Development HisrandomthoughtsandtutorialscanbefoundinhisblogTechnologyConversations.com https://www.cloudbees.com/ https://www.docker.com/community/docker-captains http://www.devopstoolkitseries.com, https://www.packtpub.com/application-development/test-driven-java-development https://technologyconversations.com/ Dedication To Sara, the only person that truly matters in this world

...展开详情
试读 127P The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes
立即下载
限时抽奖 低至0.43元/次
身份认证后 购VIP低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes 38积分/C币 立即下载
1/127
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第1页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第2页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第3页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第4页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第5页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第6页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第7页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第8页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第9页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第10页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第11页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第12页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第13页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第14页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第15页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第16页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第17页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第18页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第19页
The DevOps 2.5 Toolkit: Monitoring, Logging, and Auto-Scaling Kubernetes第20页

试读结束, 可继续阅读

38积分/C币 立即下载