Skip to content

Commit

Permalink
Merge pull request #70 from SomtochiAma/kubeproxy-complete
Browse files Browse the repository at this point in the history
Adds role for manager
  • Loading branch information
k8s-ci-robot committed Jul 9, 2020
2 parents 6953455 + 84f6287 commit 8a52baa
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
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

0 comments on commit 8a52baa

Please sign in to comment.