Skip to content

Commit

Permalink
feat(config): Add ro and rw profiles (#4487)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
ezimanyi committed Apr 2, 2020
1 parent c369b5d commit 4831979
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 22 additions & 2 deletions clouddriver-web/config/clouddriver.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
server:
port: ${services.clouddriver.port:7002}
address: ${services.clouddriver.host:localhost}
port: 7002
ssl:
enabled: false
compression:
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions halconfig/clouddriver.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# halconfig

server:
port: ${services.clouddriver.port:7002}
address: ${services.clouddriver.host:localhost}

0 comments on commit 4831979

Please sign in to comment.