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 2021/08/23 10:23:05 UTC
[GitHub] [apisix-ingress-controller] lgy1027 opened a new issue #646: request help: k8s中删除router,未触发admin删除的请求
lgy1027 opened a new issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646
ingress-controller版本:0.6.0
部署ar,controller日志报错
````
2021-08-23T18:16:33+08:00 error ingress/status.go:114 unsupported resource record: &{{ } {httpbin-route lgy /apis/apisix.apache.org/v2beta1/namespaces/lgy/apisixroutes/httpbin-route a5d3b496-5f51-475e-88ca-149759a37f29 4388292 %!s(int64=1) 2021-08-23 18:16:32 +0800 HKT <nil> %!s(*int64=<nil>) map[] map[kubectl.kubernetes.io/last-applied-configuration:{"apiVersion":"apisix.apache.org/v2beta1","kind":"ApisixRoute","metadata":{"annotations":{},"name":"httpbin-route","namespace":"lgy"},"spec":{"http":[{"backends":[{"serviceName":"httpbin","servicePort":80}],"match":{"hosts":["local.httpbin.org"],"paths":["/*"]},"name":"httpbin"}]}}
] [] [] [{kubectl-client-side-apply Update apisix.apache.org/v2beta1 2021-08-23 18:16:32 +0800 HKT FieldsV1 {"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}}},"f:spec":{".":{},"f:http":{}}}}]} {[{httpbin %!s(int=0) {[/*] [] [local.httpbin.org] [] []} { {%!s(intstr.Type=0) %!s(int32=0) } %!s(*int=<nil>) } [{httpbin {%!s(intstr.Type=0) %!s(int32=80) } %!s(*int=<nil>) }] %!s(bool=false) [] {%!s(bool=false) {}}}] []} {[]}}
````
删除ar时controller未触发调用apisix admin的删除请求
--
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] lgy1027 edited a comment on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
lgy1027 edited a comment on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-903665930
> @lgy1027 Please use the latest version of ingress-controller,now it is 1.2.0
现在不报错了,直接build1.2镜像,但是我在使用client创建router时还是报错
````
ApisixRoute.apisix.apache.org "httpbin-route" is invalid: [<nil>: Invalid value: "": "spec.http" must validate one and only one schema (oneOf). Found 2 valid alternatives, spec.http.authentication.type: Unsupported value: "": supported values: "basicAuth", "keyAuth", spec.http.backend.serviceName: Invalid value: "": spec.http.backend.serviceName in body shouldbe at least 1 chars long, spec.http.backend.servicePort: Invalid value: 0: spec.http.backend.servicePort in body should be greater than or equal to 1, spec.http.backend.weight: Invalid value: "null": spec.http.backend.weight in body mustbe of type integer: "null"]
````
代码如下:
````
import "github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/clientset/versioned"
client,err = versioned.NewForConfig(config)
func BuildRoute() {
w := int(100)
v2b := &v2beta1.ApisixRoute{
TypeMeta: metav1.TypeMeta{
Kind:"ApisixRoute",
APIVersion:"apisix.apache.org/v2beta1",
},
ObjectMeta:metav1.ObjectMeta{
Name: "httpbin-route",
Namespace: "lgy",
},
Spec: v2beta1.ApisixRouteSpec{
HTTP:[]v2beta1.ApisixRouteHTTP{
v2beta1.ApisixRouteHTTP{
Name: "httpbin",
Match: v2beta1.ApisixRouteHTTPMatch{
Hosts: []string{"local.httpbin.org"},
Paths: []string{"/*"},
},
Backends: []v2alpha1.ApisixRouteHTTPBackend{
v2alpha1.ApisixRouteHTTPBackend{
ServiceName: "httpbin",
ServicePort: intstr.IntOrString{
Type: intstr.Int,
IntVal: 80,
},
Weight:&w,
},
},
},
},
},
}
_, err := client.ApisixV2beta1().ApisixRoutes("lgy").Create(context.Background(),v2b,v1.CreateOptions{})
fmt.Println(err)
}
````
apisix-ingress-controller引得依赖是1.2.0的版本
````
require (
bou.ke/monkey v1.0.2
github.com/apache/apisix-ingress-controller v1.2.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] lgy1027 commented on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
lgy1027 commented on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-903665930
> @lgy1027 Please use the latest version of ingress-controller,now it is 1.2.0
helm仓库没有1.2.0,我直接打1.2.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] gxthrj commented on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
gxthrj commented on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-904505861
Close this issue, Please discuss the problem with GRPC configuration in #648 .
--
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] gxthrj commented on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
gxthrj commented on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-903647079
@lgy1027 Please use the latest version of ingress-controller,now it is 1.2.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] gxthrj commented on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
gxthrj commented on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-904499616
@lgy1027 Please show us the config of ApisixRoute,ApisixTls,ApisixUpstream resources. And the error log in APISIX when you test GRPC.
--
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] gxthrj closed issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
gxthrj closed issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646
--
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] tokers commented on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-904273394
> > @lgy1027 Please use the latest version of ingress-controller,now it is 1.2.0
>
> 现在不报错了,直接build1.2镜像,但是我在使用client创建router时还是报错
>
> ```
> ApisixRoute.apisix.apache.org "httpbin-route" is invalid: [<nil>: Invalid value: "": "spec.http" must validate one and only one schema (oneOf). Found 2 valid alternatives, spec.http.authentication.type: Unsupported value: "": supported values: "basicAuth", "keyAuth", spec.http.backend.serviceName: Invalid value: "": spec.http.backend.serviceName in body shouldbe at least 1 chars long, spec.http.backend.servicePort: Invalid value: 0: spec.http.backend.servicePort in body should be greater than or equal to 1, spec.http.backend.weight: Invalid value: "null": spec.http.backend.weight in body mustbe of type integer: "null"]
> ```
>
> 代码如下:
>
> ```
> import "github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/clientset/versioned"
>
> client,err = versioned.NewForConfig(config)
>
> func BuildRoute() {
> w := int(100)
> v2b := &v2beta1.ApisixRoute{
> TypeMeta: metav1.TypeMeta{
> Kind:"ApisixRoute",
> APIVersion:"apisix.apache.org/v2beta1",
> },
> ObjectMeta:metav1.ObjectMeta{
> Name: "httpbin-route",
> Namespace: "lgy",
> },
> Spec: v2beta1.ApisixRouteSpec{
> HTTP:[]v2beta1.ApisixRouteHTTP{
> v2beta1.ApisixRouteHTTP{
> Name: "httpbin",
> Match: v2beta1.ApisixRouteHTTPMatch{
> Hosts: []string{"local.httpbin.org"},
> Paths: []string{"/*"},
> },
> Backends: []v2alpha1.ApisixRouteHTTPBackend{
> v2alpha1.ApisixRouteHTTPBackend{
> ServiceName: "httpbin",
> ServicePort: intstr.IntOrString{
> Type: intstr.Int,
> IntVal: 80,
> },
> Weight:&w,
> },
> },
> },
> },
> },
>
> }
> _, err := client.ApisixV2beta1().ApisixRoutes("lgy").Create(context.Background(),v2b,v1.CreateOptions{})
> fmt.Println(err)
> }
> ```
>
> apisix-ingress-controller引得依赖是1.2.0的版本
>
> ```
> require (
> bou.ke/monkey v1.0.2
> github.com/apache/apisix-ingress-controller v1.2.0
> ```
>
> 使用kubectl apply -f yaml 没问题
If I am correct, I have said that the data structure defined for ApisixRoute is not suitable to create objects programmatically.
There are some details that need to be fixed.
Here you may marshal the `v2b` and compare it with the YAML configuration and see the differences.
--
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] gxthrj commented on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
gxthrj commented on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-904504644
related to #648
--
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] lgy1027 commented on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
lgy1027 commented on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-904289813
> > > @lgy1027 Please use the latest version of ingress-controller,now it is 1.2.0
> >
> >
> > 现在不报错了,直接build1.2镜像,但是我在使用client创建router时还是报错
> > ```
> > ApisixRoute.apisix.apache.org "httpbin-route" is invalid: [<nil>: Invalid value: "": "spec.http" must validate one and only one schema (oneOf). Found 2 valid alternatives, spec.http.authentication.type: Unsupported value: "": supported values: "basicAuth", "keyAuth", spec.http.backend.serviceName: Invalid value: "": spec.http.backend.serviceName in body shouldbe at least 1 chars long, spec.http.backend.servicePort: Invalid value: 0: spec.http.backend.servicePort in body should be greater than or equal to 1, spec.http.backend.weight: Invalid value: "null": spec.http.backend.weight in body mustbe of type integer: "null"]
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 代码如下:
> > ```
> > import "github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/clientset/versioned"
> >
> > client,err = versioned.NewForConfig(config)
> >
> > func BuildRoute() {
> > w := int(100)
> > v2b := &v2beta1.ApisixRoute{
> > TypeMeta: metav1.TypeMeta{
> > Kind:"ApisixRoute",
> > APIVersion:"apisix.apache.org/v2beta1",
> > },
> > ObjectMeta:metav1.ObjectMeta{
> > Name: "httpbin-route",
> > Namespace: "lgy",
> > },
> > Spec: v2beta1.ApisixRouteSpec{
> > HTTP:[]v2beta1.ApisixRouteHTTP{
> > v2beta1.ApisixRouteHTTP{
> > Name: "httpbin",
> > Match: v2beta1.ApisixRouteHTTPMatch{
> > Hosts: []string{"local.httpbin.org"},
> > Paths: []string{"/*"},
> > },
> > Backends: []v2alpha1.ApisixRouteHTTPBackend{
> > v2alpha1.ApisixRouteHTTPBackend{
> > ServiceName: "httpbin",
> > ServicePort: intstr.IntOrString{
> > Type: intstr.Int,
> > IntVal: 80,
> > },
> > Weight:&w,
> > },
> > },
> > },
> > },
> > },
> >
> > }
> > _, err := client.ApisixV2beta1().ApisixRoutes("lgy").Create(context.Background(),v2b,v1.CreateOptions{})
> > fmt.Println(err)
> > }
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > apisix-ingress-controller引得依赖是1.2.0的版本
> > ```
> > require (
> > bou.ke/monkey v1.0.2
> > github.com/apache/apisix-ingress-controller v1.2.0
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 使用kubectl apply -f yaml 没问题
>
> If I am correct, I have said that the data structure defined for ApisixRoute is not suitable to create objects programmatically.
> There are some details that need to be fixed.
>
> Here you may marshal the `v2b` and compare it with the YAML configuration and see the differences.
我这边试了下,创建v2alpha1版本的没问题,v2beta1问题可能出在spec.ApisixRouteHTTP中Backend和Backends使用指针类型,另外有个问题请教下,grpc请求代理怎么调试,我现在有个svc起的grpc服务,然后创建了tls,upstream等,但是不知道怎么测试,我看官网有grpc案例,但是不太清楚
--
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] lgy1027 edited a comment on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
lgy1027 edited a comment on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-903665930
> @lgy1027 Please use the latest version of ingress-controller,now it is 1.2.0
现在不报错了,直接build1.2镜像,但是我在使用client创建router时还是报错
````
ApisixRoute.apisix.apache.org "httpbin-route" is invalid: [<nil>: Invalid value: "": "spec.http" must validate one and only one schema (oneOf). Found 2 valid alternatives, spec.http.authentication.type: Unsupported value: "": supported values: "basicAuth", "keyAuth", spec.http.backend.serviceName: Invalid value: "": spec.http.backend.serviceName in body shouldbe at least 1 chars long, spec.http.backend.servicePort: Invalid value: 0: spec.http.backend.servicePort in body should be greater than or equal to 1, spec.http.backend.weight: Invalid value: "null": spec.http.backend.weight in body mustbe of type integer: "null"]
````
代码如下:
````
import "github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/clientset/versioned"
client,err = versioned.NewForConfig(config)
func BuildRoute() {
w := int(100)
v2b := &v2beta1.ApisixRoute{
TypeMeta: metav1.TypeMeta{
Kind:"ApisixRoute",
APIVersion:"apisix.apache.org/v2beta1",
},
ObjectMeta:metav1.ObjectMeta{
Name: "httpbin-route",
Namespace: "lgy",
},
Spec: v2beta1.ApisixRouteSpec{
HTTP:[]v2beta1.ApisixRouteHTTP{
v2beta1.ApisixRouteHTTP{
Name: "httpbin",
Match: v2beta1.ApisixRouteHTTPMatch{
Hosts: []string{"local.httpbin.org"},
Paths: []string{"/*"},
},
Backends: []v2alpha1.ApisixRouteHTTPBackend{
v2alpha1.ApisixRouteHTTPBackend{
ServiceName: "httpbin",
ServicePort: intstr.IntOrString{
Type: intstr.Int,
IntVal: 80,
},
Weight:&w,
},
},
},
},
},
}
_, err := client.ApisixV2beta1().ApisixRoutes("lgy").Create(context.Background(),v2b,v1.CreateOptions{})
fmt.Println(err)
}
````
apisix-ingress-controller引得依赖是1.2.0的版本
````
require (
bou.ke/monkey v1.0.2
github.com/apache/apisix-ingress-controller v1.2.0
````
使用kubectl apply -f yaml 没问题
--
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] tokers commented on issue #646: request help: k8s中删除router,未触发admin删除的请求
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #646:
URL: https://github.com/apache/apisix-ingress-controller/issues/646#issuecomment-904489138
> > > > @lgy1027 Please use the latest version of ingress-controller,now it is 1.2.0
> > >
> > >
> > > 现在不报错了,直接build1.2镜像,但是我在使用client创建router时还是报错
> > > ```
> > > ApisixRoute.apisix.apache.org "httpbin-route" is invalid: [<nil>: Invalid value: "": "spec.http" must validate one and only one schema (oneOf). Found 2 valid alternatives, spec.http.authentication.type: Unsupported value: "": supported values: "basicAuth", "keyAuth", spec.http.backend.serviceName: Invalid value: "": spec.http.backend.serviceName in body shouldbe at least 1 chars long, spec.http.backend.servicePort: Invalid value: 0: spec.http.backend.servicePort in body should be greater than or equal to 1, spec.http.backend.weight: Invalid value: "null": spec.http.backend.weight in body mustbe of type integer: "null"]
> > > ```
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 代码如下:
> > > ```
> > > import "github.com/apache/apisix-ingress-controller/pkg/kube/apisix/client/clientset/versioned"
> > >
> > > client,err = versioned.NewForConfig(config)
> > >
> > > func BuildRoute() {
> > > w := int(100)
> > > v2b := &v2beta1.ApisixRoute{
> > > TypeMeta: metav1.TypeMeta{
> > > Kind:"ApisixRoute",
> > > APIVersion:"apisix.apache.org/v2beta1",
> > > },
> > > ObjectMeta:metav1.ObjectMeta{
> > > Name: "httpbin-route",
> > > Namespace: "lgy",
> > > },
> > > Spec: v2beta1.ApisixRouteSpec{
> > > HTTP:[]v2beta1.ApisixRouteHTTP{
> > > v2beta1.ApisixRouteHTTP{
> > > Name: "httpbin",
> > > Match: v2beta1.ApisixRouteHTTPMatch{
> > > Hosts: []string{"local.httpbin.org"},
> > > Paths: []string{"/*"},
> > > },
> > > Backends: []v2alpha1.ApisixRouteHTTPBackend{
> > > v2alpha1.ApisixRouteHTTPBackend{
> > > ServiceName: "httpbin",
> > > ServicePort: intstr.IntOrString{
> > > Type: intstr.Int,
> > > IntVal: 80,
> > > },
> > > Weight:&w,
> > > },
> > > },
> > > },
> > > },
> > > },
> > >
> > > }
> > > _, err := client.ApisixV2beta1().ApisixRoutes("lgy").Create(context.Background(),v2b,v1.CreateOptions{})
> > > fmt.Println(err)
> > > }
> > > ```
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > apisix-ingress-controller引得依赖是1.2.0的版本
> > > ```
> > > require (
> > > bou.ke/monkey v1.0.2
> > > github.com/apache/apisix-ingress-controller v1.2.0
> > > ```
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 使用kubectl apply -f yaml 没问题
> >
> >
> > If I am correct, I have said that the data structure defined for ApisixRoute is not suitable to create objects programmatically.
> > There are some details that need to be fixed.
> > Here you may marshal the `v2b` and compare it with the YAML configuration and see the differences.
>
> 我这边试了下,创建v2alpha1版本的没问题,v2beta1问题可能出在spec.ApisixRouteHTTP中Backend和Backends使用指针类型,另外有个问题请教下,grpc请求代理怎么调试,我现在有个svc起的grpc服务,然后创建了tls,upstream等,但是不知道怎么测试,我看官网有grpc案例,但是不太清楚
there are two cases you need to confirm which one is the same for you.
1. Client use gRPC to access APISIX, APISIX proxies to gRPC requests to upstream.
You need to create an ApisixUpstream which scheme is gRPC, since gRPC bases on HTTP/2, you may also need to create an ApisixTls resource. Of course you need to create an ApisixRoute to route requests to the backend service. Then you can use grpcurl to access it.
2. Client use HTTP to access APISIX, APISIX proxies to gRPC requests to upstream.
You need to use the grpc-transcode plugin and create an ApisixUpstream which scheme is gRPC.
--
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