EMCO Resources with Status

There are currently two EMCO resources for which status may be queried.

  1. Network Intents
    1. Network Intents are defined for specific clusters
  2. Deployment Intent Groups
    1. Deployment Intent Groups are defined for a specific instantiation of a composite application and version, along with a composite profile and a set of placement and action intents

High level life cycle of the EMCO resources

  1. The EMCO resources and associated supporting resources are created using the EMCO APIs and stored into the EMCO resource database (i.e. MongoDB).
  2. When 'Instantiated' via EMCO API, the EMCO resources are rendered by the appropriate scheduler service ('ncm' for network intents, 'orchestrator' for deployment intent groups) into a set of Kubernetes resources (referred to hereafter as rsync resources) that are stored in the EMCO AppContext per cluster (i.e. etcd).
  3. The EMCO resource synchronizer service ('rsync') is then invoked to apply the rsync resources to the appropriate clusters - creating cluster resources.


The following information is tracked to report the state and status of an EMCO resource and its instantiation.

  • The lifecycle state of the EMCO resource - e.g. Created, Instantiated, etc.
  • The status of the rsync resources - e.g. Applied, Failed, etc.
  • The status of the cluster resources - e.g. information about the resource from the cluster

Cluster Network Intent lifecycle

The state of the Cluster Network Intents is maintained in the Cluster document in the EMCO database.  The states are:

  • Created:  Upon initial creation of the cluster.  In this state, Network Intents may be added to the cluster.
  • Applied: Once applied, the network intents are rendered to create appropriate rsync resources in the AppContext and rsync is then invoked to instantiates these to the cluster to create cluster resources.

URL: POST /v2/cluster-providers/{cluster-provider-name}/clusters/{cluster-name}/apply

In this state (for now), additional network intents may not be added, modified or deleted until the current ones are terminated

The cluster resource deleted from the EMCO database as well, until the current network intents are terminated

  • Terminated: Causes rsync  to delete the cluster resources from the destination clusters.

URL: POST /v2/cluster-providers/{cluster-provider-name}/clusters/{cluster-name}/terminate

This state is effectively similar to the Created state - network intents may be added, modified or deleted.

The cluster resource itself may be deleted (subject to deleting sub-resources first)

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


Deployment Intent Group lifecycle

The state of the Deployment Intent Group (DIG) is maintained in the Deployment Intent Group document in the EMCO database.  The states are:

  • Created: Upon creation of the DIG, intents may be added to the DIG.  The DIG may be modified or deleted.
  • Approved: Once the DIG is Approved, the DIG and its intents may not be modified or deleted. Modifying the DIG or its intents will change unapprove the DIG and set it back to the Created state.

URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/approve

  • Instantiated: When the DIG is Instantiated, the rsync resources are created in the EMCO AppContext and the rsync is invoked to create the cluster resources in the destination clusters.

URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/instantiate

Once instantiated, the DIG and its intents may not be modified or deleted.  The DIG must be Terminated first.

  • Terminated: Causes rsync to delete the cluster resources from the destination clusters.

URL: /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/terminate

This state is effectively similar to the Approved state.

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


Deployment Intent Group state transitionswith AppContext state transitions illustrated Created Approved Instantiated Instantiated Instantiating InstantiateFailed Terminated Terminated Terminating TerminateFailed Modify intentsencompassesadding/deleting/updating theintents assigned to a DeploymentIntent Group as well as updatingthe Deployment Intent Group itself Create DeploymentIntent Group Modify intents POST approve Modify intents POST instantiate POST terminate POST instantiate Modify intents DELETE Deployment Intent Group


Included with the StateInfo maintained in the Cluster or DeploymentIntentGroup record is the State, the time when that State was requested (via the API), and the identifier of the AppContext associated with the specific instance.  A history of StateInfo data is maintained.  For example:

