Conductor Documentation

Upgrade Operator and Entity Model - Operations at Scale (OAS)

Introduction

Wind River Conductor leverages Kubernetes operators to manage platform upgrades (WRCP). The model works in a declarative way, in which the user is required to provide the desired target state via the Kubernetes API. These process is also referred to as Operations at Scale (OAS).

The figure below illustrates how the entities interact with one another to setup and trigger upgrades.

Entity model

Installation

To install OAS see Installing Containerized Wind River Conductor (HELM).

Note:

In order for the full “Operations at Scale” Conductor solution to work, the following prerequisites are required:

Check OAS installation

To check if OAS pods was successfully deployed you can:

kubectl get pods -n <namespace>

NAME                                        READY   STATUS    RESTARTS        AGE
api-service-666488ddc8-stftx                1/1     Running   0               3d
composer-backend-57bd8f8989-cl6gq           1/1     Running   0               3d
composer-frontend-5687df978c-v8pkh          1/1     Running   0               3d
execution-scheduler-64b977cfc-fkwc2         1/1     Running   0               3d
kube-state-metrics-84df7548f9-4xm6t         1/1     Running   0               3d
mgmtworker-0                                1/1     Running   4 (2d23h ago)   3d
nginx-6fd7bbb57f-zclq2                      1/1     Running   0               3d
postgresql-0                                2/2     Running   0               3d
prometheus-server-778b7ff955-w5f64          1/1     Running   0               3d
rabbitmq-0                                  1/1     Running   0               3d
rest-api-server-b85b5f756-dl9pf             1/1     Running   0               3d
rest-service-64f895db75-rm6jl               1/1     Running   0               3d
seaweedfs-filer-0                           1/1     Running   0               3d
seaweedfs-master-0                          1/1     Running   0               3d
seaweedfs-s3-579546544d-f5rkp               1/1     Running   0               3d
seaweedfs-volume-0                          1/1     Running   0               3d
stage-backend-64c844f4cc-n2jz7              1/1     Running   0               3d
stage-frontend-554fbbbb56-fhl2h             1/1     Running   0               3d
system-inventory-manager-675dc69cd9-kztdx   1/1     Running   0               2d23h
upgrade-group-manager-bf7fd6965-c5zf5       1/1     Running   0               20m
wrc-secret-operator-f9b5b5cb5-tmjr8         1/1     Running   0               3d
kubectl get crds -n <namespace>

NAME                                   CREATED AT
systeminventories.wrcp.windriver.com   2024-03-15T13:14:59Z
upgradegroups.wrcp.windriver.com       2024-03-15T13:14:59Z
upgradepolicies.wrcp.windriver.com     2024-03-15T13:14:59Z

Note 01: If you change the username and password in the rest_service you must also change the same parameters inside the wrc_endpoint_secret in the values.yaml, the values must be in base64.

wrc_endpoint_secret:
  data:
    username: YWRtaW4=
    password: YWRtaW4=

Note 02: If you need a base 64 converter and don’t want a online tool you can use the python interpret. Record the value return in the single quotes.

>>> import base64
>>> base64.b64encode(b"admin")
b'YWRtaW4='

Definitions

System Inventory

Upgrade Group

Upgrade Policy

System Inventory Manager

The System Inventory Manager is responsible for:

Upgrade Group Manager

The Upgrade Group Manager is responsible for:

Secret Operator

The Secret Operator is responsible for:

Kubernetes Events

The Kubernetes Publisher is responsible for:

System Overview

Process overview

The user creates System Inventory, Upgrade Group and Upgrade Policy CRDs and inputs them into Cluster through kubectl command. Depending on the System Inventory type, the System Inventory Manager discovers sub-clouds and creates new System Inventories and deployments in WRC. The Upgrade Group Operator notices the existence of those new System Inventories and may trigger or schedule the WRC workflow to upgrade WRCP hosts to new versions. The Upgrade Group Operator receives workflow status from WRC and update System Inventories and Upgrade Groups properly.

The System Inventory Manager frequently gets data from WRCP hosts to keep the inventory up-to-date. If discrepancies between the original values in the System Inventory and the current ones in WRCP hosts are identified, the System Inventory Manager reports them to user. It is possible to reconcile the discrepancies by using the WRC user interface.

The Upgrade Group Manager monitors changes in the System Inventories and acts accordingly to update Upgrade Groups.

All actions performed via kubectl can be performed using WRC user interface.

Access Control

Clean-up Troubleshooting

In order to preform a clean up when uninstalling, the Custom Resources (System Inventories, Upgrade Groups, and Upgrade Policy) must be deleted prior to uninstalling helm. If not, some resources might get frozen when trying to delete it. This happens because the operator will be down at the moment of deletion, which is a limitation from kopf.

If helm is uninstalled before the resources are deleted, the kopf finalizer must be manually removed using the following command:

kubectl patch <resource_type> <resource_name> -p '{"metadata": {"finalizers": []}}' --type merge -n <namespace>

The resource_type can be: SystemInventory, UpgradeGroup, UpgradePolicy or Secret.

NOTE: Do NOT remove the finalizer from the CRD, since it can leave orphaned custom resource data in etcd.

Glossary

Command Line

To interact with CRDs it is necessary to use the kubectl command. All commands assume that the given CRD and Secret YAML files are already created by the user.

Action Command
Create CRD objects kubectl create -f .yaml -n
Delete CRD objects kubectl delete -f .yaml -n
Describe CRD kubectl describe crd -n
Read CRDs kubectl get crd -n
Read events kubectl get events -n
Read secrets kubectl get secret -n
Read System Inventory kubectl get sysinv -n
Read Upgrade Group kubectl get upgrp -n
Update CRD objects kubectl update -f .yaml -n

CRDs

OAS Custom Resource Definitions

There are 3 new CRDs that need to be managed:

  1. System Inventories, short name is sysinv.
  2. Upgrade Groups, short name is upgrp.
  3. Upgrade Policy, short name is upgradepolicy.

You can interact with these resources using the standard Kubernetes CLI or the System Invetory, Upgrade Group and Upgrade Policy widgets.

Secret

A WRC Secret is defined in the following manner:

Key Type Description Details
apiVersion Text Indicates the version of the Kubernetes API that should be used to interpret the YAML file. apiextensions.k8s.io/v1
kind Text Specifies the type of Kubernetes object. Secret
metadata Object Contains metadata about the secret, such as its name, namespace, and labels
  • name
Text The name of the secret. Defined by the user
  • namespace
Text The Kubernetes namespace in which the secret is located.
  • labels
Object Additional labels for categorizing the secret
data Object Contains base64-encoded data values for the secret.
  • USERNAME
Text The Conductor username, base64-encoded.
  • PASSWORD
Text The Conductor password, base64-encoded.
stringData Object Contains string data values for the secret.
HOST_URL Text The Conductor host URL.
  • TRUST_ALL
Boolean A boolean indicating whether to trust all SSL/TLS certificates.
  • TENANT
Text The WRC tenant.
  • API_VERSION
Text The WRC API version. E.g.: v3.1
type Text Specifies the type of secret. If it’s set to “Opaque,” it means the secret is a generic secret without a specific format.

An example of the script to instantiate a WRC Secret is shown below:

apiVersion: v1
kind: Secret
metadata:
  name: wrc-endpoint-secret
  namespace: wrcp
  labels:
    app: conductor
data:
  USERNAME: username
  PASSWORD: password
stringData:
  HOST_URL: http://localhost:80/
  TRUST_ALL: "true"
  TENANT: "default_tenant"
  API_VERSION: "v3.1"
type: Opaque

A WRCP Secret is defined in the following manner:

Key Type Description Details
apiVersion Text Indicates the version of the Kubernetes API that should be used to interpret the YAML file. apiextensions.k8s.io/v1
kind Text Specifies the type of Kubernetes object. Secret
metadata Object Contains metadata about the secret, such as its name, namespace, and labels.
  • annotations
Object Annotations to identify the secret. Defined by the system.Examples: wrcp-secret: “yes”, wrcp-status: Ready or Error
  • name
Text The name of the secret. Defined by the user
  • namespace
Text The Kubernetes namespace in which the secret is located.
  • labels
Object Additional labels for categorizing the secret.
data Object Contains base64-encoded data values for the secret.
  • OS_USERNAME
Text The WRCP Keystone user name, base64-encoded.
  • OS_PASSWORD
Text The WRCP Keystone authentication password, base64-encoded.
  • SSH_USERNAME
Text The WRCP SSH username, base64-encoded.
  • SSH_PASSWORD
Text The WRCP SSH username, base64-encoded.
  • CACERT
Text The content of the CA certificate, base-64 encoded.
stringData Object Contains string data values for the secret.
  • OS_AUTH_URL
Text The Keystone Authentication URL.
  • OS_AUTH_TYPE
Text The Keystone authentication type.
  • OS_IDENTITY_API_VERSION
Text The identity API version.
  • OS_INTERFACE
Text The interface.
  • OS_KEYSTONE_REGION_NAME
Text The Keystone region name.
  • OS_PROJECT_DOMAIN_NAME
Text The project domain name.
  • OS_USER_DOMAIN_NAME
Text The user domain name.
  • OS_PROJECT_NAME
Text The project name.
  • OS_REGION_NAME
Text The Keystone region name.
  • INSECURE
Text Whether SSL validation must be ignored. “true” or “false”
type Text Specifies the type of secret. If it’s set to “Opaque,” it means the secret is a generic secret without a specific format.

An example of the script to instantiate a WRCP Secret is shown below:

apiVersion: v1
kind: Secret
metadata:
  name: wrcp-endpoint-my-controller
  namespace: wrcp
  labels:
    app: conductor
  annotations:
    wrcp-secret: "yes"
    wrcp-status: Ready
data:
  OS_USERNAME: username
  OS_PASSWORD: password
  SSH_USERNAME: sshusername
  SSH_PASSWORD: sshpassword
   CACERT: cacertdata
stringData:
  INSECURE: "false"
  OS_AUTH_URL: http://1.1.1.1:5000/v3
  OS_AUTH_TYPE: password
  OS_IDENTITY_API_VERSION: "3"
  OS_INTERFACE: internal
  OS_KEYSTONE_REGION_NAME: RegionOne
  OS_PROJECT_DOMAIN_NAME: Default
  OS_USER_DOMAIN_NAME: Default
  OS_PROJECT_NAME: admin
  OS_REGION_NAME: RegionOne
type: Opaque

An example of the script to instantiate a WRCP Secret with CACERT: Certificate encode in base64 is shown below:


apiVersion: v1
kind: Secret
metadata:
  name: wrcp-endpoint-dc
  namespace: wrcp
  labels:
    app: conductor
data:
  OS_USERNAME: YWRtaW4=
  OS_PASSWORD: TGk2OW51eCo=
  SSH_USERNAME: c3lzYWRtaW4=
  SSH_PASSWORD: TGk2OW51eCo=
  CACERT: |
    LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZwVENDQTQyZ0F3SUJBZ0lVUmd6dGg1MXg0
    TnZ0ZEZ1L1EzSFkvcjdESnZNd0RRWUpLb1pJaHZjTkFRRUwKQlFBd1lqRUxNQWtHQTFVRUJoTUNW
    MHN4RURBT0JnTlZCQWdNQjFkaGEyRnVaR0V4RURBT0JnTlZCQWNNQjFkaAphMkZ1WkdFeEN6QUpC
    Z05WQkFvTUFsZFNNUXd3Q2dZRFZRUUxEQU5QY21jeEZEQVNCZ05WQkFNTUMzZGhhMkZ1ClpHRXVZ
    Mjl0TUI0WERUSTBNRFF3T1RFNU1qWTBORm9YRFRNME1EUXdOekU1TWpZME5Gb3dZakVMTUFrR0Ex
    VUUKQmhNQ1Ywc3hFREFPQmdOVkJBZ01CMWRoYTJGdVpHRXhFREFPQmdOVkJBY01CMWRoYTJGdVpH
    RXhDekFKQmdOVgpCQW9NQWxkU01Rd3dDZ1lEVlFRTERBTlBjbWN4RkRBU0JnTlZCQU1NQzNkaGEy
    RnVaR0V1WTI5dE1JSUNJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQWc4QU1JSUNDZ0tDQWdFQXlH
    ZHlmWHhwQzVNSzM5V0JWbU9kdXgwSVpuY3AKdUlvd0Q4WXMwcFA3TmZRWnpNUjhXNTJiTExPb2RX
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H_TYPE: password
  OS_IDENTITY_API_VERSION: "3"
  OS_INTERFACE: internal
  OS_KEYSTONE_REGION_NAME: RegionOne
  OS_PROJECT_DOMAIN_NAME: Default
  OS_USER_DOMAIN_NAME: Default
  OS_PROJECT_NAME: admin
  OS_REGION_NAME: RegionOne
type: Opaque

System Inventory

A System Inventory is defined in the following manner:

Key WIP Type Description Details
apiVersion Text Indicates the version of the Kubernetes API that should be used to interpret the YAML file. apiextensions.k8s.io/v1
kind Text Specifies the type of Kubernetes object. SystemInventory
metadata Object Contains metadata about the object, such as its name and namespace.
  • name
Text The name of the SystemInventory object.
  • namespace
Text The Kubernetes namespace in which the object is located.
  • annotations
Object Additional non-identifying information about the object. Annotations include upgrade-related details and a deployment ID.
  • annotations: upgrade-state
Text The current state of the upgrade. E.g.: scheduled. Note: It is defined by the system.
  • annotations: upgrade-stage
Text The current stage of the upgrade. E.g.: pending. Note: It is defined by the system.
  • annotations: scheduled-upgrade-start
Date and Time The starting date and time of the workflow. E.g.: 2023-10-19T22:02:47Z. The workflow runs between the start and end date and time.
  • annotations: scheduled-upgrade-stop
    Date and Time The ending date and time of the workflow. E.g.: 2023-10-19T22:02:47Z. The workflow runs between the start and end date and time.
    • annotations: deployment-upgrade
    Text This is the deployment ID. Note: Defined by the system.
    • labels
    Object Key-value pairs used to organize and categorize the object. Labels include information about the sub-cloud group, release version, Kubernetes version and a custom label.
    • labels: subcloud-group
    Text The set of sub-clouds to be affected by the workflow. Defined by the user.
    • labels: release-version
    Text The WRCP host version. E.g.: 22.12 Note: Defined by the system.
    • labels: kubernetes-version
    Text The Kubernetes version. E.g.: 1.23.1 Note: Defined by the system.
    • labels: distributed-cloud-role
    Text The WRCP host role if the it is part of a distributed cloud system. E.g.: systemcontroller or subcloud Note: Defined by the system.
    • labels:system-controller
    Text For subcloud hosts only. The associated system controller of the WRCP subcloud host. Note: Defined by the system.
    • labels: custom-label
    Key-value pair Any additional label defined by the user. Defined by the user.
    spec Object
    • wrcp-endpoint-secret
    Text Refers to a K8s Secret used for the WRCP endpoint.
    • discrepancies
    Object The discrepancies between the original version of the SystemInventory (when it was created) and the current version. Note: Defined by the system
    • discrepancies: original-release-version
    The release version when the SystemInventory was created E.g.: 21.12 Note: Defined by the system
    • discrepancies: current-release-version
    The current release version of the SystemInventory. E.g.: 21.12 Note: Defined by the system
    • discrepancies: original-kubernetes-version
    The Kubernetes version when the SystemInventory was created E.g.: 1.23.1 Note: Defined by the system
    • discrepancies: current-kubernetes-version
    The current Kubernetes version of the SystemInventory. E.g.: 1.23.1 Note: Defined by the system
    status Object
    • event_type
    Text The current state of the upgrade workflow Note: Defined by the system
    • discovery
    Text The current status of the Discovery process Note: Defined by the system

    Ths following example demostrates how to instantiate a new System Inventory object:

    apiVersion: wrcp.windriver.com/v1
    kind: SystemInventory
    metadata:
      name: my-controller
      namespace: wrcp
      annotations:
        upgrade-state: scheduled
        upgrade-stage: pending
        scheduled-upgrade-start: 2023-10-19T22:02:47Z
        scheduled-upgrade-stop: 2023-10-20T23:02:47Z
        deployment-upgrade: 48107489-82e9-426c-a8c1-63af98d7b11c
      labels:
        subcloud-group: region-foo
        release-version: "21.12"
        kubernetes-version: "1.23.1"
        distributed-cloud-role: subcloud
        system-controller: any-systemcontroller
        custom-label: custom-value
    spec:
      wrcp-endpoint-secret: wrcp-endpoint-my-controller
    

    Upgrade Group

    The upgrade workflow requires ISO, License and Sig files to successfully upgrade WRCP hosts. These files must be placed in WRC mgmtworker Pod in the following paths:

    Folder’s name must exactly match the name of Upgrade Group. The system will verify the path for each Upgrade Group before workflow execution.

    An upgrade group is defined in the following manner:

    Key Type Description Details
    apiVersion Text Indicates the version of the Kubernetes API that should be used to interpret the YAML file. apiextensions.k8s.io/v1
    kind Text Specifies the type of Kubernetes object. UpgradeGroup
    metadata Object Contains metadata about the object, such as its name and namespace.
    • name
    Text The name of the UpgradeGroup object. Free text
    • namespace
    Text The Kubernetes namespace in which the object is located. Need to be the namespace where the OAS is installed
    spec Object Specifies the desired state of the UpgradeGroup object.
    • state
    Text Indicates the state of the UpgradeGroup. Disabled: The UpgradeGroup object is a draft, no schedules are made; Enabled: The UpgradeGroup object is active and the schedules can be made
    • policy
    Text Specifies the upgrade policy. Reference to a UpgradePolicy name
    • selector
    Object Defines criteria while selecting SystemInventories to be included in this UpgradeGroup. It uses the System Inventory labels to filter. E.g.: subcloud-group: region-foo release-version: “21.12”
    • schedule
    Object Specifies the schedule for the upgrades.
    • schedule:workflow
    Text Defines the workflow schedule with details such as execution date range, execution time range, recurrence, count, before-workflow, and after-workflow. E.g.: upgrade
    • schedule:workflow: execution-date
    Object Specifies the start and end dates for the execution.
    • schedule:workflow: execution-date: start
    String Start date of the execution E.g.: “2023-08-30
    • schedule:workflow: execution-date: end
    String End date of the execution E.g.: “2023-08-30
    • schedule:workflow: execution-time
    Object Specifies the start and end times for the execution. (UTC timezone)
    • schedule:workflow: execution-time: start
    String Start time of the execution (UTC timezone) E.g.: “10:30
    • schedule:workflow: execution-time: end
    String
    • schedule:workflow: recurrence
    Text Indicates the recurrence interval of the execution. Valid recurrence expressions are of the form minutes
    • schedule:workflow: count
    Integer Specifies the number of times the execution should occur. E.g. 1
    • schedule:workflow: before-workflow
    Text Specifies the workflow to be executed before a specific workflow. Note: Not applicable to OAS 24.03
    • schedule:workflow: after-workflow
    Text Specifies the workflow to be executed after a specific workflow. Note: Not applicable to OAS 24.03
    • components
    Object Specifies components versions, such as WRCP version.
    • components: release-version
    Text The target WRCP version the upgrade group be will upgraded to. E.g.: “23.03
    • status
    Text The administrative status of the UpgradeGroup Note: Defined by the system

    The following example shows how to instantiate a Upgrade Group object:

    apiVersion: wrcp.windriver.com/v1
    kind: UpgradeGroup
    metadata:
      name: testing-upgrade-group
      namespace: wrcp
    spec:
      state: enabled
      policy: testing-policy
      selector:
        testing-label: testing-value
        release-version: "21.12"
      components:
        release-version: "22.12"
      schedule:
        upgrade:
          execution-date:
            start: "2100-07-30"
            end: "2100-08-30"
          execution-time:
            start: "10:30"
            end: "11:30"
          recurrence: "1d"
          count: 5
    

    Upgrade Policy

    Note: This CRD will be available in future releases. An upgrade policy is defined in the following manner:

    Key WIP Type Description Details
    apiVersion Text Indicates the version of the Kubernetes API that should be used to interpret the YAML file. apiextensions.k8s.io/v1
    kind Text Specifies the type of Kubernetes object. UpgradePolicy
    metadata Object Contains metadata about the object, such as its name and namespace
    • name
    Text Contains metadata about the object, such as its name and namespace. Defined by the user
    • namespace
    The Kubernetes namespace in which the object is located.
    spec Specifies the desired state of the UpgradePolicy object
    • batch-size
    Integer Specifies the batch size for the upgrade policy.
    • batch-size: phase
    The batch size for the given phase. E.g.: postcheck
    • max-retry
      Integer Specify the maximum number of retries for workflow phase
      • max-retry: phase
        The max-retry for the given phase. E.g.: upgrade and prestaging
        • execution-limit
        Object Specifies the execution limit for the upgrade policy.
        • execution-limit: phase
        Text The execution limit for the given phase. E.g.: postcheck
        • rollback-scope
        Text Specifies the rollback scope for the upgrade policy. E.g.: system
        • rollback-threshold
          Object Specifies the threshold for rollback actions.
          • rollback-threshold: retry
            Integer Specifies the number of retries allowed before initiating a rollback.
            • rollback-threshold: abort
              Integer Specifies the number of aborts allowed before initiating a rollback.

              The following example shows how to instantiate a Upgrade Policy object:

              apiVersion: wrcp.windriver.com/v1
              kind: UpgradePolicy
              metadata:
                name: any
                namespace: wrcp
              spec:
                batch-size:
                  precheck: 5
                execution-limit:
                  postcheck: 5
                max-retry:
                  upgrade: 1
                  prestaging: 1
                rollback-scope: system
                rollback-threshold :
                  retry: 5
                  abort: 1
              
              

              Operators

              Operators are responsible for the lifecycle of the management automation process for defined set of managed systems.

              The Operator implements Kubernetes controllers for the system entities. The main purpose of any controller is to bring the actual state of the cluster to the desired state, as expressed with the resources/object specification.

              Kubernetes Publisher

              Architecture

              The Kubernetes Publisher is composed of 2 main parts:

              1. The listener: Responsible for reading the messages in the WRC AMQP queue.
              2. The publisher: Responsible for translating the messages and “publishing” them as Kubernetes Events and System Inventory status updates.

              Behavior

              The Kubernetes Publisher listens to the WRC workflow messages coming from WRC RabbitMQ and does the following steps:

              1. Checks whether the workflow in question is the upgrade workflow.
              2. Checks whether the upgrade workflow has the upgrade strategy.
              3. Looks for the corresponding System Inventory based on the deployment ID.
              4. Creates a new Kubernetes Event with the information regarding the execution.
              5. Updates the System Inventory status with its upgrade status.
                1. The possible statuses are: workflow_started, workflow_failed, workflow_cancelled and workflow_succeeded.

              Checking the Events and the Status

              The user can check whether the Kubernetes Publisher has created any events recently with the following command:

              Events
              kubectl get events
              

              The user can also check the System Inventory status:

              Status
              kubectl describe systeminventories.wrcp.windriver.com deployment-name
              

              Secrets operator

              There are two types of Secrets to be considered: WRC and WRCP.

              The WRC Secret is created by Helm installation and is used to establish communication between the System Inventory Manager and Upgrade Group Operator with the WRC.

              WRCP Secrets contain the information needed to establish communication between System Inventory Manager with a WRCP hosts. The user can update WRC Secrets and create WRCP Secrets though kubectl. All WRCP Secrets are automatically propagated to WRC. Notice: The WRCP Secrets can be created just by CLI using the kubectl command.

              WRCP Secret keys are propagated to WRC so they can be referenced by WRC deployments created by System Inventory Manager. The following table shows how Kubernetes Secret keys of a secret with name “wrcp-endpoint-my-controller” are translated to WRC Secrets:

              Kubernetes Secret Key WRC Secret
              SSH_USERNAME wrcp-endpoint-my-controller_wrcp_ssh_username
              SSH_PASSWORD wrcp-endpoint-my-controller_wrcp_ssh_password
              OS_USERNAME wrcp-endpoint-my-controller_wrcp_username
              OS_PASSWORD wrcp-endpoint-my-controller_wrcp_api_key
              CACERT wrcp-endpoint-my-controller_wrcp_cacert

              The value of INSECURE is passed to the deployment as the ‘insecure’ input.

              NOTE:

              Only Kubernetes Secrets containing the keys listed in the table above are processed by the Secret Operator. Other secrets are processed once and ignored afterwards. When processing a non-WRCP secret, the Secret Operator raises an Exception so it can avoid trying to reprocess it. Unless the user is trying to create a WRCP Secret, this exception is expected:

              [2024-02-15 11:50:21,341] kopf.objects         [ERROR   ] [wrcp/wrc-endpoint-secret-test] Handler 'handle_secret_creation' failed permanently: This secret does not contain expected keys. Don't try to process it again. Root cause: Failed to retrieve expected key 'OS_PASSWORD', skipping the creation of secrets in WRC.
              [2024-02-15 11:50:21,341] kopf.objects         [INFO    ] [wrcp/wrc-endpoint-secret-test] Creation is processed: 0 succeeded; 1 failed.
              
              

              System Inventory Manager

              System Inventories can be created, updated, deleted, displayed and discovered through the Conductor widgets or Kubernetes CLI. The manual creation is allowed for System Inventories that represent a WRCP Central Cloud or a Standalone host. For WRCP sub-clouds its is not necessary any interaction of the user as they are discovered automatically by the system or on demand by the System Inventory widget.

              Note: the release 24.03 is intended to allow the declarative interaction with Upgrade workflows that are only supported by Central Clouds, so the creation of non-Central Cloud System Inventories does not have effect. It is present just for compatibility with future releases.

              When the System Inventory is changed it triggers process in Upgrade Group to keep all the data consistent. For example, when a new System Inventory is created the Upgrade Operator checks its labels. If the labels of the System Inventory match the selector of the Upgrade Group the System Inventory is impacted by this Upgrade Group, so Upgrade workflows may be scheduled to this System Inventory.

              Discovery

              The Discovery feature discover all the sub-clouds associated with a System Inventory that represents a Central Cloud. It is a periodic operation or can also be triggered manually by the user using the System Inventory widget. The action is available for System Inventories that represent Distributed Cloud only.

              Note: in release 24.03 the periodicity is set as 4 hours.

              Update host attributes

              It is a periodic operation that get WRCP host data like component versions. It is the base operation to update discrepancies.

              Note: in release 24.03 the periodicity is set as 4 hours.

              Discrepancies

              Discrepancies can happen when the information contained in a System Inventory object diverges from the information returned by the corresponding WRCP system. Ideally, the System Inventory object should always mirror the current state of the corresponding WRCP host, but issues may happen and they can cause this synchronization to be lost. Discrepancies can be audited using the Conductor widgets or the Kubernetes CLI and reconciled just via the Conductor widgets.

              Upgrade Group Operator

              Upgrade Groups can be created, updated, deleted, and displayed through the Conductor widgets or Kubernetes CLI.

              Through the Upgrade Group selector the user can filter a set of System Inventories to be impacted by the WRC workflows. Depending on the value in “schedule” the workflow can be executed immediately or later.

              Upgrade Group object creation

              When an Upgrade group object is created, Upgrade Group Manager use the labels in selector field to filter System Inventories objects. Upgrade Group manager searches in System Inventories labels that match with selectors.

              Note: The executions are created only for system controllers, subclouds will not have any schedule execution.

              Draft system

              It is possible to create an object as disable and any executions will be scheduled. Switching the state to enable, manager will filter System Inventories and create schedules.

              Upgrade Group Updates

              All executions are cancelled when something change in Upgrade Group. Manager’s filter System Inventories again and reschedule the executions.

              Upgrade Group Deleted

              When an object is deleted, all executions are cancelled.

              Executions Summary

              Upgrade Group objects store a summary of the executions inside the object in “spec.status” fields. Users can check how many System Inventories are scheduled, reconciled, in-progress and completed, further the total of System Inventories.

              System Inventory Creation

              When a System Inventory object is created, the Upgrade Group Manager checks if this new object belongs to an Upgrade Group object and if so, the manager schedules the executions.

              System Inventory Updates

              When a System Inventory object has its labels updated, the Upgrade Group Manager cancels the executions for the System Inventory and checks for an Upgrade Group match.

              System Inventory Deleted

              When a System Inventory is deleted, WRC cancels that deployment-id schedules.

              Upgrade Controllers

              To upgrade the controllers users must fill the Upgrade Group selector with the labels of desired controllers.

              Upgrade and Prestage Subclouds

              The Upgrade of subclouds in WRC 24.03 is run through the controllers, so users must set the filter to “controllers” in their group selectors. This will filter the controllers that will have their subclouds upgraded.

              Controllers and Subclouds must have different Upgrade Groups and different schedules.

              System inventories of subclouds will not have the status of the upgrade, since the upgrade run through the controllers, the status of subclouds upgrade will be shown in controller System Inventories.

              System Inventory - Widget

              New Widgets

              The cluster can be controlled using WRC’s web interface. To make this possible, some new widgets were introduced. Examples are shown below.

              Note: Kubernetes works asynchronously, so in some cases it implies that users need to wait for a new status (refreshing page or waiting for a new data fetching, as defined in widgets configurations) or use kubectl describe resource to get more accurate data about resources.

              System Inventory

              All the System Inventories that have been created can be reviewed under Upgrades→System Inventory session:

              System Inventory

              Discovery

              Run a discovery in WRCP to get recently added subclouds.

              Audit System Inventories

              Review any discrepancies between the object and the system, and address these issues through the User Interface (UI).

              System Inventory

              Add Inventory

              Create new System Inventories by clicking on Add Inventory:

              System Inventory

              Filter System Inventories for Upgrade Group

              List the objects that match System Inventory labels with Upgrade Group selector.

              System Inventory

              Upgrade Group - widget

              Upgrade Group

              The Upgrade Group list shows all upgrade groups created under Upgrade → System Upgrade:

              System Inventory

              To add a new Upgrade Group, click on Add Upgrade Group:

              System Inventory

              Upgrade Policy

              Note: The Upgrade Policy is not used in release 24.03. It is there for future use.

              Review Upgrade Policies that have been created under Upgrade → System Upgrade:

              System Inventory

              To add a new Upgrade Policy, click on Add Upgrade Policy:

              System Inventory