You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/08/03 09:00:40 UTC
[GitHub] [apisix-ingress-controller] akalittle opened a new issue, #1208: help request: how to define public-api in ApisixRoute CRD
akalittle opened a new issue, #1208:
URL: https://github.com/apache/apisix-ingress-controller/issues/1208
### Description
Here below is my yaml file of CRD `ApisixRoute`
I want to implement keyAuth
but some path will should be excluded to the keyAuth
But the config below didn't work.
```
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: status-tracker
namespace: launcher
spec:
http:
- name: status-tracker-rule
match:
hosts:
- api.xxx.cc
paths:
- /status-tracker*
plugins:
- name: proxy-rewrite
enable: true
config:
regex_uri:
- ^/status-tracker/(.*)
- /$1
- name: public-api
enable: true
config:
uri: /metrics
backends:
- serviceName: status-tracker
servicePort: 8000
authentication:
enable: true
type: keyAuth
keyAuth:
header: Authentication
```
### Environment
apache/apisix:2.15.0-alpine
apache/apisix-ingress-controller:1.4.1
docker.io/bitnami/etcd:3.5.4-debian-11-r14
Kubernetes cluster version:
Client Version: v1.24.0
Kustomize Version: v4.5.4
Server Version: v1.21.12-gke.2200
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] github-actions[bot] commented on issue #1208: help request: how to define public-api in ApisixRoute CRD
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #1208:
URL: https://github.com/apache/apisix-ingress-controller/issues/1208#issuecomment-1368316446
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1208: help request: how to define public-api in ApisixRoute CRD
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1208:
URL: https://github.com/apache/apisix-ingress-controller/issues/1208#issuecomment-1235102035
Sorry for delay.
Your scenario doesn't need to be done using public-api
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] akalittle commented on issue #1208: help request: how to define public-api in ApisixRoute CRD
Posted by GitBox <gi...@apache.org>.
akalittle commented on issue #1208:
URL: https://github.com/apache/apisix-ingress-controller/issues/1208#issuecomment-1204673384
Hey, the yaml above of mine is to explain:
I have a service proxy all `/status/*` to the service
However, I just want to expose `/status/metrics` to public without keyauth.
Can I finish this in one yaml config ?
I've tried to seperate this to two file
```
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: status-tracker
namespace: launcher
spec:
http:
- name: status-tracker-rule
match:
hosts:
- api.xxx.cc
paths:
- /status-tracker*
plugins:
- name: proxy-rewrite
enable: true
config:
regex_uri:
- ^/status-tracker/(.*)
- /$1
backends:
- serviceName: status-tracker
servicePort: 8000
authentication:
enable: true
type: keyAuth
keyAuth:
header: Authentication
```
```
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: status-tracker-public
namespace: launcher
spec:
http:
- name: status-tracker-public
match:
hosts:
- api.xxx.cc
paths:
- /status-tracker/metrics
plugins:
- name: proxy-rewrite
enable: true
config:
uri: /metrics
- name: public-api
enable: true
backends:
- serviceName: status-tracker
servicePort: 8000
authentication:
enable: false
```
But when I visit `api.xxx.cc/status-tracker/metrics`
It also responsed `{"message":"Missing API key found in request"}`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1208: help request: how to define public-api in ApisixRoute CRD
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1208:
URL: https://github.com/apache/apisix-ingress-controller/issues/1208#issuecomment-1204273020
you can refer to this one.
https://github.com/apache/apisix-ingress-controller/blob/cccad72a1e0ef60525c69371b4b27c4598c587c1/test/e2e/suite-features/global_rule.go#L44-L61
If you don't understand how public-api works, then you can go to APISIX documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] github-actions[bot] closed issue #1208: help request: how to define public-api in ApisixRoute CRD
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #1208: help request: how to define public-api in ApisixRoute CRD
URL: https://github.com/apache/apisix-ingress-controller/issues/1208
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] github-actions[bot] commented on issue #1208: help request: how to define public-api in ApisixRoute CRD
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #1208:
URL: https://github.com/apache/apisix-ingress-controller/issues/1208#issuecomment-1334651878
This issue has been marked as stale due to 90 days of inactivity. It will be closed in 30 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org