Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds role for manager #70

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
- name: manager
env:
- name: KUBERNETES_SERVICE_HOST
value: "172.17.0.2"
value: "172.17.0.3"
- name: KUBERNETES_SERVICE_PORT
value: "6443"
2 changes: 2 additions & 0 deletions kubeproxy/config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ resources:
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
- manager_role.yaml
- manager_rolebinding.yaml
# Comment the following 3 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
Expand Down
27 changes: 27 additions & 0 deletions kubeproxy/config/rbac/manager_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: main-manager-role
rules:
- apiGroups: [""]
resources: ["*"]
verbs: ["list", "get", "watch"]
- apiGroups: [""]
resources: ["events", "serviceaccounts"]
verbs: ["create", "patch", "update"]
- apiGroups: ["apps", "extensions"]
resources: ["daemonsets"]
verbs: ["get", "watch", "list", "create", "patch"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["clusterrolebindings"]
verbs: ["get", "watch", "list", "create"]
- apiGroups: ["app.k8s.io"]
resources: ["applications"]
verbs: ["get", "watch", "list", "create", "patch"]
- apiGroups: ["discovery.k8s.io"]
resources: ["endpointslices"]
verbs: ["list", "watch"]
- apiGroups: ["events.k8s.io"]
resources: ["events"]
verbs: ["create", "patch", "update"]
12 changes: 12 additions & 0 deletions kubeproxy/config/rbac/manager_rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: main-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: main-manager-role
subjects:
- kind: ServiceAccount
name: default
namespace: system
1 change: 1 addition & 0 deletions kubeproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func main() {
Scheme: scheme,
MetricsBindAddress: metricsAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "kubeproxy-operator",
Port: 9443,
})
if err != nil {
Expand Down