Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Effortless Cloud-Native App Development Using Skaffold

You're reading from   Effortless Cloud-Native App Development Using Skaffold Simplify the development and deployment of cloud-native Spring Boot applications on Kubernetes with Skaffold

Arrow left icon
Product type Paperback
Published in Oct 2021
Publisher Packt
ISBN-13 9781801077118
Length 272 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Ashish Choudhary Ashish Choudhary
Author Profile Icon Ashish Choudhary
Ashish Choudhary
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Section 1: The Kubernetes Nightmare – Skaffold to the Rescue
2. Chapter 1: Code, Build, Test, and Repeat – The Application Development Inner Loop FREE CHAPTER 3. Chapter 2: Developing Cloud-Native Applications with Kubernetes – A Developer's Nightmare 4. Chapter 3: Skaffold — Easy-Peasy Cloud-Native Kubernetes Application Development 5. Section 2: Getting Started with Skaffold
6. Chapter 4: Understanding Skaffold's Features and Architecture 7. Chapter 5: Installing Skaffold and Demystifying Its Pipeline Stages 8. Chapter 6: Working with Skaffold Container Image Builders and Deployers 9. Section 3: Building and Deploying Cloud-Native Spring Boot Applications with Skaffold
10. Chapter 7: Building and Deploying a Spring Boot Application with the Cloud Code Plugin 11. Chapter 8: Deploying a Spring Boot Application to the Google Kubernetes Engine Using Skaffold 12. Chapter 9: Creating a Production-Ready CI/CD Pipeline with Skaffold 13. Chapter 10: Exploring Skaffold Alternatives, Best Practices, and Pitfalls 14. Other Books You May Enjoy

Checking out the container-native application development inner loop

Kubernetes and containers have introduced a new set of challenges and complexities to the inner development loop. Now there are an additional set of steps added to the inner loop while developing applications, which is time-consuming. A developer would prefer to spend time solving business problems rather than waiting for the build process to complete.

It involves steps such as the following:

  1. A developer making code changes in an IDE
  2. Building and packaging the application
  3. Creating a container image
  4. Pushing the image to a container registry
  5. Kubernetes pulling the image from the registry
  6. Kubernetes creating and deploying the pod
  7. Finally, testing and repeating

Engineers at Google call this an infinite loop of pain and suffering. Here is a visualization of the container-native application development inner loop:

Figure 1.9 – Container-native application development inner loop

Figure 1.9 – Container-native application development inner loop

As you can see, we now have three more steps added to the inner development loop, that is, creating a container image of your application, pushing it to a container registry, and finally, pulling the image while deploying to a container orchestration tool such as Kubernetes.

The container image could be a Docker or OCI format image, depending on the tool you use to build your images. You have options such as Docker Hub, AWS Container Registry, Google Container Registry, or Azure Container Registry for the container registry. Then, finally, in deployment, for your container orchestration, you have tools such as Kubernetes, which will first pull the image from the container registry and deploy your application.

There are many manual steps involved here. It also depends on what tools you have used for the local development workflow. For instance, you will use commands such as the following:

docker build 
docker tag
docker push 
kubectl apply

The following are the detailed steps that a developer has to go through while developing container-native applications:

  1. Defining how to configure the OS for your container with a Dockerfile
  2. Defining the packaging of your application into a container image by adding instructions to the Dockerfile
  3. Creating a container image with Docker commands such as docker build and docker tag
  4. Uploading the container image to a container registry with a command such as docker push
  5. Writing one or more Kubernetes resource files in YAML
  6. Deploying your application to the cluster with commands such as kubectl apply -f myapp.yaml
  7. Deploying services to the cluster with commands such as kubectl apply -f mysvc.yaml
  8. Writing the config so that apps can work together with commands such as kubectl create configmap
  9. Configuring apps to work together correctly with commands such as kubectl apply -f myappconfigmap.yaml

Wooh!!! That's a lot of steps and a time-consuming process. You can use scripting or docker compose to automate it to some extent, but soon you will realize that it cannot be fully automated without a tool such as Skaffold, which can abstract away many things related to building and deployment.

In Chapter 3, Skaffold – Easy-Peasy Cloud-Native Kubernetes Application Development, we will cover Skaffold, which simplifies the process we have covered here with a single command. My only intention here was to give you an idea of the steps involved. We will cover these steps with some hands-on examples in the next chapter.

You have been reading a chapter from
Effortless Cloud-Native App Development Using Skaffold
Published in: Oct 2021
Publisher: Packt
ISBN-13: 9781801077118
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image