Belyenochi opened a new issue #913:
URL: https://github.com/apache/apisix-ingress-controller/issues/913
### Issue description
apisix ingress controller start panic
### Environment
- your apisix-ingress-controller version (output of
apisix-ingress-controller version --long):
1.4.0(master branch)
- your Kubernetes cluster version (output of kubectl version):
1.16.9
- if you run apisix-ingress-controller in Bare-metal environment, also show
your OS version (uname -a):
Darwin MacBook-Pro.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26
20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
### Minimal test code / Steps to reproduce
1. Make sure that the apisix related CRD has been installed in the cluster
2. kubectl apply -f apisix-route.yaml
```
apiVersion: apisix.apache.org/v2beta1
kind: ApisixRoute
metadata:
name: foo-bar-route
spec:
http:
- name: foo
match:
hosts:
- foo.com
paths:
- "/foo*"
backend:
serviceName: foo
servicePort: 80
- name: bar
match:
paths:
- "/bar"
backend:
serviceName: bar
servicePort: 80
```
3. start local apisix-ingress-controller
```
ingress
\
--kubeconfig
/path/to/kubeconfig
\
--http-listen
:8082
\
--log-output
stderr
\
--default-apisix-cluster-base-url
http://127.0.0.1:9180/apisix/admin # 127.0.0.1:9180 need to be replaced
--default-apisix-cluster-admin-key
edd1c9f034335f136f87ad84b625c8f1
```
### Actual result
local apisix-ingress-controller panic
### Error log
2022-03-10T12:14:32+08:00 warn api/server.go:75 failed to
load x509 key pair, will not start admission server {"Error": "open
/etc/webhook/certs/cert.pem: no such file or directory", "CertFilePath":
"/etc/webhook/certs/cert.pem", "KeyFilePath": "/etc/webhook/certs/key.pem"}
I0310 12:14:32.866418 19515 leaderelection.go:248] attempting to acquire
leader lease default/ingress-apisix-leader...
2022-03-10T12:14:35+08:00 info ingress/controller.go:320
LeaderElection {"message": " became leader", "event_type": "Normal"}
I0310 12:14:35.634105 19515 leaderelection.go:258] successfully acquired
lease default/ingress-apisix-leader
2022-03-10T12:14:35+08:00 info ingress/controller.go:406
controller tries to leading ... {"namespace": "default", "pod": ""}
2022-03-10T12:14:37+08:00 warn apisix/cluster.go:332 waiting
cluster default to ready, it may takes a while
2022-03-10T12:14:37+08:00 info apisix/cluster.go:160 syncing
cache {"cluster": "default"}
2022-03-10T12:14:37+08:00 info apisix/cluster.go:372 syncing
schema {"cluster": "default"}
2022-03-10T12:14:40+08:00 info apisix/cluster.go:164 cache synced
{"cost_time": "3.733667121s", "cluster": "default"}
2022-03-10T12:14:40+08:00 warn apisix/cluster.go:343 cluster
default now is ready, cost time 3.733716272s
2022-03-10T12:14:41+08:00 info ingress/namespace.go:70 label
selector watching namespaces {"namespaces": ["allns-r7sel9-0", "apisix",
"cattle-prometheus", "cattle-system", "chaos-testing", "chaosblade", "default",
"elastic-system", "ingress-apisix-e2e-tests-default-760463000",
"ingress-apisix-e2e-tests-default-825238000", "ingress-nginx", "kafka",
"kruise-system", "kube-node-lease", "kube-public", "kube-system", "leaf",
"local-path-storage", "logging", "mcloud-cat", "middleware-paas", "minio",
"monitoring", "nacos", "nacos-2", "nacos-3", "nacos-4", "nacos-5", "nacos-6",
"nacos-test", "pvc-exporter", "pxc1", "redis", "security-scan", "syu-t",
"syu-t2", "thrift", "xxl-job", "xxl-job1", "xxl-job2", "zookeeper"]}
I0310 12:14:42.501579 19515 request.go:665] Waited for 1.000136347s due to
client-side throttling, not priority and fairness, request:
GET:https://mke.my.myorg/k8s/clusters/c-dx6gd/apis/apisix.apache.org/v2beta3/namespaces/nacos-4/apisixroutes
panic: runtime error: index out of range [0] with length 0
goroutine 157 [running]:
github.com/apache/apisix-ingress-controller/pkg/kube/translation.(*translator).translateHTTPRouteV2beta3NotStrictly(0x0,
0xc00092c200, 0xc0008771e0)
/Users/jasonzhu/opensource/2022/apisix-ingress-controller/pkg/kube/translation/apisix_route.go:936
+0x899
github.com/apache/apisix-ingress-controller/pkg/kube/translation.(*translator).TranslateRouteV2beta3NotStrictly(0x0,
0x0)
/Users/jasonzhu/opensource/2022/apisix-ingress-controller/pkg/kube/translation/apisix_route.go:314
+0x72
github.com/apache/apisix-ingress-controller/pkg/ingress.(*Controller).CompareResources.func1.1({0xc000417b24,
0x7})
/Users/jasonzhu/opensource/2022/apisix-ingress-controller/pkg/ingress/compare.go:78
+0x852
created by
github.com/apache/apisix-ingress-controller/pkg/ingress.(*Controller).CompareResources.func1
/Users/jasonzhu/opensource/2022/apisix-ingress-controller/pkg/ingress/compare.go:68
+0x248
### Expected result
_No response_
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]