apk
apk copied to clipboard
API deployment failure due to reconciler error
Description: When attempting to deploy an API using the deployer approach, a reconciliation error is noticed within the adapter logs.
Steps to reproduce:
The following curl format was used for deploying the API. Refer to [1] for the apk-conf file and json file.
curl --location 'https://<host>:9095/api/deployer/1.0.0/apis/deploy' \
--header 'Host: <host>' \
--header 'Authorization: bearer <access-token>' \
--form 'apkConfiguration=@"path/to/EmployeeService.apk-conf"' \
--form 'definitionFile=@"path/to/EmployeeServiceDefinition.json"'
The following adapter log was noticed
2023-10-04 03:51:34 INFO [api_controller.go:222] - [dp.(*APIReconciler).Reconcile] [-] Reconciling for API default/5be9683b59c60816f0d6bf8debbc8f59610810df []
2023-10-04T03:51:34Z ERROR Reconciler error {"controller": "APIController", "object": {"name":"5be9683b59c60816f0d6bf8debbc8f59610810df","namespace":"default"}, "namespace": "default", "name": "5be9683b59c60816f0d6bf8debbc8f59610810df", "reconcileID": "b5e99606-44fc-486c-b13c-ae1b623a86e1", "error": "error while getting api definition file of api default/5be9683b59c60816f0d6bf8debbc8f59610810df in namespace : default with API UUID : 83275099-25cb-46d4-be43-588e38988930, error while getting swagger definition 5be9683b59c60816f0d6bf8debbc8f59610810df-definition in namespace :default, ConfigMap \"5be9683b59c60816f0d6bf8debbc8f59610810df-definition\" not found"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
/Users/ashera/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:324
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/Users/ashera/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:265
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
/Users/ashera/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:226
2023-10-04 03:51:34 WARN [api_controller.go:241] - [dp.(*APIReconciler).Reconcile] [-] Error retrieving ref CRs for API in namespace : default/5be9683b59c60816f0d6bf8debbc8f59610810df with API UUID : 83275099-25cb-46d4-be43-588e38988930, error while getting api definition file of api default/5be9683b59c60816f0d6bf8debbc8f59610810df in namespace : default with API UUID : 83275099-25cb-46d4-be43-588e38988930, error while getting swagger definition 5be9683b59c60816f0d6bf8debbc8f59610810df-definition in namespace :default, ConfigMap "5be9683b59c60816f0d6bf8debbc8f59610810df-definition" not found []
However, the said ConfigMap is available as per the below output
➜ ~ kubectl get cm 5be9683b59c60816f0d6bf8debbc8f59610810df-definition
NAME DATA AGE
5be9683b59c60816f0d6bf8debbc8f59610810df-definition 1 11h
Also, note that the kubectl get apis lists the newly created API. The output of this API is mentioned below:
apiVersion: dp.wso2.com/v1alpha1
kind: API
metadata:
creationTimestamp: "2023-10-04T03:51:34Z"
generation: 1
labels:
api-name: 6bbb002d62cca558cfc954a0ce64c4b3205d38f8
api-version: 91e95be6b6634e3c21072dfcd661146728694326
managed-by: apk
organization: 7505d64a54e061b7acd54ccd58b49dc43500b635
name: 5be9683b59c60816f0d6bf8debbc8f59610810df
namespace: default
resourceVersion: "1518394"
uid: 83275099-25cb-46d4-be43-588e38988930
spec:
apiName: AppSubTestAPI
apiType: REST
apiVersion: 1.0.0
basePath: /appsub/1.0.0
definitionFileRef: 5be9683b59c60816f0d6bf8debbc8f59610810df-definition
definitionPath: /api-definition
isDefaultVersion: false
organization: default
production:
- httpRouteRefs:
- 01ee6269-4ee8-150e-8513-aba53134d4ce
sandbox: null
systemAPI: false
status:
deploymentStatus:
accepted: true
events:
- '[2023-10-04 03:51:34.903422213 +0000 UTC m=+137.743611609] API is deployed
to the gateway.'
message: API is deployed to the gateway.
status: CREATED
transitionTime: "2023-10-04T03:51:34Z"
[1] Archive.zip