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/03/09 10:42:43 UTC

[GitHub] [apisix-ingress-controller] dantegarden opened a new issue #911: apisix-ingress-controller can't run on k8s 1.16

dantegarden opened a new issue #911:
URL: https://github.com/apache/apisix-ingress-controller/issues/911


   我在我的本地k8s集群上,参考本仓库的minikube部署方式的文档,使用helm install最新的apisix-ingress-controller:
   `helm install apisix  apisix-0.8.3.tgz \ 
   --set gateway.type=NodePort \ 
   --set ingress-controller.enabled=true \
   --namespace ingress-apisix \
   --set ingress-controller.config.apisix.serviceNamespace=ingress-apisix`
   部署完成后,我看到集群中包含以下资源:
   `$ kubectl get all -n ingress-apisix
   NAME                                             READY   STATUS    RESTARTS   AGE
   pod/apisix-6f5c79b896-hhmxj                      1/1     Running   0          34m
   pod/apisix-etcd-0                                1/1     Running   0          36m
   pod/apisix-etcd-1                                1/1     Running   0          36m
   pod/apisix-etcd-2                                1/1     Running   0          36m
   pod/apisix-ingress-controller-6bf474fc87-lvh65   1/1     Running   0          36m
   
   NAME                                TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
   service/apisix-admin                ClusterIP   10.43.230.142   <none>        9180/TCP            36m
   service/apisix-etcd                 ClusterIP   10.43.193.5     <none>        2379/TCP,2380/TCP   36m
   service/apisix-etcd-headless        ClusterIP   None            <none>        2379/TCP,2380/TCP   36m
   service/apisix-gateway              NodePort    10.43.186.83    <none>        80:30604/TCP        36m
   service/apisix-ingress-controller   ClusterIP   10.43.64.11     <none>        80/TCP              36m
   
   NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
   deployment.apps/apisix                      1/1     1            1           36m
   deployment.apps/apisix-ingress-controller   1/1     1            1           36m
   
   NAME                                                   DESIRED   CURRENT   READY   AGE
   replicaset.apps/apisix-59cd8fb75b                      0         0         0       36m
   replicaset.apps/apisix-6f5c79b896                      1         1         1       34m
   replicaset.apps/apisix-ingress-controller-6bf474fc87   1         1         1       36m
   
   NAME                           READY   AGE
   statefulset.apps/apisix-etcd   3/3     36m
   `
   之后,我尝试创建一个deployment和service,并使用apisix-route暴露服务:
   `apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: frontend
   spec:
     replicas: 3  
     selector:
       matchLabels:
         tier: frontend 
     template:
       
       metadata:
         labels:
           tier: frontend  
       spec:
         affinity:
           nodeAffinity:
             requiredDuringSchedulingIgnoredDuringExecution:
               nodeSelectorTerms:
               - matchExpressions:
                 - key: beta.kubernetes.io/os
                   operator: NotIn
                   values:
                   - windows
                 - key: node-role.kubernetes.io/worker
                   operator: Exists
                 - key: edge_id
                   operator: DoesNotExist
         containers:
         - name: myapp
           image: hub.mine.dev/library/myapp:v1  # just a nginx image
           env:
           - name: GET_HOSTS_FROM
             value: dns
           ports:
           - containerPort: 80
   
   ---
   apiVersion: v1
   kind: Service
   metadata:
     name: frontend
     namespace: default
   spec:
     type: ClusterIP
     selector:
       tier: frontend
     ports:
     - name: http
       port: 80
       targetPort: 80
   `
   route.yaml:
   `apiVersion: apisix.apache.org/v2beta2
   kind: ApisixRoute
   metadata:
     name: httpserver-route
   spec:
     http:
     - name: rule1
       match:
         hosts:
         - local.httpbin.org
         paths:
         - /*
       backends:
       - serviceName: frontend
         servicePort: 80
   `
   我在我的笔记本上修改hosts,使**local.httpbin.org**指向随便一台集群节点。
   然后通过浏览器访问 **local.httpbin.org**,返回 **ERR_CONNECTION_REFUSED**。
   
   此前,我的k8s集群中已经安装了**ingress-controller**,并可以正常工作。
   我通过删除**ingress-controller**的daemonset使其释放了80和443端口。
   安装后apisix-ingress-controller后,我查看 **apisix-ingress-controller-6bf474fc87-lvh65** 的日志,发现:
   `
   [GIN] 2022/03/09 - 18:22:53 | 200 |      69.857µs |      100.64.0.2 | GET      "/healthz"
   2022-03-09T18:22:53+08:00	info	ingress/controller.go:609	service kube-system/kube-controller-manager not found
   2022-03-09T18:22:54+08:00	info	ingress/controller.go:609	service kube-system/kube-scheduler not found
   2022-03-09T18:22:55+08:00	info	ingress/controller.go:609	service kube-system/kube-controller-manager not found
   2022-03-09T18:22:56+08:00	info	ingress/controller.go:609	service kube-system/kube-scheduler not found
   2022-03-09T18:22:57+08:00	info	ingress/controller.go:609	service kube-system/kube-controller-manager not found
   2022-03-09T18:22:58+08:00	info	ingress/controller.go:609	service kube-system/kube-scheduler not found
   E0309 18:22:58.587942       1 reflector.go:138] pkg/mod/k8s.io/client-go@v0.22.4/tools/cache/reflector.go:167: Failed to watch *v1.Ingress: failed to list *v1.Ingress: the server could not find the requested resource
   `
   看起来apisix-ingress-controller并不能在k8s 1.16版本上正常工作,因为我这里的ingress apiVersion还是extensions/v1beta1。
   


