Skip to content

Commit f1673b0

Browse files
committed
HDDS-1478. Provide k8s resources files for prometheus and performance tests
Closes #783
1 parent 2ab318b commit f1673b0

36 files changed

+1267
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
description: Jaeger tracing server
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
apiVersion: v1
17+
kind: Service
18+
metadata:
19+
name: jaeger
20+
spec:
21+
clusterIP: None
22+
selector:
23+
app: jaeger
24+
component: jaeger
25+
ports:
26+
- name: ui
27+
port: 16686
28+
---
29+
apiVersion: apps/v1
30+
kind: StatefulSet
31+
metadata:
32+
name: jaeger
33+
spec:
34+
selector:
35+
matchLabels:
36+
app: jaeger
37+
component: jaeger
38+
replicas: 1
39+
serviceName: jaeger
40+
template:
41+
metadata:
42+
labels:
43+
app: jaeger
44+
component: jaeger
45+
spec:
46+
containers:
47+
- name: jaeger
48+
image: jaegertracing/all-in-one:latest
49+
ports:
50+
- containerPort: 16686
51+
name: web
52+
env:
53+
- name: COLLECTOR_ZIPKIN_HTTP_PORT
54+
value: "9411"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
name: ozone/profiler
17+
description: Enable profiler endpoint.
18+
---
19+
- type: Add
20+
trigger:
21+
metadata:
22+
name: config
23+
path:
24+
- data
25+
value:
26+
OZONE-SITE.XML_hdds.profiler.endpoint.enabled: "true"
27+
ASYNC_PROFILER_HOME: /opt/profiler

hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ description: Enable prometheus monitoring in Ozone
2323
path:
2424
- data
2525
value:
26-
OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true
26+
OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: "true"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
name: ozone/tracing
17+
description: Enable jaeger tracing
18+
---
19+
- type: Add
20+
path:
21+
- spec
22+
- template
23+
- spec
24+
- containers
25+
- .*
26+
- env
27+
value:
28+
- name: JAEGER_SAMPLER_TYPE
29+
value: probabilistic
30+
- name: JAEGER_SAMPLER_PARAM
31+
value: "0.01"
32+
- name: JAEGER_AGENT_HOST
33+
value: jaeger-0.jaeger
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
apiVersion: v1
17+
kind: ConfigMap
18+
metadata:
19+
name: prometheusconf
20+
data:
21+
prometheus.yaml: |-
22+
global:
23+
scrape_interval: 15s
24+
scrape_configs:
25+
- job_name: jmxexporter
26+
kubernetes_sd_configs:
27+
- role: pod
28+
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
29+
relabel_configs:
30+
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
31+
action: keep
32+
regex: true
33+
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
34+
action: replace
35+
target_label: __metrics_path__
36+
regex: (.+)
37+
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
38+
action: replace
39+
regex: ([^:]+)(?::\d+)?;(\d+)
40+
replacement: $1:$2
41+
target_label: __address__
42+
- action: labelmap
43+
regex: __meta_kubernetes_pod_label_(.+)
44+
- source_labels: [__meta_kubernetes_namespace]
45+
action: replace
46+
target_label: kubernetes_namespace
47+
- source_labels: [__meta_kubernetes_pod_name]
48+
action: replace
49+
target_label: kubernetes_pod_name
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
name: ozone/prometheus
17+
description: Enable prometheus monitoring in Ozone
18+
---
19+
- type: Add
20+
trigger:
21+
metadata:
22+
name: config
23+
path:
24+
- data
25+
value:
26+
OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: "true"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
apiVersion: apps/v1beta1
17+
kind: Deployment
18+
metadata:
19+
name: prometheus
20+
labels:
21+
app: prometheus
22+
spec:
23+
replicas: 1
24+
selector:
25+
matchLabels:
26+
app: prometheus
27+
template:
28+
metadata:
29+
labels:
30+
app: prometheus
31+
spec:
32+
serviceAccountName: prometheus-operator
33+
containers:
34+
- name: prometheus
35+
image: prom/prometheus
36+
args: ["--config.file=/conf/prometheus.yaml"]
37+
ports:
38+
- containerPort: 9090
39+
volumeMounts:
40+
- name: config
41+
mountPath: "/conf"
42+
readOnly: true
43+
volumes:
44+
- name: config
45+
configMap:
46+
name: prometheusconf
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
description: Prometheus monitoring
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
apiVersion: rbac.authorization.k8s.io/v1beta1
17+
kind: ClusterRole
18+
metadata:
19+
name: prometheus
20+
rules:
21+
- apiGroups: [""]
22+
resources:
23+
- nodes
24+
- services
25+
- endpoints
26+
- pods
27+
verbs: ["get", "list", "watch"]
28+
- apiGroups: [""]
29+
resources:
30+
- configmaps
31+
verbs: ["get"]
32+
- nonResourceURLs: ["/metrics"]
33+
verbs: ["get"]

0 commit comments

Comments
 (0)