From 4831979f725312aaa1c84d268ceb0af46b8e3445 Mon Sep 17 00:00:00 2001 From: Eric Zimanyi Date: Thu, 2 Apr 2020 17:31:17 -0400 Subject: [PATCH] feat(config): Add ro and rw profiles (#4487) * refactor(core): Move some things back to halyard config In a recent PR I moved the server.port and server.address settings into the base config to reduce what's in the Halyard config. After further reflection, we don't want these to be overridable easily in kleat anyway as I don't think there's a common use case for this. (And in any case, it's easier to override this by just overriding these in the clouddriver-local.yml than to need to go through the services.* settings in spinnaker.yml.) So let's avoid bringing these settings along for the ride, and just leave them in the halconfig where they will still help halyard users. This restores this block of clouddriver.yml to what it was before the recent change. * feat(config): Add ro and rw profiles In order to make it easier to configure HA deployments, add profiles to support the following: * A read-only deployment that does not run caching agents, and can connect to a read-only backing store. * A read-write deployment that does not run caching agents, but connects to a writeable backing store so that it can serve mutating requests from other microservices. * fix(config): Remove default from redis-ro Change redis-ro to redisRo to match the casing in the rest of spinnaker.yml. (I don't want to take on the project of updating that file to kebab case right now.) Also remove the default; we're going to require that redisRo be defined in spinnaker.yml if you're running HA (even if it just points to the regular redis). Maybe later we'll deafult it, but it's safer to add a default later than to remove one later. --- clouddriver-web/config/clouddriver.yml | 24 ++++++++++++++++++++++-- halconfig/clouddriver.yml | 4 ++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/clouddriver-web/config/clouddriver.yml b/clouddriver-web/config/clouddriver.yml index 971a4760a05..003687ed5b3 100644 --- a/clouddriver-web/config/clouddriver.yml +++ b/clouddriver-web/config/clouddriver.yml @@ -1,6 +1,5 @@ server: - port: ${services.clouddriver.port:7002} - address: ${services.clouddriver.host:localhost} + port: 7002 ssl: enabled: false compression: @@ -343,3 +342,24 @@ spring: # port: 22 # proxyRegion: us-west-1 # proxyCluster: my-credentials-cluster + +--- +# This profile is used in HA deployments for a clouddriver that handles read-only requests from +# other services +spring: + profiles: ro + +redis: + connection: ${services.redisRo.baseUrl} + +caching: + writeEnabled: false + +--- +# This profile is used in HA deployments for a clouddriver that handles mutating requests from +# other services, but does not run caching agents +spring: + profiles: rw + +caching: + writeEnabled: false diff --git a/halconfig/clouddriver.yml b/halconfig/clouddriver.yml index e745afa924f..b3a29fc92c8 100644 --- a/halconfig/clouddriver.yml +++ b/halconfig/clouddriver.yml @@ -1 +1,5 @@ # halconfig + +server: + port: ${services.clouddriver.port:7002} + address: ${services.clouddriver.host:localhost}