flying1pig opened a new issue #182:
URL: https://github.com/apache/apisix-ingress-controller/issues/182
### Issue description
Recently, we have deployed apisix ingress controller in my k8s cluster,
however, our apisix cluster cannot synchronize upstream information from k8s
cluster.
### Environment
apisix-ingress-controller version:
Version: 0.2.0
Git SHA: f72d75d
Go Version: go1.13.8
Building OS/Arch: linux/amd64
Running OS/Arch: linux/amd64
Kubernetes cluster version:
Client Version: version.Info{Major:"1", Minor:"17",
GitVersion:"v1.17.4",
GitCommit:"8d8aa39598534325ad77120c120a22b3a990b5ea",
GitTreeState:"clean", BuildDate:"2020-03-12T21:03:42Z",
GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17",
GitVersion:"v1.17.4",
GitCommit:"8d8aa39598534325ad77120c120a22b3a990b5ea",
GitTreeState:"clean", BuildDate:"2020-03-12T20:55:23Z",
GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
### Minimal test code / Steps to reproduce the issue
1. git clone https://github.com/apache/apisix-ingress-controller.git
2. cd ./apisix-ingress-controller
3. docker build -t test.abc.xyz/library/apisix-ingress-controller:0.2.0 .
4. modify the field of image in
samples/deploy/deployment/ingress-controller.yaml using the image built in step
3
5. add cluster role in
apisix-ingress-controller/samples/deploy/rbac/apisix_view_clusterrole.yaml:
> - apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- list
- get
- watch
6. kubectl apply -k apisix-ingress-controller/samples/deploy
7. kubectl logs {podName} -n ingress-apisix
### What's the actual result? (including assertion message & call stack if
applicable)
We will see the logs:
`E0119 10:26:06.218746 1 leaderelection.go:328] error initially
creating leader election record: leases.coordination.k8s.io is forbidden: User
"system:serviceaccount:ingress-apisix:apisix-view-serviceaccount" cannot create
resource "leases" in API group "coordination.k8s.io" in the namespace "default"
E0119 10:26:08.852654 1 leaderelection.go:328] error initially
creating leader election record: leases.coordination.k8s.io is forbidden: User
"system:serviceaccount:ingress-apisix:apisix-view-serviceaccount" cannot create
resource "leases" in API group "coordination.k8s.io" in the namespace "default"
E0119 10:26:13.077985 1 leaderelection.go:328] error initially
creating leader election record: leases.coordination.k8s.io is forbidden: User
"system:serviceaccount:ingress-apisix:apisix-view-serviceaccount" cannot create
resource "leases" in API group "coordination.k8s.io" in the namespace "default"
E0119 10:26:15.974098 1 leaderelection.go:328] error initially
creating leader election record: leases.coordination.k8s.io is forbidden: User
"system:serviceaccount:ingress-apisix:apisix-view-serviceaccount" cannot create
resource "leases" in API group "coordination.k8s.io" in the namespace "default"`
### What's the expected result?
The expected result:
`2021-01-19T12:51:45+08:00 info apisix/upstream.go:85 try to list
upstreams in APISIX {"url": "http://10.194.34.33:9180/apisix/admin/upstreams"}
2021-01-19T12:51:45+08:00 info apisix/resource.go:112 got upstream:
{"desc":"desc-xyp-test","id":"337499639513088774","timeout":{"read":6000,"connect":6000,"send":6000},"name":"ups-xieyp001","type":"roundrobin","update_time":1610976542,"pass_host":"pass","checks":{"passive":{"healthy":{"successes":3},"unhealthy":{"tcp_failures":3,"http_failures":3}},"active":{"healthy":{"interval":3,"successes":3},"timeout":3,"host":"active-healthcheck","http_path":"\/check.do","unhealthy":{"interval":3,"http_failures":3}}},"create_time":1610695061,"nodes":[{"port":80,"weight":1,"host":"10.194.34.33"}]}
2021-01-19T12:51:45+08:00 info apisix/upstream.go:105 list upstream
#0, body:
{"desc":"desc-xyp-test","id":"337499639513088774","timeout":{"read":6000,"connect":6000,"send":6000},"name":"ups-xieyp001","type":"roundrobin","update_time":1610976542,"pass_host":"pass","checks":{"passive":{"healthy":{"successes":3},"unhealthy":{"tcp_failures":3,"http_failures":3}},"active":{"healthy":{"interval":3,"successes":3},"timeout":3,"host":"active-healthcheck","http_path":"\/check.do","unhealthy":{"interval":3,"http_failures":3}}},"create_time":1610695061,"nodes":[{"port":80,"weight":1,"host":"10.194.34.33"}]}`
----------------------------------------------------------------
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:
[email protected]