aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • Engineering

Develop And Debug Kubernetes Microservice Applications Fast With Cloud Code And Skaffold Modules

  • aster.cloud
  • January 27, 2022
  • 5 minute read

Microservice applications are popular, and for good reason. They offer flexibility over monolithic applications, and superior scalability when containerized and deployed to Kubernetes. To be functional, a microservice application must run all its services.

Issues arise when you want to build your application as a whole for your CI/CD pipeline and still be able to develop a subset of microservices. This is where Skaffold modules help.


Partner with aster.cloud
for your next big idea.
Let us know here.



From our partners:

CITI.IO :: Business. Institutions. Society. Global Political Economy.
CYBERPOGO.COM :: For the Arts, Sciences, and Technology.
DADAHACKS.COM :: Parenting For The Rest Of Us.
ZEDISTA.COM :: Entertainment. Sports. Culture. Escape.
TAKUMAKU.COM :: For The Hearth And Home.
ASTER.CLOUD :: From The Cloud And Beyond.
LIWAIWAI.COM :: Intelligence, Inside and Outside.
GLOBALCLOUDPLATFORMS.COM :: For The World's Computing Needs.
FIREGULAMAN.COM :: For The Fire In The Belly Of The Coder.
ASTERCASTER.COM :: Supra Astra. Beyond The Stars.
BARTDAY.COM :: Prosperity For Everyone.

Skaffold modules give microservice developers the ability to build and deploy parts of their applications separately. This results in an efficient development flow that enables:

  • Iterating on and debugging a subset of microservices
  • Cross-boundary microservice debugging
  • Reduced build time and faster iterations when using remote dependencies and prebuilt artifacts

Skaffold is a command line tool that facilitates continuous development for Cloud Native applications. Skaffold handles the workflow for building, pushing, and deploying your application, and provides building blocks for creating CI/CD pipelines.

To support iterative microservice development for Skaffold users using IDEs, module support was recently added to Cloud Code. Cloud Code is Google Cloud’s IDE plugin for IntelliJ and Visual Studio Code. With Cloud Code, we’re bringing Skaffold to where you’re at; developing locally in your favorite IDE.

This post walks through how to develop and debug a sample microservice application with Skaffold modules from your IDE. We’ll also take a look at how to add Skaffold modules support to your own application.

Develop and debug microservices separately

Let’s see Skaffold modules in action with the IntelliJ version of Cloud Code. We’ll try Skaffold modules with Cloud Code’s Guestbook sample. The Guestbook sample is a simple microservice application that’s available in Node.js, Java, Python, and Go.

If you’re a Visual Studio Code user, install Cloud Code and check out our documentation for creating a sample Kubernetes app and configuring modules.

Read More  Mapping Carbon Pollution Globally With Satellites

Before you begin

1. Install the Cloud Code plugin for JetBrains IDEs.

2. Create a new Cloud Code project by opening IntelliJ and navigating to File > New > Project… > Cloud Code: Kubernetes > Java: Guestbook.

 

3. Click Next and finish creating the project.

Run the application

The Java Guestbook sample has a frontend and backend microservice. As you would expect, the frontend microservice provides the UI, while the backend stores and serves records from a database. For more details about the guestbook sample application, open the sample’s README.md file.

First, edit the “Develop on Kubernetes” configuration. Under the Run tab, either select an existing Kubernetes cluster or “Deploy locally to a minikube cluster” to spin up a minikube cluster for free.

 

 

Now let’s deploy the full Guestbook application by running the “Develop on Kubernetes” configuration.

 

Cloud Code now builds the Guestbook sample application, packages it into containers, and deploys to the current Kubernetes cluster configured on your machine. The Run tool window looks similar to the following once the application is deployed. Clicking each step narrows the scope of the displayed logs, allowing you to focus on a specific container.

 

Open the Service URLs tab to access the port-forwarded application endpoints locally. You can test that the application is working by clicking the java-guestbook-frontend URL.

Once you’ve confirmed the application works, click the stop button. Cloud Code stops the application and cleans up the deployment in your cluster.

Run a single microservice

You’ve probably noticed that it takes a while to deploy this entire application. Now imagine having to deploy a much larger application with over a dozen microservices when you only want to develop one! This is where Cloud Code and Skaffold modules come into play.

Let’s edit the “Develop on Kubernetes” run configuration and select the Build/Deploy tab:

Read More  Protecting Customers Against Cryptomining Threats With VM Threat Detection In Security Command Center

 

Here you can see all the microservices of the application. For a microservice to appear in this list, it needs to be defined as a Skaffold module in your skaffold.yaml file. skaffold.yaml provides specifications for an application’s workflow. This sample has already done that.

Let’s build and deploy the “frontend” microservice.

 

Click OK and run “Develop on Kubernetes” again. This time Cloud Code only builds and deploys the frontend microservice.

 

Without the backend microservice, the frontend is just a UI view with no data. Deploying just the frontend allows testing that the frontend fails gracefully when the backend is unavailable.

More than likely your microservice development and debugging happens in a shared development cluster, where a backend team deploys their microservice that’s available for your frontend to interact with. This way, the backend and the frontend teams can develop a larger application independently while using the power of Cloud Code IDEs.

With Skaffold modules, backend and frontend code can live in either the same or separate repositories. Microservices can then be built together with a root skaffold.yaml file when all modules are selected. Each team can then work on their part by developing their module. See our documentation for more info on common Skaffold module use cases.

