mayadata-io / openebs-upgrade

Operator for OpenEBS
2 stars 5 forks source link

feat(install): install ISCSI client before OpenEBS installation #55

Closed sagarkrsd closed 4 years ago

sagarkrsd commented 4 years ago

This PR adds functionality to install ISCSI client prior to OpenEBS installation if not already installed. Now, the controller will first launch a daemonset(along with a configmap) named openebs-node-setup which will run on all the nodes of the cluster and will check if ISCSI client is already installed or not. If not installed, it will install ISCSI clients on all the nodes and in the next reconciliation, it will install the other OpenEBS components on the successful installation of ISCSI client.

Supported OS: Ubuntu, CentOS, RHEL, Amazon Linux.

An example configuration which user can provide to configure this functionality(optional):

apiVersion: dao.mayadata.io/v1alpha1
kind: OpenEBS
metadata:
  name: install-openebs-1.9.0
  # Namespace i.e. the namespace where the openebs-upgrade operator and the
  # other openebs components will be installed/needs-to-be-installed.
  namespace: openebs
  labels:
    name: openebs-upgrade
spec:
  # OpenEBS Version to be installed.
  version: "1.9.0"
  # The components/tools/dependencies to be installed prior to OpenEBS components
  # installation.
  preInstallation:
    # iscsiClient contains configuration for ISCSI client installation.
    iscsiClient:
      # enabled: true means it should be installed.
      #
      # Defaults to true.
      enabled: true
      # This field denotes if the setup has already been done or not.
      # User can use this field to run client setup once again if required in case of
      # new node addition or so.
      #
      # Defaults to false.
      isSetupDone: true

Signed-off-by: sagarkrsd sagar.kumar@mayadata.io

avishnu commented 4 years ago

isSetupDone: true

Is this really needed? Shouldn't the controller ensure reconciliation if there is a new node?

sagarkrsd commented 4 years ago

isSetupDone: true

Is this really needed? Shouldn't the controller ensure reconciliation if there is a new node?

We have added this since if we do not have this in CR and maintain it locally in the code, then on every controller restart, it will launch a daemonset to check if the ISCSI client setup is done or not.

avishnu commented 4 years ago

isSetupDone: true

Is this really needed? Shouldn't the controller ensure reconciliation if there is a new node?

We have added this since if we do not have this in CR and maintain it locally in the code, then on every controller restart, it will launch a daemonset to check if the ISCSI client setup is done or not.

Why can't we use the first field itself?

sagarkrsd commented 4 years ago

isSetupDone: true

Is this really needed? Shouldn't the controller ensure reconciliation if there is a new node?

We have added this since if we do not have this in CR and maintain it locally in the code, then on every controller restart, it will launch a daemonset to check if the ISCSI client setup is done or not.

Why can't we use the first field itself?

The first field is just to tell the controller that it needs to install the ISCSI client also prior to OpenEBS installation. When the first field is set to true then the controller launches the daemonset in the first iteration and does not do anything until they are running which means successful setup. In the next iteration, the controller checks if it has already launched the daemonset or set, and if launched, is it running or not. Once it comes to running state, it marks the isSetupDone to true.

Having said above, we can handle it by changing the first field to false once the setup is done but it may give the incorrect impression of whether it was set to true or not ever.