run netchecker-server with list pods

This commit is contained in:
jwfang
2017-07-17 19:28:09 +08:00
parent e1386ba604
commit a8e6a0763d
7 changed files with 42 additions and 4 deletions

View File

@@ -0,0 +1,9 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: netchecker-server
namespace: {{ netcheck_namespace }}
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["list"]

View File

@@ -0,0 +1,13 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: netchecker-server
namespace: {{ netcheck_namespace }}
subjects:
- kind: ServiceAccount
name: netchecker-server
namespace: {{ netcheck_namespace }}
roleRef:
kind: ClusterRole
name: netchecker-server
apiGroup: rbac.authorization.k8s.io

View File

@@ -31,3 +31,6 @@ spec:
- "-logtostderr"
- "-kubeproxyinit"
- "-endpoint=0.0.0.0:8081"
{% if rbac_enabled %}
serviceAccountName: netchecker-server
{% endif %}

View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: netchecker-server
namespace: {{ netcheck_namespace }}
labels:
kubernetes.io/cluster-service: "true"