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/04/09 01:40:05 UTC

[GitHub] [apisix-ingress-controller] tokers edited a comment on issue #338: bug: minikube setup

tokers edited a comment on issue #338:
URL: https://github.com/apache/apisix-ingress-controller/issues/338#issuecomment-816340652


   > @tokers I created the CRDs using the `samples/deploy` directory
   > This worked and the `httpbin-route.yaml` was created successfully with `apisix.apache.org/v2alpha1`
   > 
   > Looking at the pod `apisix-ingress-controller-847df99d4c-v5g2p`, initially it is up and running fine. But then it crashes and the following are the logs:
   > 
   > ```
   > 2021-04-09T00:41:08+08:00 info ingress/ingress.go:113 use configuration
   > {
   > "log_level": "info",
   > "log_output": "stderr",
   > "http_listen": ":8080",
   > "enable_profiling": true,
   > "kubernetes": {
   > "kubeconfig": "",
   > "resync_interval": "1m0s",
   > "app_namespaces": [
   > ""
   > ],
   > "election_id": "ingress-apisix-leader",
   > "ingress_class": "apisix",
   > "ingress_version": "networking/v1",
   > "apisix_route_version": "apisix.apache.org/v2alpha1"
   > },
   > "apisix": {
   > "base_url": "http://apisix-admin:9180/apisix/admin",
   > "admin_key": "edd1c9f034335f136f87ad84b625c8f1"
   > }
   > }
   > I0409 00:41:08.128038 1 leaderelection.go:243] attempting to acquire leader lease ingress-apisix/ingress-apisix-leader...
   > 2021-04-09T00:41:08+08:00 info controller/controller.go:198 LeaderElection {"message": "apisix-ingress-controller-847df99d4c-v5g2p became leader", "event_type": "Normal"}
   > I0409 00:41:08.146784 1 leaderelection.go:253] successfully acquired lease ingress-apisix/ingress-apisix-leader
   > 2021-04-09T00:41:08+08:00 info controller/controller.go:273 controller now is running as leader {"namespace": "ingress-apisix", "pod": "apisix-ingress-controller-847df99d4c-v5g2p"}
   > 2021-04-09T00:41:08+08:00 warn apisix/cluster.go:235 waiting cluster to ready, it may takes a while
   > 2021-04-09T00:41:08+08:00 info apisix/cluster.go:113 syncing cache {"cluster": ""}
   > 2021-04-09T00:41:08+08:00 warn controller/controller.go:236 found a new leader apisix-ingress-controller-847df99d4c-v5g2p
   > 2021-04-09T00:41:08+08:00 info apisix/cluster.go:120 cache synced {"cost_time": "14.051871ms", "cluster": ""}
   > 2021-04-09T00:41:08+08:00 warn apisix/cluster.go:241 cluster now is ready, cost time 14.277115ms
   > 2021-04-09T00:41:08+08:00 info controller/endpoint.go:64 endpoints controller started
   > 2021-04-09T00:41:08+08:00 info controller/apisix_upstream.go:56 ApisixUpstream controller started
   > 2021-04-09T00:41:08+08:00 info controller/ingress.go:59 ingress controller started
   > 2021-04-09T00:41:08+08:00 info controller/apisix_route.go:57 ApisixRoute controller started
   > 2021-04-09T00:41:08+08:00 info controller/secret.go:62 secret controller started
   > 2021-04-09T00:41:08+08:00 warn apisix/upstream.go:113 upstream not found {"fullname": "kube-system_metrics-server_443", "url": "http://apisix-admin:9180/apisix/admin/upstreams/4a344633", "cluster": ""}
   > 2021-04-09T00:41:08+08:00 warn controller/endpoint.go:140 upstream is not referenced {"cluster": "name=; base_url=http://apisix-admin:9180/apisix/admin", "upstream": "kube-system_metrics-server_443"}
   > 2021-04-09T00:41:08+08:00 warn apisix/upstream.go:113 upstream not found {"fullname": "ingress-apisix_apisix-etcd-headless_2380", "url": "http://apisix-admin:9180/apisix/admin/upstreams/82c8442b", "cluster": ""}
   > 2021-04-09T00:41:08+08:00 warn controller/endpoint.go:140 upstream is not referenced {"cluster": "name=; base_url=http://apisix-admin:9180/apisix/admin", "upstream": "ingress-apisix_apisix-etcd-headless_2380"}
   > panic: runtime error: invalid memory address or nil pointer dereference
   > [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x15d2e7d]
   > 
   > goroutine 177 [running]:
   > github.com/apache/apisix-ingress-controller/pkg/kube/translation.(*translator).TranslateRouteV2alpha1(0xc0000c3110, 0xc0003bb680, 0x7, 0xc00060dee8, 0x10, 0x1c95760, 0xc00032f640, 0x0, 0x0, 0x0)
   > /build/controller/pkg/kube/translation/apisix_route.go:110 +0x74d
   > github.com/apache/apisix-ingress-controller/pkg/ingress/controller.(*apisixRouteController).sync(0xc00032e000, 0x1c95560, 0xc00053b080, 0xc00063fe00, 0x1a70df8, 0x0)
   > /build/controller/pkg/ingress/controller/apisix_route.go:142 +0x39e
   > github.com/apache/apisix-ingress-controller/pkg/ingress/controller.(*apisixRouteController).runWorker(0xc00032e000, 0x1c95560, 0xc00053b080)
   > /build/controller/pkg/ingress/controller/apisix_route.go:78 +0x57
   > created by github.com/apache/apisix-ingress-controller/pkg/ingress/controller.(*apisixRouteController).run
   > /build/controller/pkg/ingress/controller/apisix_route.go:66 +0x1ef
   > ```
   > 
   > The tests fail (https://github.com/apache/apisix-ingress-controller/blob/master/docs/en/latest/practices/proxy-the-httpbin-service.md#test) and I assume the pod failure is the issue
   
   I'm sorry because in `0.4.0` we don't have a field called `backends` but only `backend`, so you can use the following snippet instead:
   
   ```yaml
   # httpbin-route.yaml
   apiVersion: apisix.apache.org/v2alpha1
   kind: ApisixRoute
   metadata:
     name: httpserver-route
   spec:
     http:
     - name: rule1
       match:
         hosts:
         - local.httpbin.org
         paths:
         - /*
         backends:
         - serviceName: httpbin
           servicePort: 80
   ```
   
   We'll soon relaese the apisix-ingress-controller `0.5.0`, which fixed several bugs and is more robust.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org