example service monitoring updated with missing config
added service account, role and role binding for the prometheus frontend example, also updated prometheus to use the correct service account fixes #1049
This commit is contained in:
@@ -8,6 +8,9 @@ if [ -z "${NAMESPACE}" ]; then
|
||||
NAMESPACE=default
|
||||
fi
|
||||
|
||||
kubectl --namespace "$NAMESPACE" --kubeconfig="$KUBECONFIG" apply -f manifests/examples/example-app/prometheus-frontend-service-account.yaml
|
||||
kubectl --namespace "$NAMESPACE" --kubeconfig="$KUBECONFIG" apply -f manifests/examples/example-app/prometheus-frontend-role.yaml
|
||||
kubectl --namespace "$NAMESPACE" --kubeconfig="$KUBECONFIG" apply -f manifests/examples/example-app/prometheus-frontend-role-binding.yaml
|
||||
kubectl --namespace "$NAMESPACE" --kubeconfig="$KUBECONFIG" apply -f manifests/examples/example-app/prometheus-frontend-svc.yaml
|
||||
kubectl --namespace "$NAMESPACE" --kubeconfig="$KUBECONFIG" apply -f manifests/examples/example-app/example-app.yaml
|
||||
kubectl --namespace "$NAMESPACE" --kubeconfig="$KUBECONFIG" apply -f manifests/examples/example-app/prometheus-frontend.yaml
|
||||
|
@@ -0,0 +1,13 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: prometheus-frontend
|
||||
namespace: default
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: prometheus-frontend
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: prometheus-frontend
|
||||
namespace: default
|
17
manifests/examples/example-app/prometheus-frontend-role.yaml
Normal file
17
manifests/examples/example-app/prometheus-frontend-role.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: prometheus-frontend
|
||||
namespace: default
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- nodes
|
||||
- services
|
||||
- endpoints
|
||||
- pods
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- configmaps
|
||||
verbs: ["get"]
|
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: prometheus-frontend
|
@@ -6,6 +6,7 @@ metadata:
|
||||
labels:
|
||||
prometheus: frontend
|
||||
spec:
|
||||
serviceAccountName: prometheus-frontend
|
||||
version: v1.7.1
|
||||
serviceMonitorSelector:
|
||||
matchLabels:
|
||||
|
Reference in New Issue
Block a user