Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Allow to specify configuration to be used in upgrade mode #2127

Closed
8 of 11 tasks
to-bar opened this issue Mar 12, 2021 · 4 comments
Closed
8 of 11 tasks
Assignees
Labels
area/logs priority/medium Task with medium priority

Comments

@to-bar
Copy link
Contributor

to-bar commented Mar 12, 2021

Is your feature request related to a problem? Please describe.
Sometimes upgrade process requires additional settings. For example, when upgraded component has new configurable functionality (such as AdminServer in ZooKeeper) we want to be able to specify non-default configuration, like port number.
Another use case is accessing APIs, when credentials are needed for authentication (e.g., upgrading ODFE).

Describe the solution you'd like
Add support for -f flag the same way as we have for epicli apply.
Config file should be compatible for both modes (apply and upgrade) - the same structure.

Describe alternatives you've considered
Providing properties via command line options or dedicated config file (simpler structure).

Additional context
Currently we have in docs inconvenient workaround:

... before starting the upgrade please make sure that you provided correct credentials ...
Both are accessible via the defaults of opendistro_for_elasticsearch role (/usr/local/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/defaults/main.yml).


DoD checklist

  • Changelog updated
  • COMPONENTS.md updated / doesn't need to be updated
  • Feature has automated tests
  • Automated tests passed (QA pipelines)
    • apply
    • upgrade
  • Idempotency tested
  • Documentation added / updated / doesn't need to be updated
  • All conversations in PR resolved
  • Solution meets requirements and is done according to design doc
  • Usage compliant with license
@to-bar to-bar added this to the S20210325 milestone Mar 12, 2021
@mkyc mkyc added priority/medium Task with medium priority and removed priority/high Task with high priority labels Mar 12, 2021
@mkyc
Copy link
Contributor

mkyc commented Mar 18, 2021

I guess test process would be following:

  • create config file for new cluster in version V-1
  • deploy cluster in V-1
  • read documentation about upgrade to version V
  • add new configuration values to existing config file
  • run upgrade -f with this file

Is that correct @to-bar

@to-bar
Copy link
Contributor Author

to-bar commented Mar 18, 2021

Yes, that's the planned flow.

@mkyc mkyc removed this from the S20210715 milestone Jul 5, 2021
@przemyslavic przemyslavic self-assigned this Jul 9, 2021
@przemyslavic
Copy link
Collaborator

The following scenario was tested:

  • epicli apply v.0.8.3
  • cat ../build/$(cluster_name)/ansible/roles/logging/vars/main.yml
2021-07-09T10:40:27.5684847Z kind: configuration/logging
2021-07-09T10:40:27.5685795Z title: Logging Config
2021-07-09T10:40:27.5686435Z name: default
2021-07-09T10:40:27.5687011Z specification:
2021-07-09T10:40:27.5688814Z   cluster_name: EpiphanyElastic
2021-07-09T10:40:27.5689179Z   clustered: true
2021-07-09T10:40:27.5689546Z   paths:
2021-07-09T10:40:27.5689974Z     data: /var/lib/elasticsearch
2021-07-09T10:40:27.5690701Z     repo: /var/lib/elasticsearch-snapshots
2021-07-09T10:40:27.5691155Z     logs: /var/log/elasticsearch
2021-07-09T10:40:27.5691724Z   jvm_options:
2021-07-09T10:40:27.5692083Z     Xmx: 1g
2021-07-09T10:40:27.5692486Z   provider: aws
2021-07-09T10:40:27.5692857Z version: 0.8.3
  • cat ../build/$(cluster_name)/ansible/roles/rabbitmq/vars/main.yml
