Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Work in Progress


Table of Contents

Lifecycle Management Interface

This interface allows the CNF Manager (CNFM) client to invoke AS-CNF lifecycle management operations of AS-CNF instances towards the CNFM.

...

note: register and unregister of K8S cluster(s) are under consideration. May use existing AAI interface??? TBD.

Create AS Instance Resource

The creation of an "individual" AS instance resource.

REST Interfaces

  • POST  .../as_instances (CreateAsRequest)
  • 201 Created (AsInstance)
  • // Send AsIdentifierCreationNotification

...

For the response AsInstance structure, see the AsInstance section below, ASD LCM RESTful Protocols for SO CNF Manager AsInstanceforCreateandQuery .

The caller of SO CNFM (in this case, BPMN Infra) need to use the return asInstanceId for invoking an AS Instance Instantiate.

...

Note: KeyValuePairs data type is typically realized as Hashmap or Hashtable

CreateAsRequest


Attribute NameData TypeCardinalityDescription

asdId

Identifier (UUID)1Identifier that identifies the ASD which defines the AS instance to be created.

asInstanceName

String0..1Human-readable name of the AS instance to be created.

asInstanceDescription

String0..1Human-readable description of the AS instance to be created.

additionalParams1, 2

KeyValuePairs0..1Additional input parameters for the Create AS process (this is a pace holder to hold any additional parameters for the orchestrator, such as CNFM)

Note: 

  1. The additional parameters can be passed to define custom values. All keys that are separated by dots are handled as separate values. Passing a value file content is under consideration. Special characters are allowed to represent \n, \., etc.
  2. The target cluster name could be passed thru additionalParams if the client wants to select the target cluster.

AsInstance (response)

see the AsInstance section below, ASD LCM RESTful Protocols for SO CNF Manager AsInstanceforCreateandQuery



Instantiate AS Instance Resource

Before SO CNFM invokes As Instance Instantiate, SO CNFM may need to query for an asInstance based on the asInstanceId parameter.

REST Interfaces

  • POST .../as_instances/{asInstanceId}/instantiate (InstantiateAsRequest)
  • 202 Accepted ()
  • Send asLcmOperationOccurrenceNotification (STARTING/PROCESSING/COMPLETED)
  • 200 OK (AsLcmOpOcc:operationState=COMPLETED)

InstantiateAsRequest


Attribute NameData TypeCardinalityDescription

asdExtCpdInputParams

ExtCpdParams

0..Ncontains ext cpd parameter instance-level values

deploymentItems2

DeploymentItems1..Ncontains lifecycle parameters for deploymentItems

additionalParams1, 32

KeyValuePairs0..1Additional input parameters for the instantiation Instantiate AS process (this is a pace holder to hold any additional parameters for the serverorchestrator, such as CNFM)

Note: 

  1. The additional parameters can be passed to define custom values. All keys that are separated by dots are handled as separate values. Passing a value file content is under consideration. Special characters are allowed to represent \n, \., etc.
  2. If some of the parameters required for instantiation are complex and cannot fit into the additionalParams section of the JSON request body, In this case, the deploymentItems can be used. 
  3. the The target cluster name could be passed thru additionalParams if the client wants to select the target cluster.

ExtCpdParams


extCpdId

UUID1identifier
loadbalancerIPString0..1contains the IP address to configure the loadBalancer of the K8s service or ingress controller that the ExtCpd represents

externalIPs

String0..N

contains external IPs


nadNamesString0..N

contains a list of nad names


nadNamespaceString0..1

contains a nad namespace


DeploymentItems


Attribute NameData TypeCardinalityDescription
deploymentItemIdIdentifier1Identifies which deploymentItem

lifecycleParameterKeyValues1

KeyValuesPairs0..Nprovides lifecycle parameter keys and values

Note: 

  1. provides instance-level key-value sets for the Helm Charts values file(s).

Terminate AS Instance Resource

The termination of an individual AS instance resource.

REST Interfaces

  • POST .../as_instances/{asInstanceId}/instantiate terminate (InstantiateAsRequestTerminateAsRequest)
  • 202 Accepted ()
  • Send asLcmOperationOccurrenceNotification (STARTING/PROCESSING/COMPLETED)
  • 200 OK (AsLcmOpOcc:operationState=COMPLETED)

TerminateAsRequest

Attribute NameData TypeCardinalityDescription
terminationTypeEnum1
  • FORCEFUL
  • GRACEFUL
gracefulTerminationTimeoutInteger0..1The unit is seconds
additionalParamsKeyValuePairs0..1Additional
parameters passed by the CNFM client
input parameters for the Terminate AS process (this is a pace holder to hold any additional parameters for the orchestrator, such as CNFM)

Delete AS Instance Resource

The deletion of an individual AS instance resource.

REST Interfaces

  • DELETE .../as_instances/{asInstanceId}
  • 204 No Content
  • // Send AsIdentifierDeletionNotification to Client

Update AS

TBD


Query Individual AS

REST Interfaces

  • GET .../as_instances/{asInstanceId}
  • 200 OK (AsInstance)

AsInstance for Create and Query

Attribute NameData TypeCardinalityDescription
asInstanceIdIdentifier1

Identifier of the AS instance

asInstanceNameString0..1Name of the AS instance. This attribute can be modified with the PATCH (i.e., update) method.
asInstanceDescriptionString0..1

Human-readable description of the AS instance.

This attribute can be modified with the PATCH method.

asdIdIdentifier1

Identifier of the

VNFD

ASD on which the

VNF instance

CNF instance is based.

asProvider
asVersion
String
Version1
Provider

Specifies the version of the

AS instance. 

Application.

asSchemaVersion

Version

1

Specifies the version of the ASD’s schema. The value is copied from the ASD.

asProductName

asProvider

String

1

Name to identify

Provider of the AS

product

instance.

The

 The value is copied from the ASD

?

.

asApplicationName

String

1

Name to identify the AS instance.

 asSchemaVersionVersion1Specifies the version of the ASD’s schema (if we modify an ASD field definition, add/remove field definitions, etc.)

 The value is copied from the ASD.

asApplicationVersion

Version

String

1

Specifies the version of the Application

(so, if software,DeploymentArtifacts , ASD values, ... change, this changes)

. The value is copied from the ASD.

asApplicationInfoNameString0..1

Human readable name for the Application service instance. The value is copied from the ASD.

asInfoDescriptionString0..1

Human readable description of the AS instance. The value is copied from the ASD.

asdExtCpd

datatype.ExtCpd0..N
Describes

Contains the externally exposed “instance-level” connection points of the application.

enhancedClusterCapabilitiesdatatype. enhancedClusterCapabilities0..N
A

Contains a list of  “instance-level” expected capabilities of the target Kubernetes cluster to aid placement of the application service on a suitable cluster.

deploymentItemsDeploymentItems1..N

Contains Deployment artifacts with “instance-level” lifecylceparmaeterKeyValues

instantiationState

String of Enum;

  • NON_INSTANTIATION,
  • INSTANTIATED
0..1

Indicates the current Instantiation State

instantiationAsInfo

datatype.instantiationAsInfo

0..1

Information specific to an instantiated AS Instance, such as STARTED, STOPPED

metadataobject (key value pair)0..1

represents a list of “instance-level” metadata key-value pairs

extensionsobject (key value pair)0..1

Additional AS-specific “instance-level” attributes that affect the lifecycle management of this AS instance

_linksdatatype._links0..1

Links to resources related to this resource, such as self, indicators, instantiate, terminate and operate URIs

asDeploymentNameString0..1

name of the deployment in the namespace (e.g., helm release name)

Note: once an app is deployed, the asDeploymentName is required

targetClusterString0..1target cluster name


datatype.instantiationAsInfo

Attribute NameData TypeCardinalityDescription
asState

String of Enum; 

  • STARTED
  • STOPPED
1

Identifier of the AS instance

localizationLanguageString0..1Information about localization language of the AS


Attribute NameData TypeCardinalityDescription
selfobject 0..1represents a link to a resource using an absolute URI
>hrefString1string formatted according to IETF RFC 3986
indicatorsobject0..1represents a link to a resource using an absolute URI
>hrefString1string formatted according to IETF RFC 3986
instantiateobject0..1represents a link to a resource using an absolute URI
>hrefString1string formatted according to IETF RFC 3986
terminateobject0..1represents a link to a resource using an absolute URI
>hrefString1string formatted according to IETF RFC 3986
operateobject0..1represents a link to a resource using an absolute URI
>hrefString1string formatted according to IETF RFC 3986

Register K8S Clusters

