Skip to content

Commit

Permalink
Merge pull request #1127 from jzinkweg/feature/leader-leases-resource
Browse files Browse the repository at this point in the history
Update RBAC configuration and docs to include leases resource for leader election
  • Loading branch information
jcmoraisjr authored Jun 3, 2024
2 parents e21d537 + 3213db7 commit 0a1b2af
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
8 changes: 8 additions & 0 deletions docs/haproxy-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ metadata:
name: ingress-controller
namespace: ingress-controller
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- create
- update
- apiGroups:
- ""
resources:
Expand Down
17 changes: 13 additions & 4 deletions docs/static/resources/haproxy-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ rules:
- list
- watch
- apiGroups:
- "extensions"
- "networking.k8s.io"
- extensions
- networking.k8s.io
resources:
- ingressclasses
- ingresses
verbs:
- get
Expand All @@ -56,8 +57,8 @@ rules:
- create
- patch
- apiGroups:
- "extensions"
- "networking.k8s.io"
- extensions
- networking.k8s.io
resources:
- ingresses/status
verbs:
Expand All @@ -69,6 +70,14 @@ metadata:
name: ingress-controller
namespace: ingress-controller
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- create
- update
- apiGroups:
- ""
resources:
Expand Down
4 changes: 3 additions & 1 deletion examples/rbac/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ The Role permissions are:
* `endpoints`: create, get, update

Furthermore to support leader-election, the ingress controller needs to
have access to a `configmap` in the `ingress-controller` namespace:
have access to both the `configmap` and `leases` resources in the
`ingress-controller` namespace:

* `configmaps`: get, update, create
* `coordination.k8s.io/leases`: get, update, create

## Namespace created in this example

Expand Down
8 changes: 8 additions & 0 deletions examples/rbac/ingress-controller-rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ metadata:
name: ingress-controller
namespace: ingress-controller
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- create
- update
- apiGroups:
- ""
resources:
Expand Down

0 comments on commit 0a1b2af

Please sign in to comment.