hitachienergy / epiphany

Cloud and on-premises automation for Kubernetes centered industrial grade solutions.
Apache License 2.0
139 stars 107 forks source link

[SPIKE] Make Epiphany upgrades selective (Kafka) #1901

Closed sk4zuzu closed 3 years ago

sk4zuzu commented 3 years ago

Description

In this spike we want to consider an option with selective Kafka upgrades by Epicli.

It should be relatively simple (likely requires no changes in upgrade procedures themselves) to refactor Epiphany upgrades and make it possible for the user to control what components will be upgraded. That may bring value not only to users with legacy clusters but also to the process of testing.

All the topics related to the Kafka module will be done separately and covered by #1976 task and tasks that will be created as a result of #1976.

Additional information

The original task contained additional options related to Kafka module, but to avoid dependencies and clarify a single topic per task, these options are not covered here:

2. In the near future we will start introducing modules that will replace classic Epiphany components (like Kafka clusters etc). If we'd do that soon enough then the question would be if there is a possiblity to reuse modules with exising legacy on-prem clusters and what needs to be done to achieve that.

3. Support both 1. and 2.

We'd like to understand how much work do these options require to be implemented.

We want a design-doc out of his research. 
sk4zuzu commented 3 years ago

To clarify this one is about preparing some Kafka solution for very old releases of Epiphany :). For customers that do not want or it's not easy for them to upgrade to newer versions.

DaOsie commented 3 years ago

In my opinion there are 3 separate spikes "secretly" coded in the description:

At first sight, they seem to be connected with each other, however I think they aim for 3 different things. Shouldn't we just check the easiest way for introducing kafka on legacy clusters?

mkyc commented 3 years ago

This one probably depends on #1976

atsikham commented 3 years ago

As I described in this comment, we still have to investigate a lot related to the Kafka module. All things related to modules including comparison with Kafka component of epicli will be done in the scope of #1976 and other tasks that will be created after #1976 is done.

This task is only about selective upgrades for epicli, Kafka component. At the moment we upgrade all components by a single run even not asking (specifying) target components. It also needs to be checked if Kafka supports upgrades from any version to any other version. If it requires incremental upgrades between versions, it have to be taken into account.

przemyslavic commented 3 years ago

@ar3ndt We urgently need these fixes:

  1. The when conditions are invalid. Regardless of what components we select for the upgrade, all of them will be upgraded, because the conditions are always resolved as true.

Instead of the condition when: ('"kafka" in upgrade_components') or upgrade_components|length == 0 the condition when: "'kafka' in upgrade_components or upgrade_components|length == 0" seems to work fine. The first condition always returns true (thanks @to-bar for debugging this together).

  1. It looks like the condition is missing here at all which runs the kubernetes role even though I only set the kafka to be updated.
  2. It would be nice to have the values sorted alphabetically here and separated additionally by a space for readability. image.png

Moving this task back to TODO.

przemyslavic commented 3 years ago

1, 2, 3 Fixed. User can run the upgrade command with an optional argument --upgrade-components providing the list of components to be updated. Running the command without this argument will update all components.