Apollo configuration center architecture¶
Apollo is a distributed configuration center designed to centrally manage the application configuration of microservices^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md]. It serves as a reliable platform for decoupling configuration from application deployments, allowing for centralized management, version control, and dynamic updates without requiring service restarts^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
System Architecture¶
The Apollo architecture is composed of several core components that interact to provide configuration services. It supports a multi-environment deployment model (e.g., FAT for testing, PRO for production) while maintaining a unified management interface^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
Core Components¶
The system primarily consists of ConfigService, AdminService, Portal, and the Client^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
- ConfigService: This module acts as the configuration provider for client applications^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md]. It employs a "push-pull" mechanism to interact with the Client, ensuring that clients receive the latest configuration updates in real-time^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
- AdminService: This service handles the management and modification of configurations^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md]. It receives update requests from the Portal and persists the changes to the ConfigDB^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
- Portal: The Portal serves as the web-based management interface (UI) for Apollo^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md]. Users utilize the Portal to modify configurations, which are then synchronized to the ConfigDB via the AdminService^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md]. It is capable of managing multiple distinct environments (e.g., Test, Production) through a single instance^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
- Client: The client SDK is embedded within applications^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md]. It is responsible for retrieving configurations from ConfigService and keeping the local runtime configuration in sync with the server state^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
- ConfigDB: This is the persistence layer (database) used by the ConfigService and AdminService to store configuration data^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
Data Flow¶
The configuration update flow follows a specific sequence: changes are initiated through the Portal, which calls the AdminService to update records in the ConfigDB^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md]. The ConfigService then reads the updated configuration from the database and delivers it to the Client applications^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
Deployment Model¶
Apollo's architecture is designed to support multiple environments, such as Development, Test, and Production, often referred to as dev, fat, and pro^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
- Environment Isolation: Each environment typically requires its own independent instances of ConfigService and AdminService, as well as a dedicated database (e.g.,
ApolloConfigTestDBvs.ApolloConfigProdDB)^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md]. - Unified Management: Despite the isolation of backend services, a single Apollo Portal instance can manage these multiple environments^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md]. The Portal uses configuration files (like
apollo-env.properties) to define the Meta Service addresses (ConfigService URLs) for each supported environment^[400-devops__06-Kubernetes__k8s-paas__06.在K8S中集成Apollo配置中心.md].
Sources¶
Related Concepts¶
- [[Microservices]]
- Kubernetes
- [[Continuous Delivery]]
- [[Service Discovery]]