Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request help: apisixGlobalRoute 创建失败 #2031

Closed
towtooth opened this issue Nov 2, 2023 · 3 comments
Closed

request help: apisixGlobalRoute 创建失败 #2031

towtooth opened this issue Nov 2, 2023 · 3 comments

Comments

@towtooth
Copy link

towtooth commented Nov 2, 2023

Issue description

apiVersion: apisix.apache.org/v2
kind: ApisixGlobalRule
metadata:
  name: global
  namespace: ingress-apisix
spec:
  plugins:
  - name: limit-count
    enabled: true
    config:
      time_window": 60
      policy: "local"
      count: 2
      key: "remote_addr"
      rejected_code: 503  

这是我从官网抄的配置文件,在我apply这个文件的时候,得到了如下报错:

error: unable to recognize "a.yaml": no matches for kind "ApisixGlobalRule" in version "apisix.apache.org/v2"

Environment

  • your apisix-ingress-controller version (output of apisix-ingress-controller version --long):
  • Version: 1.7.0
    Git SHA: no-git-module
    Go Version: go1.20.8
    Building OS/Arch: linux/amd64
    Running OS/Arch: linux/amd64
  • your Kubernetes cluster version (output of kubectl version):Client Version:
  • version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.0", GitCommit:"c2b5237ccd9c0f1d600d3072634ca66cefdf272f", GitTreeState:"clean", BuildDate:"2021-08-04T18:03:20Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"24+", GitVersion:"v1.24.6-aliyun.1", GitCommit:"aec75b3b7aad2b964bb47d3ca2f64d609a358d40", GitTreeState:"clean", BuildDate:"2023-03-20T01:53:44Z", GoVersion:"go1.18.6", Compiler:"gc", Platform:"linux/amd64"}
    WARNING: version difference between client (1.22) and server (1.24) exceeds the supported minor version skew of +/-1
  • if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a):
@nayavu
Copy link
Contributor

nayavu commented Nov 3, 2023

If you installed ingress-controller via their Helm chart, you have to manually install CRDs as mentioned here.

Apply manifests from here. For example, to add ApisixGlobalRule, execute this:
kubectl apply -f https://raw.githubusercontent.com/apache/apisix-helm-chart/master/charts/apisix-ingress-controller/crds/ApisixGlobalRule.yaml

And after installing CRD you'll get another issue.
enabled: true field is incorrect, should be enable: true according to their CRD. It's a mistake in their docs.

@towtooth
Copy link
Author

towtooth commented Nov 3, 2023

If you installed ingress-controller via their Helm chart, you have to manually install CRDs as mentioned here.

Apply manifests from here. For example, to add ApisixGlobalRule, execute this: kubectl apply -f https://raw.githubusercontent.com/apache/apisix-helm-chart/master/charts/apisix-ingress-controller/crds/ApisixGlobalRule.yaml

And after installing CRD you'll get another issue. enabled: true field is incorrect, should be enable: true according to their CRD. It's a mistake in their docs.

Thanks a lot for helping,Here is the wrong content: https://apisix.apache.org/docs/ingress-controller/next/concepts/apisix_global_rule/#example

@towtooth towtooth closed this as completed Nov 3, 2023
@nayavu
Copy link
Contributor

nayavu commented Nov 3, 2023

Yep, I created a PR for that: #2032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants