Environment-separated configuration management¶
Environment-separated configuration management is a practice in DevOps that isolates application configurations based on the deployment lifecycle stage, such as testing (fat) and production (pro).^[400-devops-06-kubernetes-k8s-paas-06k8sapollo.md] This approach ensures that applications utilize distinct database instances and service endpoints appropriate to their specific environment, thereby preventing configuration cross-contamination.^[400-devops-06-kubernetes-k8s-paas-06k8sapollo.md]
Core Implementation¶
Implementing this strategy typically involves dedicating specific backend resources to each environment. For example, separate database instances may be created for configuration storage, such as ApolloConfigTestDB for the test environment and ApolloConfigProdDB for production.^[400-devops-06-kubernetes-k8s-paas-06k8sapollo.md] Similarly, network routing is segregated through distinct domain names; services may be exposed via specific hostnames like config-test.od.com and config-prod.od.com to direct traffic to the correct infrastructure.^[400-devops-06-kubernetes-k8s-paas-06k8sapollo.md]
Orchestration Support¶
Container orchestration platforms like Kubernetes provide native support for this separation through Namespaces, which allow logical isolation of resources within the same cluster.^[400-devops-06-kubernetes-k8s-paas-06k8sapollo.md] Applications are deployed with environment-specific variables to ensure they connect to the correct configuration services; for instance, a container might be initialized with the flag -Denv=fat to direct it to the test environment's meta-server.^[400-devops-06-kubernetes-k8s-paas-06k8sapollo.md] For tighter integration within the same namespace, internal service names (e.g., http://apollo-configservice:8080) can be used instead of public DNS records.^[400-devops-06-kubernetes-k8s-paas-06k8sapollo.md]
Related Concepts¶
- [[Configuration Center]]
- [[Continuous Delivery]]
- Blue-green deployment
Sources¶
- 400-devops-06-kubernetes-k8s-paas-06k8sapollo.md