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: can i use annotation with custom crd apisixroute #2320

Open
MohamedKHALILRouissi opened this issue Nov 7, 2024 · 1 comment

Comments

@MohamedKHALILRouissi
Copy link

Issue description

apiVersion: apisix.apache.org/v2
kind: ApisixRoute

i set annotation for http https redirection but didnt work is it compatible with crd or with ingress only

Environment

  • your apisix-ingress-controller version (output of apisix-ingress-controller version --long):
  • your Kubernetes cluster version (output of kubectl version):
  • if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a):
@MichaelLLC
Copy link

MichaelLLC commented Dec 9, 2024

When using Ingress, you have two options:

  1. Use annotations:
annotations:
  k8s.apisix.apache.org/http-to-https: "true"
  1. Create an ApisixPluginConfig CRD and reference it via an annotation:
annotations:
  k8s.apisix.apache.org/plugin-config-name: "echo-and-cors-apc"

However, when using the ApisixRoute CRD, to enable HTTP to HTTPS redirection, you need to specify it in the spec as follows:

plugins:
  - config:
      http_to_https: true
    enable: true
    name: redirect

https://apisix.apache.org/docs/ingress-controller/concepts/annotations/

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