Sample StateInfo list
  "state": {
    "Actions": [
      {
        "State": "Created",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:36:54.186Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:37:28.748Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:37:28.947Z"
      },
      {
        "State": "Terminated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:38:51.061Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:39:34.436Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2755581958183303505",
        "TimeStamp": "2020-08-21T05:39:34.64Z"
      }
    ]
  },


AppContext State

The rsync process will maintain a top level state for the AppContext.  The 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.
  • Terminating:  When terminate is invoked, this state will be entered directly if the AppContext is in Instantiated or InstantiateFailed state.  If a previous Instantiating sequence is still running, the transition process includes shutting down the instantiating sequence before entering the Terminating state.
  • 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.  


AppContext State Transition Instantiated Instantiating InstantiateFailed Terminating Terminated TerminateFailed Transition to Terminatingis allowed to occur when the controllingEMCO resource (e.g. DeploymentIntentGroupor Cluster) is in the Instantiated state gRPC instantiate any resourceApply Failed all resourcesApplied gRPC terminateold instantiatego routinescleaned up gRPC terminate gRPC terminate all resourcesDeleted some resourcesDelete Failed

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.

  • PendingUpon 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.


Rsync Resource State Transition (with corresponding AppContext states) Instantiating Pending Applied Failed Retrying Deleted Terminating X InstantiateFailed TerminateFailed Instantiated Terminated gRPCinstantiate AppContextchanges toInstantiating Successfulapply AppContextchanges toTerminating Failed applyor delete AppContextchanges toTerminating AppContextchanges toTerminating successfuldelete AppContextchanges toTerminating successfuldelete Exceedretry time gRPCterminateold instantiate threadsetc. cleaned up gRPCterminatefrom InstantiateFailedor Instantiated any resource any resource all resources all resources

Cluster resource status

The status of resources deployed by rsync to clusters is detected as follows.

  1. When rsync instantiates rsync resources, it will also instantiate a ResourceBundleState CR to the cluster.  For a given Composite Application, a ResourceBundleState CR will be deployed for each App (in the Composite App) per cluster.  A label will be applied by rsync to all cluster resources of a given App and will be matched by label to the corresponding ResourceBundleState CR in the cluster.  The label format is:  "emco/deployment-id: <AppContext identifier>-<app-name>"
  2. A 'monitor' pod is present in each cluster is monitors all resources with the "emco/deployement-id" label.  When it detects changes to those resources, it will update the matching ResourceBundleState CR with the details of the resource.  In the example ResourceBundleState CR below, for example, all pod resources that are labeled with emco/deployment-id: 171887448792644816-sink will be included in the 'podStatuses' array.
  3. A Watcher thread is started per cluster by rsync to watch for changes to ResourceBundleState CRs in the cluster.  When an updated CR is detected, the Watcher retrieves it and saves it into the corresponding AppContext per App/Cluster so it is available to provide information for cluster resource queries.

apiVersion: k8splugin.io/v1alpha1
kind: ResourceBundleState
metadata:
  labels:
    emco/deployment-id: 171887448792644816-sink
  name: sink-171887448792644816
  namespace: default
spec:
  selector:
    matchLabels:
      emco/deployment-id: 171887448792644816-sink
status:
  ready: false
  resourceCount: 0
  configMapStatuses: []
  daemonSetStatuses: []
  deploymentStatuses: []
  ingressStatuses: []
  jobStatuses: []
  podStatuses: []
  secretStatuses: []
  serviceStatuses: []
  statefulSetStatuses: []

The cluster resource  status is provided in two forms.

  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


Deploymenet Intent Group Instantiation Sequence Orchestrator EMCO DB AppContext resource synchronizer Edge Cluster Admin Admin scheduler scheduler generic_placement_controller generic_placement_controllermongo mongo etcd etcd rsync rsync appcontext_watcher worker_thread cluster_watcher API_Server API_Server cluster_etcd cluster_etcd monitor monitor POST instantiateDeployment Intent Group retrieve Deployment Intent Group ERROR if wrong state create AppContext get generic placement intent create AppContext and metadata done invoke all otherplacement and actioncontrollers (not shown) gRPC call to instantiate AppContext Initialize Appcontext state=InstantiatingSet Resources state=Pending Initialize StopFlag=False Return Error if on occurs Return ERROR invoke thread to instantiate AppContext appcontext_watcher start watching StopFlag return OK Return OK loop[for each app] start thread to handle app worker_thread loop[for each cluster] start thread to handle cluster invoke Watcher forResourceBundleState CRs(may already exist) cluster_watcher loop[until all resources are Applied or a Failure occurs] Send Resource Apply to Cluster If success Resource State = AppliedElse If Connectivity Error Resource State = RetryingElse Resource State = Failed Apply ResourceBundleState CR all worker threads complete if any Resource = Failed, AppContext State = FailedElse All Resources=Applied, AppContext State = Instantiated

Terminate Sequence

This illustrates the Deployment Intent Group terminate sequence


Deployment Intent Group Termination Sequence Orchestrator EMCO DB AppContext resource synchronizer Edge Cluster Admin Admin scheduler scheduler generic_placement_controller generic_placement_controllermongo mongo etcd etcd rsync rsync old_appcontext_watcher old_appcontext_watcher appcontext_watcher old_worker_thread old_worker_thread worker_thread cluster_watcher cluster_watcher API_Server API_Server cluster_etcd cluster_etcd monitor monitor may be a thread stillstill trying to instantiatethe appcontext may be thread(s) still tryingto instantiate resources watching StopFlag POST terminateDeployment Intent Group retrieve Deployment Intent Group ERROR if wrong state gRPC call to terminate AppContext invoke thread to terminate AppContext appcontext_watcher Set StopFlag = True start watching until AppContext==Instantiated OR StopFlag==False detects StopFlag=True terminate any running Instantiate threads Return Error if one occurs at this stage Return ERROR return OK Return OK all old threads return Set StopFlag=False old instantiate thread returns Detects AppContext==Instantiated OR StopFlag==False Set AppContext=Terminating loop[initialize all resources states for terminate handling] If Resource = Applied, Resource= Pendingelseif Resource = (Pending, Failed, Retrying), Resource=Deleted loop[for each app] start thread to handle app worker_thread loop[for each cluster] start thread to handle cluster loop[until all resources are Deleted or Failed] Send Resource Delete to Cluster If success Resource State = DeletedElse If Connectivity Error Resource State = RetryingElse Resource State = Failed loop[waiting until deleted resources disappear from ResourceBundleState CR] Update ResourceBundleState CRas resources get deleted Notifications of changes inResourcebundleState CR Update Status at app-clusterin AppContext wait until ResourceBundleState CR is empty Delete ResourceBundleState CR all worker threads complete if any Resource = Failed, AppContext State = FailedElse All Resources=Deleted, AppContext State = Terminated


Status Query Sequence

This illustrates a status query sequence


Status / State Update Sequence Orchestrator EMCO DB AppContext resource synchronizer Edge Cluster Admin Admin status_api status_apimongo mongo etcd etcd rsync rsync appcontext_watcher appcontext_watcher worker_thread worker_thread cluster_watcher cluster_watcher API_Server API_Server cluster_etcd cluster_etcd monitor monitor App Resources Applied Create ResourceBundleState CR loop[monitoring for lifetime of ResourceBundleStateCR] watches for changes on labeled resources updates associated ResourceBundleStateCR watches for changes on ResourceBundleStateCR Update app/cluster Status object in AppContext GET Deployment IntentGroup Status get Deployment Intent Group access AppContext State(from Deployment Intent Group state loop[for all requested apps/clusters/resources] access AppContext Cluster Status access AppContext Resource State prepare response return Status query results



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:

URL:  GET /v2/cluster-providers/{cluster-provider-name}/clusters/{cluster-name}/status

URL:  GET /v2/projects/{project-name}/composite-apps/{composite-app-name}/{version}/deployment-intent-groups/{deployment-intent-group-name}/status


The following query parameters will be available:

type=<rsync | cluster>

default type is 'rsync'

rsync: gathers status based on the rsync resources.

cluster: gathers status based on cluster resource information received in the ResourceBundleState CRs received from the cluster(s)

output=<summary | all | detail >

default output value is: 'all'

summary: will just show the top level EMCO resource state and status along with aggregated resource statuses but no resource detail information

any filters added will affect the aggregated resource status results, although resource details will not be displayed

all: will include a list of resources, organized by App and Cluster, showing basic resource identification (Group Version Kind) and resource statuses

detail: includes in the resource list the metadata, spec, and status of the resource as received in the ResourceBundleState CR


The following query parameters filter the results returned.  Aggregated status results at the top level are relative to the filter parameters supplied

app=<appname>

default is all apps

This will filter the results of the query to show results only for the resources of the specified App(s).

cluster=<cluster>

default is all clusters

This will filter the results of the query to show results only for the specified cluster(s)

resource=<resource name>

default is all resources

This will filter the results of the query to show results only for the specified resource(s)

Output of Status Query

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 - the format of this field is the list of stateInfo (with state, instance id, time) as show above

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,

Note: current implementation only uses the 'Present' status

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) ]"

Currently not include in 'cluster' type queries - any resource shown is inherently 'Present'

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:

Basic default query of a composite application - ('type' is 'all')

URL:/v2/projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/status
{ 
  "project": "testvfw",
  "composite-app-name": "compositevfw",
  "composite-app-version": "v1",
  "composite-profile-name": "vfw_composite-profile",
  "name": "vfw_deployment_intent_group",
  "state": {
    "Actions": [
      {
        "State": "Created",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:36:54.186Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:37:28.748Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:37:28.947Z"
      },
      {
        "State": "Terminated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:38:51.061Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:39:34.436Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2755581958183303505",
        "TimeStamp": "2020-08-21T05:39:34.64Z"
      }
    ]
  },
  "status": "Instantiated",
  "rsync-status": {
    "Applied": 12
  },
  "apps": [
    {
      "name": "packetgen",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge01",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-packetgen",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "Service"
              },
              "name": "packetgen-service",
              "rsync-status": "Applied"
            }
          ]
        },
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge02",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-packetgen",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "Service"
              },
              "name": "packetgen-service",
              "rsync-status": "Applied"
            }
          ]
        }
      ]
    },
    {
      "name": "firewall",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge01",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-firewall",
              "rsync-status": "Applied"
            }
          ]
        },
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge02",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-firewall",                                                                                                                                                                               
              "rsync-status": "Applied"
            }
          ]
        }
      ]
    },
    {
      "name": "sink",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge01",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-sink",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "ConfigMap"
              },
              "name": "sink-configmap",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "Service"
              },
              "name": "sink-service",
              "rsync-status": "Applied"
            }
          ]
        },
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge02",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-sink",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "ConfigMap"
              },
              "name": "sink-configmap",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "Service"
              },
              "name": "sink-service",
              "rsync-status": "Applied"
            }
          ]
        }
      ]
    }
  ]
}



Query just the 'summary'

URL: /v2/projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/status?output=summary
{
  "project": "testvfw",
  "composite-app-name": "compositevfw",
  "composite-app-version": "v1",
  "composite-profile-name": "vfw_composite-profile",
  "name": "vfw_deployment_intent_group",
  "state": {
    "Actions": [
      {
        "State": "Created",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:36:54.186Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:37:28.748Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:37:28.947Z"
      },
      {
        "State": "Terminated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:38:51.061Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:39:34.436Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2755581958183303505",
        "TimeStamp": "2020-08-21T05:39:34.64Z"
      }
    ]
  },
  "status": "Instantiated",
  "rsync-status": {
    "Applied": 12
  }
}


Query with type=cluster, output=detail, app=sink, resource=sink-configmap

URL: /v2/projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/status?output=detail&type=cluster&app=sink&resource=sink-configmap
{
  "project": "testvfw",
  "composite-app-name": "compositevfw",
  "composite-app-version": "v1",
  "composite-profile-name": "vfw_composite-profile",
  "name": "vfw_deployment_intent_group",
  "state": {
    "Actions": [
      {
        "State": "Created",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:36:54.186Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:37:28.748Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:37:28.947Z"
      },
      {
        "State": "Terminated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:38:51.061Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:39:34.436Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2755581958183303505",
        "TimeStamp": "2020-08-21T05:39:34.64Z"
      }
    ]
  },
  "status": "Instantiated",
  "cluster-status": {
    "Present": 2
  },
  "apps": [
    {
      "name": "sink",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge01",
          "resources": [
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "ConfigMap"
              },
              "name": "sink-configmap",
              "detail": {
                "kind": "ConfigMap",
                "apiVersion": "v1",
                "metadata": {
                  "name": "sink-configmap",
                  "namespace": "default",
                  "selfLink": "/api/v1/namespaces/default/configmaps/sink-configmap",
                  "uid": "07f9b01f-c26d-462a-8eee-8e4f4553dda5",
                  "resourceVersion": "152135",
                  "creationTimestamp": "2020-08-21T05:39:34Z",
                  "labels": {
                    "emco/deployment-id": "2755581958183303505-sink"
                  },
                  "annotations": {
                    "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"data\":{\"protected_net_gw\":\"192.168.20.100\",\"protected_private_net_cidr\":\"192.168.10.0/24\"},\"kind\":\"ConfigMap\",\"metadata\":{\"annotations\":{},\"labels\":{\"emco
/deployment-id\":\"2755581958183303505-sink\"},\"name\":\"sink-configmap\",\"namespace\":\"default\"}}\n"
                  }
                }
              }
            }
          ]
        },
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge02",
          "resources": [
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "ConfigMap"
              },
              "name": "sink-configmap",
              "detail": {
                "kind": "ConfigMap",
                "apiVersion": "v1",
                "metadata": {
                  "name": "sink-configmap",
                  "namespace": "default",
                  "selfLink": "/api/v1/namespaces/default/configmaps/sink-configmap",
                  "uid": "fb9d25ed-5e51-4450-b0d4-7ceb1ec5daae",
                  "resourceVersion": "120014",
                  "creationTimestamp": "2020-08-21T05:39:35Z",
                  "labels": {
                    "emco/deployment-id": "2755581958183303505-sink"
                  },
                  "annotations": {
                    "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"data\":{\"protected_net_gw\":\"192.168.20.100\",\"protected_private_net_cidr\":\"192.168.10.0/24\"},\"kind\":\"ConfigMap\",\"metadata\":{\"annotations\":{},\"labels\":{\"emco
/deployment-id\":\"2755581958183303505-sink\"},\"name\":\"sink-configmap\",\"namespace\":\"default\"}}\n"
                  }
                }
              }
            }
          ]
        }
      ]
    }
  ]
}




Query instance, multiple resources

URL: /v2/projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/status?output=all\&type=rsync\&resource=fw0-packetgen\&resource=sink-configmap\&instance=2621114006130701074
{
  "project": "testvfw",
  "composite-app-name": "compositevfw",
  "composite-app-version": "v1",
  "composite-profile-name": "vfw_composite-profile",
  "name": "vfw_deployment_intent_group",
  "state": {
    "Actions": [
      {
        "State": "Created",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:36:54.186Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:37:28.748Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:37:28.947Z"
      },
      {
        "State": "Terminated",
        "ContextId": "2621114006130701074",
        "TimeStamp": "2020-08-21T05:38:51.061Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T05:39:34.436Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "2755581958183303505",
        "TimeStamp": "2020-08-21T05:39:34.64Z"
      }
    ]
  },
  "status": "Terminated",
  "rsync-status": {
    "Deleted": 4
  },
  "apps": [
    {
      "name": "packetgen",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge01",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-packetgen",
              "rsync-status": "Deleted"
            }
          ]
        },
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge02",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-packetgen",
              "rsync-status": "Deleted"
            }
          ]
        }
      ]
    },
    {
      "name": "sink",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge01",
          "resources": [
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "ConfigMap"
              },
              "name": "sink-configmap",
              "rsync-status": "Deleted"
            }
          ]
        },
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge02",
          "resources": [
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "ConfigMap"
              },
              "name": "sink-configmap",
              "rsync-status": "Deleted"
            }
          ]
        }
      ]
    }
  ]
}




Query by cluster - note, the cluster is provided as <cluster provider>+<cluster> - where the '+' character is sent in the URL as '%2B'

URL: /v2/projects/testvfw/composite-apps/compositevfw/v1/deployment-intent-groups/vfw_deployment_intent_group/status?cluster=vfw-cluster-provider%2Bedge02
{
  "project": "testvfw",
  "composite-app-name": "compositevfw",
  "composite-app-version": "v1",
  "composite-profile-name": "vfw_composite-profile",
  "name": "vfw_deployment_intent_group",
  "state": {
    "Actions": [
      {
        "State": "Created",
        "ContextId": "",
        "TimeStamp": "2020-08-21T18:17:03.503Z"
      },
      {
        "State": "Approved",
        "ContextId": "",
        "TimeStamp": "2020-08-21T18:17:18.037Z"
      },
      {
        "State": "Instantiated",
        "ContextId": "3983785381246146818",
        "TimeStamp": "2020-08-21T18:17:18.275Z"
      }
    ]
  },
  "status": "Instantiated",
  "rsync-status": {
    "Applied": 6
  },
  "apps": [
    {
      "name": "packetgen",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge02",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-packetgen",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "Service"
              },
              "name": "packetgen-service",
              "rsync-status": "Applied"
            }
          ]
        }
      ]
    },
    {
      "name": "firewall",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge02",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-firewall",
              "rsync-status": "Applied"
            }
          ]
        }
      ]
    },
    {
      "name": "sink",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge02",
          "resources": [
            {
              "GVK": {
                "Group": "apps",
                "Version": "v1",
                "Kind": "Deployment"
              },
              "name": "fw0-sink",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "ConfigMap"
              },
              "name": "sink-configmap",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "",
                "Version": "v1",
                "Kind": "Service"
              },
              "name": "sink-service",
              "rsync-status": "Applied"
            }
          ]
        }
      ]
    }
  ]
}


Example of a cluster network intents status query - all the same query parameters apply.

Note - if the type=cluster query is made, the ResourceBundleState CR currently does not support the Network and ProviderNetwork resources, so no resources will be found

URL: /v2/cluster-providers/vfw-cluster-provider/clusters/edge01/status
{
  "name": "vfw-cluster-provider+edge01",
  "state": {
    "Actions": [
      {
        "State": "Created",
        "ContextId": "",
        "TimeStamp": "2020-08-21T18:17:02.464Z"
      },
      {
        "State": "Applied",
        "ContextId": "9116473999070524329",
        "TimeStamp": "2020-08-21T18:17:11.983Z"
      }
    ]
  },
  "status": "Instantiated",
  "rsync-status": {
    "Applied": 3
  },
  "apps": [
    {
      "name": "network-intents",
      "clusters": [
        {
          "cluster-provider": "vfw-cluster-provider",
          "cluster": "edge01",
          "resources": [
            {
              "GVK": {
                "Group": "k8s.plugin.opnfv.org",
                "Version": "v1alpha1",
                "Kind": "ProviderNetwork"
              },
              "name": "emco-private-net",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "k8s.plugin.opnfv.org",
                "Version": "v1alpha1",
                "Kind": "Network"
              },
              "name": "protected-private-net",
              "rsync-status": "Applied"
            },
            {
              "GVK": {
                "Group": "k8s.plugin.opnfv.org",
                "Version": "v1alpha1",
                "Kind": "ProviderNetwork"
              },
              "name": "unprotected-private-net",
              "rsync-status": "Applied"
            }
          ]
        }
      ]
    }
  ]
}

  • No labels

1 Comment