To instantiate an AS on an non-ONAP K8S cluster, a cluster configuration file that is specific to the cluster must be uploaded.

...

  • to verify the connectdion to the target cluster, run the following command from the ONAP K8S cluster
    • kubectl --kubeconfig ${PATH_TO_TARGET_CLUSTER_CONFIGURATION_FILE} get namespaces


Deregister K8S Clusters

To remove a cluster configruation file, create a DELETE request. .../aslcm/v1/clusterconfig/{configName}

...

The command returns the HTTP status code 204 No Content


List Registered K8S Clusters

To get details about registered clusters, create a GET request .../aslcm/v1/clusterconfigs

The API returns a paginated response, but if a customized response is needed, additional parameters for page, size, sor and filtering could be applied.

Swagger File

The following is ASD LCM Restful API Swagger file (work in progress)

  • View file
    nameASLifecycleManagement-API-
    v6.yaml
    v10.yaml
    height250


Kubernetes Resource Query


Get Nodes

GET /api/v1/nodes

with parameters

  • labelSelector
  • findSelector
  • resourceVersion


Based on the node label (which is not unique), get a node list. To narrow it further, use the additional findSelector parameter. 

Once we get target node(s), get node status.

Get Node Status

GET /api/v1/nodes/{name}/status


Query Cluster Capacity

Allocatable capacity of CPU and Memory from the target cluster could be discovered by SO CNFM (later this function could be moved to NFVO) using the K8S API (GET /api/v1/nodes/{name}/status).


Gliffy Diagram
macroIdecf320a1-624f-4ff9-abfb-b653f3078ccd
displayNamekubernetes Capacity diagram
namekubernetes Capacity diagram
pagePin2


NameDescriptionRequiredSchemaDefault
cluster_namename of Kubernetes ClustertrueString
namespacenamespacetrueString
node_namename of Kubernetes nodetrueString
capacityCapacity represents the total resources of a node.falseobject
allocatableAllocatable represents the resources of a node that are available for scheduling. Defaults to Capacityfalse

object

  • cpu
  • memory
  • storage

conditionsConditions is an array of current observed node conditions.falsev1.NodeCondition array
addressesList of addresses reachable to the node.falsev1.NodeAddresses array
daemonEndpointsEndpoints of daemons running on the Node.falsev1.NodeDaemonEndpoints
nodeInfoSet of ids/uuids to uniquely identify the node.falsev1.NodeSystemInfo
imagesList of container images on this nodefalsev1.ContainerImage array
volumesInUseList of attachable volumes in use (mounted) by the node.falsev1.UniqueVolumeName array
volumesAttachedList of volumes that are attached to the node.falsev1.AttachedVolume array


Query Cluster POD by name

  • kubectl get pods -o=name
  • kubectl get pods -o=name |  sed "s/^.\{4\}//" | grep <release name>
  • kubectl get pods --no-headers -o custom-columns=":metadata.name" | grep <release name>
  • kubectl get pod -A | grep <release name> | awk '{print $2}'.    // find a POD by release name
  • kubectl get --no-headers=true pods -o name | awk -F "/" '{print $2}'

Get PoD / container status

  • kubectl get pods <pod name> --no-headers -o custom-columns=":status.phase".     // check if pod is running or not
  • kubectl get pod <pod name>  --output="jsonpath={.status.containerStatuses[*].ready}".  // check if the container is ready, which is true


Others

  • kubectl get ns -A
  • kubectl get pods - n <namespace>
  • kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:.spec.nodeName
  • kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:.spec.nodeName | awk '{print $2}'.                                         // get the node name
  • kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:.spec.nodeName | grep <release name>.                               // get the pod and node names for release name
  • kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:.spec.nodeName | grep <release name> | awk '{print $2}'.  // get the node name for release name
  • kubectl describe pods <pod name>       // get a pod description
  • kubectl describe pods <pod name> | grep 'Container ID'.    // get container id(s) from a pod
  • kubectl get pod <pod name>  -o="custom-columns=NAME:.metadata.name,INIT-CONTAINERS:.spec.initContainers[*].name,CONTAINERS:.spec.containers[*].name".   // get pod, init-container and containers
  • kubectl get pods <pod name>  -o jsonpath='{range .spec.containers[*]}{.name}{"\n"}{end}'.   // get container name(s) from the pod name
  • kubectl exec -it <pod name> -c <container name> bash.  // access pod