Book Image

Introduction to DevOps with Kubernetes

By : Onur Yılmaz, Süleyman Akba≈ü
Book Image

Introduction to DevOps with Kubernetes

By: Onur Yılmaz, Süleyman Akba≈ü

Overview of this book

Kubernetes and DevOps are the two pillars that can keep your business at the top by ensuring high performance of your IT infrastructure. Introduction to DevOps with Kubernetes will help you develop the skills you need to improve your DevOps with the power of Kubernetes. The book begins with an overview of Kubernetes primitives and DevOps concepts. You'll understand how Kubernetes can assist you with overcoming a wide range of real-world operation challenges. You will get to grips with creating and upgrading a cluster, and then learn how to deploy, update, and scale an application on Kubernetes. As you advance through the chapters, you’ll be able to monitor an application by setting up a pod failure alert on Prometheus. The book will also guide you in configuring Alertmanager to send alerts to the Slack channel and trace down a problem on the application using kubectl commands. By the end of this book, you’ll be able to manage the lifecycle of simple to complex applications on Kubernetes with confidence.
Table of Contents (11 chapters)

Chapter 7: Updating and Scaling an Application in Kubernetes

Activity 8: Enabling Autoscaling and Performing a Rolling Update


Perform the following steps to complete this activity:

  1. Create a deployment definition file that uses the suakbas/lesson07:v1 image and has the RollingUpdate strategy type set; this application does a CPU-intensive operation:
    apiVersion: apps/v1
    kind: Deployment
      name: lesson07-deployment
      replicas: 1
        type: RollingUpdate
          app: lesson07
            app: lesson07
          - image: suakbas/lesson07:v1
            imagePullPolicy: Always
            name: lesson07
                memory: "500m"
                cpu: "250m"
  2. Deploy the deployment and check whether the pod is running:
    $ kubectl apply -f deployment.yaml -n lesson-7
    $ kubectl get pods -n lesson-7
    Figure 7.21...