2021-07-09T10:40:27.5693575Z kind: configuration/rabbitmq
2021-07-09T10:40:27.5693999Z title: RabbitMQ
2021-07-09T10:40:27.5695000Z name: default
2021-07-09T10:40:27.5695829Z specification:
2021-07-09T10:40:27.5696495Z   rabbitmq_user: rabbitmq
2021-07-09T10:40:27.5697101Z   rabbitmq_group: rabbitmq
2021-07-09T10:40:27.5697694Z   stop_service: false
2021-07-09T10:40:27.5698577Z   logrotate_period: weekly
2021-07-09T10:40:27.5699224Z   logrotate_number: 10
2021-07-09T10:40:27.5731253Z   ulimit_open_files: 65535
2021-07-09T10:40:27.5731893Z   amqp_port: 5672
2021-07-09T10:40:27.5732536Z   rabbitmq_use_longname: AUTOCONFIGURED
2021-07-09T10:40:27.5733171Z   rabbitmq_policies: []
2021-07-09T10:40:27.5733911Z   rabbitmq_plugins:
2021-07-09T10:40:27.5734890Z   - rabbitmq_management_agent
2021-07-09T10:40:27.5735981Z   - rabbitmq_management
2021-07-09T10:40:27.5736609Z   custom_configurations: []
2021-07-09T10:40:27.5737215Z   cluster:
2021-07-09T10:40:27.5737824Z     is_clustered: true
2021-07-09T10:40:27.5738402Z   provider: aws
2021-07-09T10:40:27.5739027Z version: 0.8.3
2021-07-09T10:40:27.5739599Z provider: aws
  • cat ../build/$(cluster_name)/ansible/roles/filebeat/vars/main.yml
2021-07-09T10:40:27.5740140Z kind: configuration/filebeat
2021-07-09T10:40:27.5740719Z title: Filebeat
2021-07-09T10:40:27.5741270Z name: default
2021-07-09T10:40:27.5741916Z specification:
2021-07-09T10:40:27.5742463Z   helm_chart_name: filebeat
2021-07-09T10:40:27.5742970Z   disable_helm_chart: false
2021-07-09T10:40:27.5743913Z   files:
2021-07-09T10:40:27.5745532Z     filebeat_helm_chart_file_name: filebeat-7.9.2.tgz
2021-07-09T10:40:27.5746454Z   filebeat_version: 7.8.1
2021-07-09T10:40:27.5747450Z   postgresql_input:
2021-07-09T10:40:27.5748103Z     multiline:
2021-07-09T10:40:27.5749384Z       pattern: >-
2021-07-09T10:40:27.5750086Z         '^\d{4}-\d{2}-\d{2} '
2021-07-09T10:40:27.5750540Z       negate: true
2021-07-09T10:40:27.5750974Z       match: after
2021-07-09T10:40:27.5751355Z   provider: aws
2021-07-09T10:40:27.5751726Z version: 0.8.3
  • create configuration file for upgrade
---
kind: configuration/rabbitmq
title: "RabbitMQ"
provider: aws
name: default
specification:
  logrotate_period: daily
  logrotate_number: 9
  ulimit_open_files: 256
  rabbitmq_plugins:
    - rabbitmq_management_agent
    - rabbitmq_management
  cluster:
    is_clustered: false
---
kind: configuration/logging
title: Logging Config
name: default
provider: aws
specification:
  admin_password: NOWEHASLO
  logstash_password: NOWEHASLO
  cluster_name: NameAferUpgrade
  jvm_options:
    Xmx: 2g

---
kind: configuration/filebeat
title: Filebeat
name: default
provider: aws
specification:
  disable_helm_chart: false
  postgresql_input:
    multiline:
      pattern: >-
        '^\d{4}-\d{2}-\d{2} '
      negate: false
      match: before
  • execute epicli upgrade with -f /shared/$(cluster_name)/$(cluster_name)_upgradeconfig.ym parameter
  • cat ../build/$(cluster_name)/ansible/roles/logging/vars/main.yml
