2

I am trying to deploy WSO2 API Manager Operator on AWS EKS cluster following the doc [https://github.com/wso2/k8s-wso2am-operator][1]

But When I execute the command: kubectl apply -f scenarios/scenario-1/

I get the error: unable to recognize "scenarios\scenario-1\2-custom-pattern.yaml": no matches for kind "APIManager" in version "apim.wso2.com/v1alpha1"

How do I fix this error?

Ruby
  • 368
  • 1
  • 9

2 Answers2

1

This indicates that the CRDs are not deployed. Did you install the CRDs as explained here? The repo you are referring seems to be for APIM operator to deploy APIM. Rther you should be following API operator to deploy APIs. Following is the correct Github repo for the Operator.

Github : https://github.com/wso2/k8s-api-operator

ycr
  • 12,828
  • 2
  • 25
  • 45
  • So when trying to deploy the controller artifacts I get this error at the end. All other artifacts are getting deployed except these. **unable to recognize "artifacts\\operator-artifacts\\4-cluster-role-binding.yaml": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1" unable to recognize "artifacts\\operator-artifacts\\5-crd.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"** The output for kubectl get crd -A: **No Resources Found** – Ruby Jun 16 '22 at 12:29
  • What's your K8S version? – ycr Jun 16 '22 at 12:30
  • 1.21 is my k8s version – Ruby Jun 16 '22 at 12:36
  • @RubinaSheikh it seems you are using the old Operator. I updated my answer. Please have a look. – ycr Jun 16 '22 at 12:56
1

wso2am-operator is not tested in newer kubernetes versions (1.20+). Some of the kubernetes APIs used were deprecated even in previous versions and removed in v1.22[1]. Those include rbac.authorization.k8s.io/v1beta1 and apiextensions.k8s.io/v1beta1. The error you are seeing is because the custom resource for APIManager is not deployed properly.

The Operator should work if you try this on an older kubernetes version. However, it only supports APIM 3.2.0 (latest is APIM 4.1.0).

[1] - https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22

RrR-
  • 1,251
  • 3
  • 15
  • 32
  • okay.. I have tried the updated version of k8s api operator, and thats working in k8s 1.21. Thanks for your answer!! – Ruby Jun 16 '22 at 14:59
  • 1
    Just for your info, api-operator cannot be used to deploy API Manager. It has a different purpose. – RrR- Jun 16 '22 at 15:01
  • I have already deployed API Manager using Helm Resources. This is just an alternative I am trying. Thanks for your input.. – Ruby Jun 17 '22 at 05:28
  • What does it mean when you say it has a different purpose? How else can the APIM operator be used? Directly to deploy the integrations and APIs? – Ruby Jun 17 '22 at 07:29
  • 1
    API Operator is used to deploy APIs to already available APIM instance or a Choreo Connect instance or to deploy Integrations using MI. It cannot be used to deploy an APIM instance on k8s. – RrR- Jun 17 '22 at 07:37
  • I already have an APIM instance available. Does that mean that without the operator I cannot deploy the APIs? – Ruby Jun 17 '22 at 08:31
  • 1
    You can deploy APIs through APIM as usual. API Operator is another option to do it in a k8s scenario – RrR- Jun 17 '22 at 09:53