THREESCALE-12448 - Add configuration option to enable openshift deterministically#580
THREESCALE-12448 - Add configuration option to enable openshift deterministically#580urbanikb wants to merge 1 commit into3scale:masterfrom
Conversation
config/openshift.yml
Outdated
There was a problem hiding this comment.
| enabled: true |
There was a problem hiding this comment.
Hm, I am wondering, can what if we drop this config file, and in the place were currently Rails.application.config.x.openshift.enabled is used we use Rails.application.config.integrations.kubernetes instead? Because it kind of seems strange that we have two different configs for enabling/disabling the same integration (well, assuming they are the same).
If for some reason we need to keep this openshift.yml file, I would hardcode enabled: true just for the production environment, and keep false for dev and test.
But I'd prefer to get rid of it.
There was a problem hiding this comment.
This is the openshift connection configuration kind of and the other file is ability to select which integrations are enabled. Given Zync's purpose was to have many integrations over time, it makes some sense.
But if we don't support any actual openshift configuration, we can as well remove openshift.yml as needless.
I suggest though to for now hardcode true here and go about removing this separately if we want. Nice catch that we want false for development as well!
Current code uses service discovery env var. Adding new SYSTEM_PROVIDER_URL that can be set to route requests internally when not using service discovery links.
6f34c80 to
26fe871
Compare
| # | ||
| # SYSTEM_PROVIDER_URL - explicit URL set by the operator (e.g. http://system-provider:3000) | ||
| # SYSTEM_PROVIDER_PORT - legacy: injected by Kubernetes service discovery | ||
| if (system_provider_url = (ENV['SYSTEM_PROVIDER_URL'] || ENV['SYSTEM_PROVIDER_PORT']).presence) |
There was a problem hiding this comment.
Boris: if we run in kubernetes, then maybe hardcode the DNS name, otherwise use the host from the message
This is needed by THREESCALE-12448 to enable the openshift integration mode even if the services don't exist yet.
Verification
Tested locally to verify that route can be created even if service does not exist. This was done by commenting the apicast routes and developer services - there are 2 services necessary to exist for the startup - the sidekiq requires system-master to be up and zync requires system-provider to be up (it communicates with it - see
zync/app/adapters/three_scale/api/instrumented_http_client.rb
Line 11 in a852c44
Routes have been created successfully even for apicast and developer portal:
After startup with services commented out the developer portal shows maintenance page:
.
The page starts to serve the developer portal once the service is created later without any action needed on Zync end.