5 Validating CNCC Core Configuration

A pre install hook named Validation-hook is introduced for validating M-CNCC Core and A-CNCC Core helm configurations.

Validation hook pod will be auto deleted if validation succeeds, in case of failure pod status shows as Error.

In case of Validation hook errors, refer log for the following listed error codes:

Table 5-1 Validation Hook Errors

Error Code Error Message Format Error Scenarios Sample Error Messages
1002 Duplicate value. Resource: <Configuration Name>, ID: <ID>, Attribute: <Attribute>. <More Info>
  • All A-CNCC IDs must be unique
  • API prefix must be unique for all instances
  • Owner(Cluster) must have unique CS subtype
Duplicate value(s). Resource: aCncc, ID: [Cluster3], Attribute: id.
1003 Invalid Reference. Resource: <Configuration Name>, ID: <ID>, Attribute: <Attribute>. <More Info>
  • All the Instance owners must be referenced in M-CNCC IAM IDs or A-CNCC IDs
  • M-CNCC IAM IDs and M-CNCC Core IDs must be same
  • Invalid Reference. Resource: instance, ID: Cluster5, Attribute: Owner. Not present in mCncc ids or aCncc ids.
  • Invalid Reference. Resource: instance, ID: N/A, Attribute: N/A. M-Cncc Iam ids and M-Cncc Core ids do not match.
