Cloud-Based Practices for Spring Cloud Applications in Kubernetes: Development

Image for post
Image for post

By Guyi, Alibaba Cloud Senior Technical Expert, focusing on EDAS development and user experience optimization


To embrace this trend, our Enterprise Distributed Application Service (EDAS) team has also focused on this typical scenario and optimized developer experiences in different stages, such as development, testing, deployment, joint debugging, and online O&M. This is represented in the latest release of version 3.0. Our team has provided developers with the best practices for using EDAS for applications that use the combined architecture of Spring Cloud and Kubernetes.

This is the first article of a series. In this article, we will focus on development.

Initialize Projects

When developers have more choices, they also have some worries. Which version should I use? How can I select dependent services? How can I address the conflicts between public components? To solve these problems, Alibaba Cloud launched a project initialization tool last year, as shown in the following figure.

Image for post
Image for post

On this page, we provide a tool with a graphical user interface (GUI) for generating Java applications that are not limited to Spring Cloud applications. For a simple Spring Cloud application, you only have to select one dependency, which is the Nacos Service Discovery component in the Spring Cloud Alibaba section. After you select Nacos Service Discovery, click the orange button that says Generate. The tool will automatically generate a pom.xml file that can be directly packed and run. At the same time, the tool will pack all the content into a standard Java project package for you to download.

Run an Application Locally

Image for post
Image for post

You can select an appropriate registry based on the needs of you and your team. For example, you can select Use Local Registry (for individuals), Join Custom Registry (for teams), or a cloud-based Nacos cluster (for joint debugging with cloud services.) After you select the registry, you can follow the normal procedures to start your application in the IDE. Then, the application will be automatically adapted to the selected registry, which is completely maintenance-free. Therefore, you do not have to build a registry.

What is coming up next? We will specifically explain the interconnection between on-premises and off-premises applications in EDAS in a future article.

Summary and What to Do Next

As one of a series of articles, this article introduces the preceding two scenarios and does not include any topics about Kubernetes. We will provide more Kubernetes-related content in future articles. The next article will focus on deploying applications to the cloud.

Original Source:

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store