Skip to content

Commit

Permalink
Framework for running Probes in ClusterLoader2
Browse files Browse the repository at this point in the history
Probes definition can be found in kubernetes#474

The feature is guarded by the enable-probes flag, will be enabling it gradually.

Ref. kubernetes/kubernetes#76012
  • Loading branch information
mm4tt committed Apr 16, 2019
1 parent 016b0da commit d37c4b3
Show file tree
Hide file tree
Showing 11 changed files with 492 additions and 0 deletions.
1 change: 1 addition & 0 deletions clusterloader2/cmd/clusterloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"k8s.io/perf-tests/clusterloader2/pkg/util"

_ "k8s.io/perf-tests/clusterloader2/pkg/measurement/common/bundle"
_ "k8s.io/perf-tests/clusterloader2/pkg/measurement/common/probes"
_ "k8s.io/perf-tests/clusterloader2/pkg/measurement/common/simple"
_ "k8s.io/perf-tests/clusterloader2/pkg/measurement/common/slos"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: probes
name: ping-client
labels:
probe: ping-client
spec:
selector:
matchLabels:
probe: ping-client
replicas: {{.Replicas}}
template:
metadata:
labels:
probe: ping-client
spec:
containers:
- name: ping-client
image: gcr.io/k8s-testimages/probes:v0.0.1
args:
- --metric-bind-address=0.0.0.0:8080
- --mode=ping-client
- --ping-server-address=ping-server:8081
resources:
limits:
cpu: 100m
memory: 100Mi
ports:
- containerPort: 8080
name: metrics
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
namespace: probes
name: ping-client
labels:
probe: ping-client
spec:
ports:
- name: metrics
port: 8080
selector:
probe: ping-client
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
namespace: probes
name: ping-client
spec:
endpoints:
- interval: 30s
port: metrics
namespaceSelector:
matchNames:
- probes
selector:
matchLabels:
probe: ping-client
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: probes
name: ping-server
labels:
probe: ping-server
spec:
selector:
matchLabels:
probe: ping-server
replicas: {{.Replicas}}
template:
metadata:
labels:
probe: ping-server
spec:
containers:
- name: ping-server
image: gcr.io/k8s-testimages/probes:v0.0.1
args:
- --metric-bind-address=0.0.0.0:8080
- --mode=ping-server
- --ping-server-bind-address=0.0.0.0:8081
resources:
limits:
cpu: 100m
memory: 100Mi
ports:
- containerPort: 8080
name: metrics
- containerPort: 8081
name: http
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
namespace: probes
name: ping-server
labels:
probe: ping-server
spec:

ports:
- name: metrics
port: 8080
- name: http
port: 8081
selector:
probe: ping-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
namespace: probes
name: ping-server
spec:
endpoints:
- interval: 30s
port: metrics
namespaceSelector:
matchNames:
- probes
selector:
matchLabels:
probe: ping-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: probes
name: prometheus-k8s
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- pods
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
namespace: probes
name: prometheus-k8s
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus-k8s
subjects:
- kind: ServiceAccount
name: prometheus-k8s
namespace: monitoring
Loading

0 comments on commit d37c4b3

Please sign in to comment.