1001 Invalid value. Resource: <Configuration Name>, ID: <ID>, Attribute: <Attribute>. <More Info>
  • Port should be Numeric
  • Scheme should be either HTTP/HTTPS
  • IDs should follow the alphanumeric pattern
  • Max Limit should be satisfied for M-CNCC IAM, A-CNCC and Instance
  • Max Length for Instance Id
  • Max Length for Self Cncc Id
  • CS instance must have one of these CS subtypes <grafana, kibana, jaeger, prometheus, alertmanager>
  • Both ip and fqdn cannot be provided.
  • Unsupported type
  • InvalidConfig
  • multicluster flag should be false in case of single-cluster deployment
    • cncc-iam, mcncc-core, acncc-core flags should be set to true
  • multicluster flag should be true in case of multi cluster deployment
    • Multi Cluster(manager only) - cncc-iam, mcncc-cncc should be set to true and acncc-core should be set to false
    • Multi Cluster(managing local NF's) - cncc-iam, mcncc-cncc and acncc-core should be set to true.
    • Multi cluster(agent only) - cncc-iam, mcncc-cncc should be set to false and acncc-core should be set to true
  • multicluster flag should be false in case of single-cluster deployment
  • multicluster flag should be true in case of multi-cluster deployment
  • Invalid value. Resource: mCnccIam, ID: Cluster1, Attribute: Port. It should be numeric value.
  • Invalid value. Resource: instance, ID: Cluster3-instance1, Attribute: Scheme. Allowed values are: [http, https].
  • Invalid value. Resource: instance, ID: Cluster1-grafana##$$%, Attribute: id. Ids should be alphanumeric with hyphen allowed as special character.
  • The count of mCnccIam exceeded max limit. Allowed Value:x. Actual Value: y.
  • Max limit exceeded. Allowed Value:x. Actual Value: y.
  • Invalid value. Resource: aCncc, ID: Cluster3, Attribute: N/A. Both ip and fqdn cannot be provided.
  • Invalid value. Resource: isMultiClusterEnabled, ID:,Attribute: False.
  • isMultiClusterEnabled is set as false, only single cluster configuration is allowed. Verify cncc-iam, mcncc-core, acncc-core configuration values.
  • Invalid value. Resource: isMultiClusterEnabled, ID:,Attribute: True.
  • isMultiClusterEnabled is set as true, only multi cluster configuration is allowed. Verify cncc-iam, mcncc-core, acncc-core configuration values.
  • Invalid value. Resource: isMultiClusterEnabled, ID:,Attribute: False.
  • isMultiClusterEnabled is set as false, only single cluster configuration is allowed.
  • Invalid value. Resource: isMultiClusterEnabled, ID:,Attribute: True.
  • isMultiClusterEnabled is set as true, only multi cluster configuration is allowed.
1004 Missing value. Resource: <Configuration Name>, ID: <ID>, Attribute: <Attribute>. <More Info>
  • Missing apiPrefix parameter for type CS
  • Either of IP/FQDN should be present(Manager)
  • SelfCnccId should be present
  • Missing value. Resource: instance, ID: Cluster4-grafana, Attribute: apiPrefix.
  • Missing value. Resource: instance, ID: Cluster3-PolicyInstance, Attribute: N/A. Either ip or fqdn is required.

Validation hook Microservices and Logs

Validation-hook Microservice for M-CNCC Core

This section explains about Validation-hook Microservice for M-CNCC Core and A-CNCC Core.


NAME                                          READY   STATUS  RESTARTS   AGE
cncc-mcore-ingress-gateway-pre-install-rfpjq   0/1 Completed   0        40s
cncc-mcore-validation-hook-zt78c               0/1 Completed   0        24s

Validation hook Logs

In case of validation hook error, check logs for the error details.


NAME                                          READY   STATUS  RESTARTS   AGE
cncc-mcore-validation-hook-zt78c               0/1     Error      0   24s

Example:

kubectl logs -f cncc-mcore-validation-hook-zt78c -n cncc

Sample Validationhook Logs

{
   "instant":{
      "epochSecond":1628155229,
      "nanoOfSecond":4094479
   },
   "thread":"main",
   "level":"ERROR",
   "loggerName":"com.oracle.cgbu.cne.cncc.core.Multi-ClusterConfigValidation",
   "message":"{\"type\":null,\"title\":\"Bad Request\",\"status\":400,\"detail\":\"[{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1001,\\\"detail\\\":\\\"Invalid value. Resource: instance, ID: Cluster1-grafana, Attribute: N/A. Both ip and fqdn cannot be provided.\\\",\\\"instance\\\":null,\\\"cause\\\":null},{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1001,\\\"detail\\\":\\\"Invalid value. Resource: instance, ID: Cluster3-policy-instance, Attribute: Port. It should be numeric value.\\\",\\\"instance\\\":null,\\\"cause\\\":null},{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1004,\\\"detail\\\":\\\"Missing value. Resource: Instance, ID: Cluster3-grafana, Attribute: apiPrefix. \\\",\\\"instance\\\":null,\\\"cause\\\":null}]\",\"instance\":null,\"cause\":null}",
   "endOfBatch":false,
   "loggerFqcn":"org.apache.logging.log4j.spi.AbstractLogger",
   "contextMap":{
       
   },
   "threadId":1,
   "threadPriority":5,
   "messageTimestamp":"2021-08-05T09:20:29.004+0000",
   "application":"cncc",
   "engineering_version":"1.8.0",
   "marketing_version":"1.0.0",
   "microservice":"cncc-mcore-validation-hook",
   "cluster":"cncc-mcore",
   "namespace":"cncc",
   "node":"master",
   "pod":"cncc-mcore-validation-hook-zt78c"
}

Validation-hook Microservice for A-CNCC Core


NAME                                          READY   STATUS  RESTARTS   AGE
cncc-acore-ingress-gateway-pre-install-rfpjq   0/1 Completed   0        40s
cncc-acore-validation-hook-zt78c               0/1 Completed   0        24s

Validation hook Logs

In case of validation hook error, check logs for the error details.


NAME                                          READY   STATUS  RESTARTS   AGE
cncc-acore-validation-hook-zt78c               0/1     Error      0   24s

Example:

kubectl logs -f cncc-acore-validation-hook-zt78c -n cncc

Sample Validationhook Logs

{
   "instant":{
      "epochSecond":1628155569,
      "nanoOfSecond":4076479
   },
   "thread":"main",
   "level":"ERROR",
   "loggerName":"com.oracle.cgbu.cne.cncc.core.Multi-ClusterConfigValidation",
   "message":"{\"type\":null,\"title\":\"Bad Request\",\"status\":400,\"detail\":\"[{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1001,\\\"detail\\\":\\\"Invalid value. Resource: instance, ID: Cluster1-grafana, Attribute: N/A. Both ip and fqdn cannot be provided.\\\",\\\"instance\\\":null,\\\"cause\\\":null},{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1001,\\\"detail\\\":\\\"Invalid value. Resource: instance, ID: Cluster3-policy-instance, Attribute: Port. It should be numeric value.\\\",\\\"instance\\\":null,\\\"cause\\\":null},{\\\"type\\\":null,\\\"title\\\":\\\"Validation Error\\\",\\\"status\\\":1004,\\\"detail\\\":\\\"Missing value. Resource: Instance, ID: Cluster3-grafana, Attribute: apiPrefix. \\\",\\\"instance\\\":null,\\\"cause\\\":null}]\",\"instance\":null,\"cause\":null}",
   "endOfBatch":false,
   "loggerFqcn":"org.apache.logging.log4j.spi.AbstractLogger",
   "contextMap":{
       
   },
   "threadId":1,
   "threadPriority":5,
   "messageTimestamp":"2021-08-05T09:20:29.004+0000",
   "application":"cncc",
   "engineering_version":"1.8.0",
   "marketing_version":"1.0.0",
   "microservice":"cncc-acore-validation-hook",
   "cluster":"cncc-acore",
   "namespace":"cncc",
   "node":"master",
   "pod":"cncc-acore-validation-hook-zt78c"
}