This model is not much different from traditional non-Kubernetes deployments. As shown in the picture below, Nacos or Zookeeper is still used as the registry, but Kubernetes is used as the underlying platform for application lifecycle scheduling.
In Kubernetes mode, we recommend using dubboctl
to quickly install components like Nacos, dubbo-control-plane, prometheus, etc.:
We still take the project in Quick Start as an example to demonstrate the specific steps for packaging and deploying the application.
First, clone the sample project locally:
Switch to the example directory:
Here are the generated complete Kubernetes manifests:
Run the following command to deploy the application to the Kubernetes cluster:
If you have previously installed dubbo-control-plane using dubboctl
, you can check the service deployment status as follows:
Access http://xxx
to view the service deployment details.
As shown in the architecture diagram above, we still use Nacos as the registry. Therefore, similar to traditional Linux deployment models, the timing of publishing instances to the registry and removing instances from the registry is key to achieving graceful online/offline:
prestop
to ensure instance registration information is removed from the registry first, before proceeding to the process destruction phase.Example configuration for gracefully offline removing instances: