Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

EMCO Resources with Status

...

The Instantiated state may be re-invoked to start a new set of rsync resources  and cluster resources.

...



AppContext State

The status of the rsync resource is maintained in the EMCO AppContext by rsyncrsync process will maintain a top level state for the AppContext.  The status values are defined as follows.

...

states are:

  • Instantiating:  Once rsync is invoked to instantiate an AppContext, the state will be set to Instantiating.
  • InstantiatedRsyinc will set the .AppContext state to Instantiated after all Resources in the AppContext have been Applied.
  • InstantiateFailed:  This indicates that one or more Resources Failed to be applied.
  • PreTerminate:  If rsync is invoked to terminate an AppContext which is still in the Instantiating state, rsync needs to shutdown any threads in the process of trying to instantiate resources before beginning the terminate sequence.
  • Terminating:  When terminate is invoked, this state will be entered directly if the AppContext is in Instantiated or InstantiateFailed state.  Otherwise, it will enter this state from PreTerminate after the initialize sequence has been shutdown.
  • Terminated:  This indicates that rsync has successfully Deleted all resources.
  • TerminateFailed:  This indicates that rsync has received a failure response from one or more Resources when attempting to delete them.  



Rsync resource state values

The state of the rsync resource is maintained in the EMCO AppContext by rsync.  The status values are defined as follows.

  • Pending:  Upon initial creation by ncm (for cluster network intents) or orchestrator (for DIGs), the rsync resources will be initialized to a Pending status to indicate they have not been handled by rsync yet.
  • Applied:  This indicates that rsync has successfully applied the rsync resource to a destination cluster.  This does not indicate anything about the actual status of the corresponding cluster resource(s) - other than it is expected that the cluster resource does exist.
  • Failed:  This indicates that rsync has received a failure response when either attempting to apply or delete the rsync resource from the destination cluster.  rsync  is taking no further action with this resource.
  • Retrying:  This indicates that rsync is continuing to attempt to apply or delete the rsync resource from the destination cluster.  This may occur because connectivity to the destination cluster is currently unavailable, but may resume at a later time.  This will continue until a different lifecyle state is invoked on the controlling EMCO resource.
  • Terminated:  This indicates that rsync has successfully deleted the rsync resource from the destination cluster.  This does not indicate anything about the actual status of the corresponding cluster resource(s) - other than it is expected to that the cluster resource does exist or is in the process of terminating.

...

  1. The actual status{} portion of the cluster resource (if present) is made available in the information returned via the ResourceBundleState CR.
  2. Summarized in a value as follows.
    • Unknown:  The unknown status represents the case where a ResourceBundleState CR has not been received yet, or that the ResourceBundleState CR does not  support that resource type.
    • NotPresent:  For resource types (Kinds) that are supported by the ResourceBundleState CR, if an rsync resource does not have a corresponding cluster resource in the CR, then the cluster status of the resource is NotPresent.
    • Present: For rsync resources with a corresponding cluster resource in the ResourceBundleState CR, the clustesr status is present.
    • TBD: Further work can be done to summarize the Status{} portion of cluster resources to identify the status more precisely than Present - such as: Active, Ready, Not Ready, etc.


Instantiate Sequence

This illustrates the Deployment Intent Group instantiate sequence



Terminate Sequence

This illustrates the Deployment Intent Group terminate sequence




Status Query Sequence

This illustrates a status query sequence





Status Query

The status query, and variations with query parameters, on an EMCO resource will present the information described previously to the caller.  The basic status query for the two EMCO resources discussed above will look like the following:

...

The following table shows the essential structure of the status query response with a description of which elements are present based on the 'output' parameter.


Format of the status query response

Description

'summary' query

'all' query

'detail' query

'rsync'

query

{






  "name": "<name>",

The name of the Deployment Intent Group or Cluster

X

X

X

X

  "project": "<project name>",

Present for the Deployment Intent Group

X

X

X

X

  "composite-app-name": "<composite-app-name>",

Present for the Deployment Intent Group

X

X

X

X

  "composite-app-version": "<composite-app-version>",

Present for the Deployment Intent Group

X

X

X

X

  "composite-profile-name": "<composite-profile-name>",

Present for the Deployment Intent Group

X

X

X

X

  "state": "[ Created, Approved, Instantiated, Terminated ]",

'state' is the action made by the user

X

X

X

X

  "rsync-status": {

'rsync-status' is the aggregated rsync-status of the resources - subject to query parameter filters

X

X

X

X

      "Pending": 0,

elements with zero can be dropped

X

X

X

X

      "Applied": 5,


X

X

X

X

      "Failed": 2,


X

X

X

X

      "Retrying": 3,


X

X

X

X

      "Terminated": 0


X

X

X

X

  },


X

X

X

X

  "cluster-status" : {

'cluster-status' is the aggregated cluster-status of the resources - subject to query parameter filters

X

X

X


      "NotPresent": 0,


X

X

X


      "Present": 5,


X

X

X


      "Unknown": 5


X

X

X


  },


X

X

X


  "resources": [

array of resources organized by app in the composite-app


X

X

X

    {



X

X

X

      "app-name": "collectd",



X

X

X

      "clusters": [

array of clusters in the app


X

X

X

        {



X

X

X

          "name": "cluster1",



X

X

X

          "resources": [

array of resources in the cluster


X

X

X

            {



X

X

X

              "GVK": {

 The GVK will come from the AppContext except for cases where the resource is only a cluster resource - e.g. an rsync resource that is a Deployment can result in cluster resources of both Deployment and Pod(s).


X

X

X

                "Group": "<group>",



X

X

X

                "Version": "<version>",



X

X

X

                "Kind": "<kind>"



X

X

X

              },



X

X

X

              "Name": "<resource name>",

The name of the resource from the AppContext (or cluster as described for GVK)


X

X

X

              "metadata": { },

The 'metadata' element of the cluster resource as received in the ResourceBundleState CR.  In the case of an 'output=rsync' query, this will be the 'metadata' element from the AppContext.



X

X

              "spec": { },

The 'spec' element of the cluster resource as received in the ResourceBundleState CR. In the case of an 'output=rsync' query, this will be the 'metadata' element from the AppContext.



X

X

              "status": { },

The 'status' element of the k8s resource as received in the ResourceBundleState CR (if the resource has one). In the case of an 'output=rsync' query, this will not be present.



X


              "rsync-status": "[ Pending | Instantiated | Failed | Retrying |Terminated ]",

"Pending" - is set by orchestrator before issuing an Instantiate command to rsync

"Instantiate" - means rsync has successfully invoked deployment of the resource to the cluster

"Failed" - means rsync got an explicit failure when invoking to the cluster

"Retrying" - means connection to cluster is temporarily unavailable, rsync will continue to retry - applies to both instantiate and terminate sequences (initial thought is to detect this condition at a cluster level - but mark each resource)

"Terminated" - means rsync has successfully invoked termination of the resource to the cluster


X

X

X

              "cluster-status": "[ Unknown | NotPresent | Present | (tbd) ]"

Summary status for the resource from info obtained from the cluster (e.g. via the ResourceBundleState CR)

"Unknown" - means a ResourceBundleState has not yet been received or the resource type is not supported in the ResourceBundleState CR

"NotPresent" - the resource is not in the ResourceBundleState CR and it is supported.

"Present" - the resource is present in the ResourceBundleState CR

"tbd" - further status values can be derived as analysis of how to represent the full status {} object from the resource can be interpreted - e.g. 'Ready', 'Failed', 'Pending', etc.


X

X


            }



X

X

X

          ]



X

X

X

        }



X

X

X

      ]



X

X

X

    }



X

X

X

  ]



X

X

X

}



X

X

X

Examples of queries and outputs:

...