2021-07-09T11:08:53.2781937Z kind: configuration/logging
2021-07-09T11:08:53.2782689Z title: Logging Config
2021-07-09T11:08:53.2783283Z specification:
2021-07-09T11:08:53.2783623Z   cluster_name: NameAferUpgrade
2021-07-09T11:08:53.2783950Z   clustered: true
2021-07-09T11:08:53.2784286Z   admin_password: NOWEHASLO
2021-07-09T11:08:53.2784975Z   kibanaserver_password: PASSWORD_TO_CHANGE
2021-07-09T11:08:53.2785379Z   kibanaserver_user_active: true
2021-07-09T11:08:53.2785746Z   logstash_password: NOWEHASLO
2021-07-09T11:08:53.2786092Z   logstash_user_active: true
2021-07-09T11:08:53.2786444Z   demo_users_to_remove:
2021-07-09T11:08:53.2787156Z   - kibanaro
2021-07-09T11:08:53.2787650Z   - readall
2021-07-09T11:08:53.2788138Z   - snapshotrestore
2021-07-09T11:08:53.2788425Z   paths:
2021-07-09T11:08:53.2788745Z     data: /var/lib/elasticsearch
2021-07-09T11:08:53.2789324Z     repo: /var/lib/elasticsearch-snapshots
2021-07-09T11:08:53.2789715Z     logs: /var/log/elasticsearch
2021-07-09T11:08:53.2790061Z   jvm_options:
2021-07-09T11:08:53.2790339Z     Xmx: 2g
2021-07-09T11:08:53.2790647Z   opendistro_security:
2021-07-09T11:08:53.2790959Z     ssl:
2021-07-09T11:08:53.2791252Z       transport:
2021-07-09T11:08:53.2791600Z         enforce_hostname_verification: true
2021-07-09T11:08:53.2792018Z   provider: aws
2021-07-09T11:08:53.2792424Z provider: aws
2021-07-09T11:08:53.2792713Z version: 1.2.0dev
  • cat ../build/$(cluster_name)/ansible/roles/rabbitmq/vars/main.yml
2021-07-09T11:08:53.2793065Z kind: configuration/rabbitmq
2021-07-09T11:08:53.2793374Z title: RabbitMQ
2021-07-09T11:08:53.2793645Z specification:
2021-07-09T11:08:53.2793951Z   rabbitmq_user: rabbitmq
2021-07-09T11:08:53.2794281Z   rabbitmq_group: rabbitmq
2021-07-09T11:08:53.2794726Z   stop_service: false
2021-07-09T11:08:53.2795157Z   logrotate_period: daily
2021-07-09T11:08:53.2795483Z   logrotate_number: 9
2021-07-09T11:08:53.2795790Z   ulimit_open_files: 256
2021-07-09T11:08:53.2796103Z   amqp_port: 5672
2021-07-09T11:08:53.2796574Z   rabbitmq_use_longname: AUTOCONFIGURED
2021-07-09T11:08:53.2796944Z   rabbitmq_policies: []
2021-07-09T11:08:53.2797278Z   rabbitmq_plugins:
2021-07-09T11:08:53.2797820Z   - rabbitmq_management_agent
2021-07-09T11:08:53.2798353Z   - rabbitmq_management
2021-07-09T11:08:53.2798700Z   custom_configurations: []
2021-07-09T11:08:53.2799024Z   cluster:
2021-07-09T11:08:53.2799335Z     is_clustered: false
2021-07-09T11:08:53.2799634Z   provider: aws
2021-07-09T11:08:53.2799931Z provider: aws
2021-07-09T11:08:53.2800232Z version: 1.2.0dev
  • cat ../build/$(cluster_name)/ansible/roles/filebeat/vars/main.yml
2021-07-09T11:08:53.2800605Z kind: configuration/filebeat
2021-07-09T11:08:53.2800924Z title: Filebeat
2021-07-09T11:08:53.2801204Z specification:
2021-07-09T11:08:53.2801528Z   disable_helm_chart: false
2021-07-09T11:08:53.2801866Z   postgresql_input:
2021-07-09T11:08:53.2802177Z     multiline:
2021-07-09T11:08:53.2802642Z       pattern: >-
2021-07-09T11:08:53.2803156Z         '^\d{4}-\d{2}-\d{2} '
2021-07-09T11:08:53.2803495Z       negate: false
2021-07-09T11:08:53.2803810Z       match: before
2021-07-09T11:08:53.2804117Z   provider: aws
2021-07-09T11:08:53.2804401Z provider: aws
2021-07-09T11:08:53.2804702Z version: 1.2.0dev

The functionality seems to be working fine. However, to take full advantage of it, we should adjust all upgrade playbooks in the future.

seriva added a commit that referenced this issue Jul 9, 2021
* Added #2406

* Added #2127

* Added #1576

* Added spec changes for #2403 and #2407
@mkyc mkyc closed this as completed Jul 14, 2021
seriva added a commit that referenced this issue Jul 20, 2021
@to-bar
Copy link
Contributor Author

to-bar commented Jul 23, 2021

Created follow-up task #2461 that will use this functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logs priority/medium Task with medium priority
Projects
None yet
Development

No branches or pull requests

4 participants