From 9c8c16d042ccc933dddd9a1311ad785a7568e8c5 Mon Sep 17 00:00:00 2001 From: Alan Moran Date: Wed, 14 Aug 2024 11:00:02 +0200 Subject: [PATCH] Adds route registrar to postgres --- ci/autoscaler/pipeline.yml | 2 - ci/autoscaler/set-pipeline.sh | 1 - operations/disable-postgres-tls-config.yml | 71 ---------------------- operations/enable-nats-tls.yml | 17 ++++++ templates/app-autoscaler.yml | 14 +++++ 5 files changed, 31 insertions(+), 74 deletions(-) delete mode 100644 operations/disable-postgres-tls-config.yml diff --git a/ci/autoscaler/pipeline.yml b/ci/autoscaler/pipeline.yml index e1ba1bf6ac..745a92d2de 100644 --- a/ci/autoscaler/pipeline.yml +++ b/ci/autoscaler/pipeline.yml @@ -31,10 +31,8 @@ anchors: operations/set-release-version.yml operations/enable-metricsforwarder-via-syslog-agent.yml operations/enable-scheduler-logging.yml - operations/disable-postgres-tls-config.yml operations/use-cf-services.yml - app-autoscaler-ops-files-upgrade: &app-autoscaler-ops-files-upgrade OPS_FILES: | operations/add-releases.yml diff --git a/ci/autoscaler/set-pipeline.sh b/ci/autoscaler/set-pipeline.sh index f8567f688f..0a999f4dcf 100755 --- a/ci/autoscaler/set-pipeline.sh +++ b/ci/autoscaler/set-pipeline.sh @@ -83,7 +83,6 @@ function main(){ export PIPELINE_NAME="app-autoscaler-release-${current_branch_without_slashes}" set_pipeline "$PIPELINE_NAME" pause_jobs "$PIPELINE_NAME" - unpause_job "$PIPELINE_NAME/set-pipeline" fi popd > /dev/null diff --git a/operations/disable-postgres-tls-config.yml b/operations/disable-postgres-tls-config.yml deleted file mode 100644 index 2544303d58..0000000000 --- a/operations/disable-postgres-tls-config.yml +++ /dev/null @@ -1,71 +0,0 @@ -- type: remove - path: /instance_groups/name=postgres/jobs/name=postgres/properties/databases/tls - -- type: replace - path: /instance_groups/name=postgres/jobs/name=postgres/properties/databases/sslmode - value: disable - -- type: replace - path: /instance_groups/name=metricsforwarder/jobs/name=metricsforwarder/properties/autoscaler/policy_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=metricsforwarder/jobs/name=metricsforwarder/properties/autoscaler/storedprocedure_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=scalingengine/jobs/name=scalingengine/properties/autoscaler/policy_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=scalingengine/jobs/name=scalingengine/properties/autoscaler/scalingengine_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=scalingengine/jobs/name=scalingengine/properties/autoscaler/scheduler_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=apiserver/jobs/name=golangapiserver/properties/autoscaler/policy_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=apiserver/jobs/name=golangapiserver/properties/autoscaler/binding_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=scheduler/jobs/name=scheduler/properties/autoscaler/policy_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=scheduler/jobs/name=scheduler/properties/autoscaler/scheduler_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=operator/jobs/name=operator/properties/autoscaler/appmetrics_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=operator/jobs/name=operator/properties/autoscaler/lock_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=operator/jobs/name=operator/properties/autoscaler/policy_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=operator/jobs/name=operator/properties/autoscaler/scalingengine_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=eventgenerator/jobs/name=eventgenerator/properties/autoscaler/policy_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=eventgenerator/jobs/name=eventgenerator/properties/autoscaler/appmetrics_db/sslmode - value: disable - -- type: replace - path: /instance_groups/name=eventgenerator/jobs/name=eventgenerator/properties/autoscaler/lock_db/sslmode - value: disable - diff --git a/operations/enable-nats-tls.yml b/operations/enable-nats-tls.yml index 367f2f0e71..3f3e98f9ab 100644 --- a/operations/enable-nats-tls.yml +++ b/operations/enable-nats-tls.yml @@ -108,3 +108,20 @@ value: from: nats-tls deployment: cf + +- type: replace + path: /instance_groups/name=postgres/jobs/name=route_registrar/properties/nats? + value: + tls: + enabled: true + client_cert: ((/bosh-autoscaler/cf/nats_client_cert.certificate)) + client_key: ((/bosh-autoscaler/cf/nats_client_cert.private_key)) + +- type: remove + path: /instance_groups/name=postgres/jobs/name=route_registrar/consumes/nats + +- type: replace + path: /instance_groups/name=postgres/jobs/name=route_registrar/consumes/nats-tls? + value: + from: nats-tls + deployment: cf diff --git a/templates/app-autoscaler.yml b/templates/app-autoscaler.yml index fc72485f0f..ebac72fda0 100644 --- a/templates/app-autoscaler.yml +++ b/templates/app-autoscaler.yml @@ -163,6 +163,20 @@ instance_groups: max_open_connections: 100 max_idle_connections: 10 connection_max_lifetime: 60s + - name: route_registrar + release: routing + consumes: + nats: { from: nats, deployment: cf } + properties: + route_registrar: + routes: + - name: autoscaler_postgres + registration_interval: 20s + port: 5432 + tags: + component: autoscaler_postgres + uris: + - ((deployment_name))-postgres.((system_domain)) # Scalingengine Instance Group - name: scalingengine