The larger your application and the more independent microservices it has, the more productive this workflow becomes.

Debug a microservice

Debugging your microservices is almost the same process as running them in your remote Kubernetes cluster. Run the “Develop on Kubernetes” configuration in debug mode.

 

Cloud Code ensures the container and application inside it run in debug mode and connects them to the IDE.

Now set breakpoints as if you are running locally and step through your application running in your remote cluster! You can find more details about debugging here.

Read More  Unify Data Lakes And Warehouses With BigLake, Now Generally Available

Configure Skaffold modules for your application

The Guestbook sample shows one way to use Skaffold modules with a very simple microservice application. If you’re working on a small microservice application, reference the Guestbook sample’s root skaffold.yaml. It provides a great starting point on how to structure your Skaffold configuration file.

 

apiVersion: skaffold/v2beta18
kind: Config
requires:
 - path: ./frontend
 - path: ./backend

 

This root configuration lists all the microservices of the application. Each microservice has its own Skaffold configuration that defines how to build and deploy it to Kubernetes. This sample has two Skaffold configurations for the frontend and backend.

You could provide alternative root configurations, such as a local development root that configures the backend with a local MySQL or PostgreSQL instance, or that activates specific Skaffold profiles.

To see Skaffold modules implemented in a larger example, see the Bank of Anthos application. It has 5+ larger microservices configured as Skaffold modules and is fully supported by Cloud Code IDEs. This is a great example of a large application that can be developed with Cloud Code and deployed with Cloud Deploy using the same Skaffold configuration.

Check out the Skaffold documentation to learn more about configuring Skaffold modules.

Next steps

We encourage you to try configuring your microservice project with Skaffold modules to experience the power and productivity of Skaffold and Cloud Code.

If you need help, join our GCP Community Slack Channel, #cloud-code, to connect with the community and ask questions.

To learn more about how Skaffold and Cloud Code work together, see Kubernetes development, simplified—Skaffold is now GA.

 

 

By: Ivan Portyankin (Software Engineer) and Abby Carey (Developer Advocate)
Source: Google Cloud Blog


For enquiries, product placements, sponsorships, and collaborations, connect with us at [email protected]. We'd love to hear from you!

Our humans need coffee too! Your support is highly appreciated, thank you!

aster.cloud

Related Topics
  • Cloud Code
  • Command Line
  • Containers
  • Google Cloud
  • Jetbrains
  • Kubernetes
  • Skaffold
You May Also Like
View Post
  • Engineering
  • Technology

Apple supercharges its tools and technologies for developers to foster creativity, innovation, and design

  • June 9, 2025
View Post
  • Engineering

Just make it scale: An Aurora DSQL story

  • May 29, 2025
View Post
  • Engineering
  • Technology

Guide: Our top four AI Hypercomputer use cases, reference architectures and tutorials

  • March 9, 2025
View Post
  • Computing
  • Engineering

Why a decades old architecture decision is impeding the power of AI computing

  • February 19, 2025
View Post
  • Engineering
  • Software Engineering

This Month in Julia World

  • January 17, 2025
View Post
  • Engineering
  • Software Engineering

Google Summer of Code 2025 is here!

  • January 17, 2025
View Post
  • Data
  • Engineering

Hiding in Plain Site: Attackers Sneaking Malware into Images on Websites

  • January 16, 2025
View Post
  • Computing
  • Design
  • Engineering
  • Technology

Here’s why it’s important to build long-term cryptographic resilience

  • December 24, 2024

Stay Connected!
LATEST
  • 1
    Pure Accelerate 2025: All the news and updates live from Las Vegas
    • June 18, 2025
  • 2
    ‘This was a very purposeful strategy’: Pure Storage unveils Enterprise Data Cloud in bid to unify data storage, management
    • June 18, 2025
  • What is cloud bursting?
    • June 18, 2025
  • 4
    There’s a ‘cloud reset’ underway, and VMware Cloud Foundation 9.0 is a chance for Broadcom to pounce on it
    • June 17, 2025
  • What is confidential computing?
    • June 17, 2025
  • Oracle adds xAI Grok models to OCI
    • June 17, 2025
  • Fine-tune your storage-as-a-service approach
    • June 16, 2025
  • 8
    Advanced audio dialog and generation with Gemini 2.5
    • June 15, 2025
  • 9
    A Father’s Day Gift for Every Pop and Papa
    • June 13, 2025
  • 10
    Global cloud spending might be booming, but AWS is trailing Microsoft and Google
    • June 13, 2025
about
Hello World!

We are aster.cloud. We’re created by programmers for programmers.

Our site aims to provide guides, programming tips, reviews, and interesting materials for tech people and those who want to learn in general.

We would like to hear from you.

If you have any feedback, enquiries, or sponsorship request, kindly reach out to us at:

[email protected]
Most Popular
  • Google Cloud, Cloudflare struck by widespread outages
    • June 12, 2025
  • What is PC as a service (PCaaS)?
    • June 12, 2025
  • 3
    Crayon targets mid-market gains with expanded Google Cloud partnership
    • June 10, 2025
  • By the numbers: Use AI to fill the IT skills gap
    • June 11, 2025
  • 5
    Apple services deliver powerful features and intelligent updates to users this autumn
    • June 11, 2025
  • /
  • Technology
  • Tools
  • About
  • Contact Us

Input your search keywords and press Enter.