-- 
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 #911: apisix-ingress-controller can't run on k8s 1.16

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #911:
URL: https://github.com/apache/apisix-ingress-controller/issues/911#issuecomment-1063525457


   You can modify its configuration.
   
   https://github.com/apache/apisix-ingress-controller/blob/75098d1e4b26136de3164a3aabd6ed018ffdcd6b/conf/config-default.yaml#L68-L70


-- 
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 #911: apisix-ingress-controller can't run on k8s 1.16

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #911:
URL: https://github.com/apache/apisix-ingress-controller/issues/911#issuecomment-1068774293


   > * apisix是否可以独立工作,是否需要安装nginx-ingress?
   
   Yes, we don't need nginx-ingress. 
   
   > * deployment,service,apisixroute是否必须创建在apisix-ingress命名空间下?
   
   No,  APISIX ingress controller will watch all namespaces by default. You should keep service and ApisixRoute in same namespace only.
   
   > * 我发现无论apisix还是apisix-ingress-controller都没有占有80和443端口,我部署后产生的资源是否完全,是否缺少别的资源?
   
   The actual traffic is proxied by APISIX. 
   


-- 
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] dantegarden closed issue #911: apisix-ingress-controller can't run on k8s 1.16

Posted by GitBox <gi...@apache.org>.
dantegarden closed issue #911:
URL: https://github.com/apache/apisix-ingress-controller/issues/911


   


-- 
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] dantegarden commented on issue #911: apisix-ingress-controller can't run on k8s 1.16

Posted by GitBox <gi...@apache.org>.
dantegarden commented on issue #911:
URL: https://github.com/apache/apisix-ingress-controller/issues/911#issuecomment-1063638708


   > You can modify its configuration.
   > 
   > https://github.com/apache/apisix-ingress-controller/blob/75098d1e4b26136de3164a3aabd6ed018ffdcd6b/conf/config-default.yaml#L68-L70
   
   感谢回复。
   按照您的提示,我将`configmap`中的ingress apiVersion修改为`extensions/v1beta1`,apisix-ingress-controller不再报`Failed to watch *v1.Ingress`。
   但是我通过浏览器访问 `local.httpbin.org`仍然显示 `ERR_CONNECTION_REFUSED`,并没有解决问题。
   我有一些疑惑:
   1. apisix是否可以独立工作,是否需要安装nginx-ingress?
   2. deployment,service,apisixroute是否必须创建在apisix-ingress命名空间下?
   3. 我发现无论apisix还是apisix-ingress-controller都没有占有80和443端口,我部署后产生的资源是否完全,是否缺少别的资源?
   
   


-- 
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