Skip to content

Commit

Permalink
Migrate from elasticseach to opensearch
Browse files Browse the repository at this point in the history
Elasticsearch service will be withdrawn from PaaS and replaced with opensearch.
  • Loading branch information
kentsanggds committed Mar 17, 2022
1 parent f5ff954 commit 49d7735
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- uses: getong/elasticsearch-action@v1.2
- uses: ankane/setup-opensearch@v1
with:
elasticsearch version: '7.6.1'
opensearch-version: 1.2
host port: 9200
container port: 9200
host node port: 9300
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Application < Rails::Application
config.filter_parameters << :password
config.filter_parameters << :password_confirmation

config.elasticsearch = config_for(:elasticsearch)
config.elasticsearch = config_for(:opensearch)

config.ssl_options = { hsts: { expires: 1.week } }

Expand Down
4 changes: 2 additions & 2 deletions config/initializers/elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

if host.blank?
vcap = JSON.parse(es_config[:vcap_services])
host = vcap.dig("elasticsearch", 0, "credentials", "uri")
host = vcap.dig("opensearch", 0, "credentials", "uri")
end

raise StandardError, "No elasticsearch environment variables found" if host.blank?
raise StandardError, "No opensearch environment variables found" if host.blank?

Elasticsearch::Model.client = Elasticsearch::Client.new(
host: host,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion integration-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ applications:
GOVUK_WEBSITE_ROOT: https://www.gov.uk
services:
- find-integration-secrets
- elasticsearch-7-integration
- opensearch-integration
- logit-ssl-drain
2 changes: 1 addition & 1 deletion production-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ applications:
GOVUK_WEBSITE_ROOT: https://www.gov.uk
services:
- find-production-secrets
- elasticsearch-7-production
- opensearch-production
- logit-ssl-drain
2 changes: 1 addition & 1 deletion staging-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ applications:
GOVUK_WEBSITE_ROOT: https://www.gov.uk
services:
- find-staging-secrets
- elasticsearch-7-staging
- opensearch-staging
- logit-ssl-drain

0 comments on commit 49d7735

Please sign in to comment.