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/05/07 05:29:06 UTC
[GitHub] [apisix-ingress-controller] shendongming opened a new issue, #1003: bug: plugin_config_name is disappeared
shendongming opened a new issue, #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003
### Issue description
apply example router
---
```yaml
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: hello-bar
namespace: test-api
spec:
http:
- backends:
- serviceName: hello-bar
servicePort: 80
match:
hosts:
- localhost
paths:
- /bar
name: bar
plugin_config_name: hello-bar
```
watch apisixroute
```shell
kubectl get apisixroute.apisix.apache.org/hello-bar -w -o yaml
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apisix.apache.org/v2beta3","kind":"ApisixRoute","metadata":{"annotations":{},"name":"hello-bar","namespace":"test-api"},"spec":{"http":[{"backends":[{"serviceName":"hello-bar","servicePort":80}],"match":{"hosts":["localhost"],"paths":["/bar"]},"name":"bar","plugin_config_name":"hello-bar"}]}}
creationTimestamp: "2022-05-07T05:20:02Z"
generation: 2
name: hello-bar
namespace: test-api
resourceVersion: "670366982"
uid: 4ac97625-ae3a-4238-982e-19d841aaadb9
spec:
http:
- backends:
- serviceName: hello-bar
servicePort: 80
match:
hosts:
- localhost
paths:
- /bar
name: bar
plugin_config_name: hello-bar
status:
conditions:
- message: Sync Successfully
observedGeneration: 1
reason: ResourcesSynced
status: "True"
type: ResourcesAvailable
---
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apisix.apache.org/v2beta3","kind":"ApisixRoute","metadata":{"annotations":{},"name":"hello-bar","namespace":"test-api"},"spec":{"http":[{"backends":[{"serviceName":"hello-bar","servicePort":80}],"match":{"hosts":["localhost"],"paths":["/bar"]},"name":"bar","plugin_config_name":"hello-bar"}]}}
creationTimestamp: "2022-05-07T05:20:02Z"
generation: 2
name: hello-bar
namespace: test-api
resourceVersion: "670366983"
uid: 4ac97625-ae3a-4238-982e-19d841aaadb9
spec:
http:
- backends:
- serviceName: hello-bar
servicePort: 80
match:
hosts:
- localhost
paths:
- /bar
name: bar
status:
conditions:
- message: Sync Successfully
observedGeneration: 2
reason: ResourcesSynced
status: "True"
type: ResourcesAvailable
```
### 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):
### Minimal test code / Steps to reproduce
1. create example yaml
2. kubectl apply -f hello-bar.yaml
3. kubectl get apisixroute.apisix.apache.org/hello-bar -w -o yaml
```yaml
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: hello-bar
namespace: test-api
spec:
http:
- backends:
- serviceName: hello-bar
servicePort: 80
match:
hosts:
- localhost
paths:
- /bar
name: bar
plugin_config_name: hello-bar
---
apiVersion: apisix.apache.org/v2beta3
kind: ApisixPluginConfig
metadata:
name: hello-bar
namespace: test-api
spec:
plugins:
- name: key-auth
enable: true
config:
"header": "APIKEY"
```
### Actual result
```shell
kubectl get apisixroute.apisix.apache.org/hello-bar -o yaml | kubectl neat
```
```yaml
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: hello-bar
namespace: test-api
spec:
http:
- backends:
- serviceName: hello-bar
servicePort: 80
match:
hosts:
- localhost
paths:
- /bar
name: bar
```
### Error log
```shell
kubectl describe apisixroute.apisix.apache.org/hello-bar
Name: hello-bar
Namespace: test-api
Labels: <none>
Annotations: <none>
API Version: apisix.apache.org/v2beta3
Kind: ApisixRoute
Metadata:
Creation Timestamp: 2022-05-07T05:20:02Z
Generation: 2
Resource Version: 670366983
UID: 4ac97625-ae3a-4238-982e-19d841aaadb9
Spec:
Http:
Backends:
Service Name: hello-bar
Service Port: 80
Match:
Hosts:
localhost
Paths:
/bar
Name: bar
Status:
Conditions:
Message: Sync Successfully
Observed Generation: 2
Reason: ResourcesSynced
Status: True
Type: ResourcesAvailable
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ResourcesSynced 7m51s (x4 over 7m58s) ApisixIngress ApisixIngress synced successfully
```
### Expected result
```yaml
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: hello-bar
namespace: test-api
spec:
http:
- backends:
- serviceName: hello-bar
servicePort: 80
match:
hosts:
- localhost
paths:
- /bar
name: bar
plugin_config_name: hello-bar
```
--
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] tao12345666333 commented on issue #1003: bug: plugin_config_name is disappeared
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1120211902
What's your APISIX Ingress controller version?
--
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] AlinsRan commented on issue #1003: bug: plugin_config_name is disappeared
Posted by "AlinsRan (via GitHub)" <gi...@apache.org>.
AlinsRan commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1449160092
I mean to use admin-api to check. I use CRDs here. My operation steps are basically the same as yours. The same is true for crds configuration. Otherwise, it is meaningless to repeat.
--
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] renatomattos2912 commented on issue #1003: bug: plugin_config_name is disappeared
Posted by "renatomattos2912 (via GitHub)" <gi...@apache.org>.
renatomattos2912 commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1446341568
Hi Everyone, im having the same problem, but im running all the latest versions of helm and apisix and ingress controller, so the solution pointed here is not working in my case. The strange part is that the ApisixPluginConfig is synced normally and ApisixRoute too, but the plugin_config_name is ignored in route, no errors, but no bound too between plugin config and route.
--
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] renatomattos2912 commented on issue #1003: bug: plugin_config_name is disappeared
Posted by "renatomattos2912 (via GitHub)" <gi...@apache.org>.
renatomattos2912 commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1452407568
> ```yaml
> apiVersion: apisix.apache.org/v2
> kind: ApisixPluginConfig
> metadata:
> name: public-endpoints
> spec:
> plugins:
> - name: cors
> enable: true
> config:
> allow_origins: http://localhost:3000
> allow_credential: true
> allow_methods: "**"
> allow_headers: "**"
> expose_headers: "**"
> ---
> apiVersion: apisix.apache.org/v2
> kind: ApisixRoute
> metadata:
> name: route-test
> spec:
> http:
> - name: rule1
> match:
> hosts:
> - localhost
> paths:
> - /test
> methods:
> - OPTIONS
> - GET
> backends:
> - serviceName: httpbin
> servicePort: 80
> plugin_config_name: public-endpoints
> ```
>
> I mean to use admin-api to check. I use CRDs here. My operation steps are basically the same as yours. The same is true for crds configuration. Otherwise, it is meaningless to repeat.
Got it, but yes, here it works in the API but not in the CRD. Are you using the same versions as mine for ingress controller, apisix e etc? If dont, please send me your versions, so i can try here.
--
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] shendongming commented on issue #1003: bug: plugin_config_name is disappeared
Posted by GitBox <gi...@apache.org>.
shendongming commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1120613319
apisix helm chart version
apisix-0.9.1
docker image: apache/apisix-ingress-controller:1.4.0
--
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 #1003: bug: plugin_config_name is disappeared
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1127366967
Thanks for your report.
In fact this is because the ApisixPluginConfig function is only available for APIs above v2beta3.
However, this configuration has not been updated to the latest version in the Helm chart, so after using this function, the data will be transformed, resulting in the loss of unsupported fields.
https://github.com/apache/apisix-helm-chart/blob/1ff18f1efde9b59bda2a670aae085db6d06e40d0/charts/apisix-ingress-controller/values.yaml#L115-L117
I will fix it in the Helm chart.
--
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] AlinsRan commented on issue #1003: bug: plugin_config_name is disappeared
Posted by "AlinsRan (via GitHub)" <gi...@apache.org>.
AlinsRan commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1447489010
Hi @renatomattos2912
I think you can call admin-api to check. I repeat your steps. It works.
```shell
apisix@apisix-5659f6c47f-rpsjl:/usr/local/apisix$ curl http://127.0.0.1:9180/apisix/admin/plugin_configs -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
{"total":1,"list":[{"key":"\/apisix\/plugin_configs\/8c7b63c3","createdIndex":15,"value":{"update_time":1677552309,"plugins":{"cors":{"max_age":5,"allow_methods":"**","allow_headers":"**"
,"expose_headers":"**","allow_origins":"http:\/\/localhost:3000","allow_credential":true}},"desc":"Created by apisix-ingress-controller, DO NOT modify it manually","id":"8c7b63c3","create
_time":1677552262,"labels":{"managed-by":"apisix-ingress-controller"},"name":"default_public-endpoints"},"modifiedIndex":22}]}
apisix@apisix-5659f6c47f-rpsjl:/usr/local/apisix$ curl http://127.0.0.1:9180/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
{"total":1,"list":[{"key":"\/apisix\/routes\/3d52f609","createdIndex":17,"value":{"hosts":["localhost"],"priority":0,"desc":"Created by apisix-ingress-controller, DO NOT modify it manuall
y","labels":{"managed-by":"apisix-ingress-controller"},"uris":["\/test"],"status":1,"update_time":1677552309,"plugin_config_id":"8c7b63c3","name":"default_route-test_rule1","id":"3d52f609
","create_time":1677552276,"upstream_id":"5ce57b8e","methods":["OPTIONS","GET"]},"modifiedIndex":25}]}
```
--
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] zhangyihong commented on issue #1003: bug: plugin_config_name is disappeared
Posted by GitBox <gi...@apache.org>.
zhangyihong commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1127142079
i have same problem!
apisix helm chart version
apisix-0.9.3
apache/apisix-ingress-controller:1.4.1
```
apiVersion: apisix.apache.org/v2beta3
kind: ApisixPluginConfig
metadata:
name: plugin-config
namespace: default
spec:
plugins:
- name: gzip
enable: true
config:
types: "*"
---
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: tmp
spec:
http:
- name: httpbin
match:
hosts:
- httpbin.80166.com
paths:
- "/*"
plugin_config_name: plugin-config
backends:
- serviceName: httpbin
servicePort: 8080
```
```
kubectl get ar tmp -o yaml
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apisix.apache.org/v2beta3","kind":"ApisixRoute","metadata":{"annotations":{},"name":"tmp","namespace":"default"},"spec":{"http":[{"backends":[{"serviceName":"httpbin","servicePort":8080}],"match":{"hosts":["httpbin.80166.com"],"paths":["/*"]},"name":"httpbin","plugin_config_name":"plugin-config"}]}}
creationTimestamp: "2022-05-16T02:01:48Z"
generation: 1
name: tmp
namespace: default
resourceVersion: "343729050"
uid: bd01a97c-fa47-464f-9ad4-93cffeb1d6ee
spec:
http:
- backends:
- serviceName: httpbin
servicePort: 8080
match:
hosts:
- httpbin.80166.com
paths:
- /*
name: httpbin
status:
conditions:
- message: Sync Successfully
observedGeneration: 1
reason: ResourcesSynced
status: "True"
type: ResourcesAvailable
```
--
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] renatomattos2912 commented on issue #1003: bug: plugin_config_name is disappeared
Posted by "renatomattos2912 (via GitHub)" <gi...@apache.org>.
renatomattos2912 commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1448142628
> Hi @renatomattos2912 I think you can call admin-api to check. I repeat your steps. It works.
>
> ```shell
> apisix@apisix-5659f6c47f-rpsjl:/usr/local/apisix$ curl http://127.0.0.1:9180/apisix/admin/plugin_configs -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
>
> {"total":1,"list":[{"key":"\/apisix\/plugin_configs\/8c7b63c3","createdIndex":15,"value":{"update_time":1677552309,"plugins":{"cors":{"max_age":5,"allow_methods":"**","allow_headers":"**"
> ,"expose_headers":"**","allow_origins":"http:\/\/localhost:3000","allow_credential":true}},"desc":"Created by apisix-ingress-controller, DO NOT modify it manually","id":"8c7b63c3","create
> _time":1677552262,"labels":{"managed-by":"apisix-ingress-controller"},"name":"default_public-endpoints"},"modifiedIndex":22}]}
>
> apisix@apisix-5659f6c47f-rpsjl:/usr/local/apisix$ curl http://127.0.0.1:9180/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
>
> {"total":1,"list":[{"key":"\/apisix\/routes\/3d52f609","createdIndex":17,"value":{"hosts":["localhost"],"priority":0,"desc":"Created by apisix-ingress-controller, DO NOT modify it manuall
> y","labels":{"managed-by":"apisix-ingress-controller"},"uris":["\/test"],"status":1,"update_time":1677552309,"plugin_config_id":"8c7b63c3","name":"default_route-test_rule1","id":"3d52f609
> ","create_time":1677552276,"upstream_id":"5ce57b8e","methods":["OPTIONS","GET"]},"modifiedIndex":25}]}
> ```
Hi @AlinsRan, in API it works, but my problem is using CRDs, cause im using terraform to apply this CRDs and automate my infra.
--
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] AlinsRan commented on issue #1003: bug: plugin_config_name is disappeared
Posted by "AlinsRan (via GitHub)" <gi...@apache.org>.
AlinsRan commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1480583271
@renatomattos2912 Is the same version
Helm: apisix-1.1.1
APISIX: 3.1.0-debian
Controller: 1.6.0
--
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 closed issue #1003: bug: plugin_config_name is disappeared
Posted by GitBox <gi...@apache.org>.
tao12345666333 closed issue #1003: bug: plugin_config_name is disappeared
URL: https://github.com/apache/apisix-ingress-controller/issues/1003
--
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 #1003: bug: plugin_config_name is disappeared
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1127607404
New version of Helm chart has been released, please upgrade to the latest Helm chart or modify the configuration in configmap. Thanks
--
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 #1003: bug: plugin_config_name is disappeared
Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #1003:
URL: https://github.com/apache/apisix-ingress-controller/issues/1003#issuecomment-1480594102
Please don't reply on the closed issue. You can discuss in #1693
--
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