Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-1478. Provide k8s resources files for prometheus and performance tests #783

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions hadoop-ozone/common/pom.xml
Original file line number Diff line number Diff line change
@@ -169,4 +169,28 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>k8s-dev</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.29.0</version>
<configuration>
<images>
<image>
<name>${user.name}/ozone:${project.version}</name>
<build>
<dockerFileDir>${project.basedir}</dockerFileDir>
</build>
</image>
</images>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
2 changes: 2 additions & 0 deletions hadoop-ozone/dist/dev-support/bin/dist-layout-stitching
Original file line number Diff line number Diff line change
@@ -120,3 +120,5 @@ cp -r "${ROOT}/hadoop-hdds/docs/target/classes/docs" ./
run cp -p -R "${ROOT}/hadoop-ozone/dist/target/compose" .
run cp -p -r "${ROOT}/hadoop-ozone/dist/src/main/smoketest" .
run cp -p -r "${ROOT}/hadoop-ozone/dist/src/main/blockade" .
run cp -p -r "${ROOT}/hadoop-ozone/dist/target/k8s" kubernetes
run cp -p -r "${ROOT}/hadoop-ozone/dist/src/main/Dockerfile" .
77 changes: 76 additions & 1 deletion hadoop-ozone/dist/pom.xml
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@
<properties>
<file.encoding>UTF-8</file.encoding>
<downloadSources>true</downloadSources>
<docker.image>apache/hadoop:${project.version}</docker.image>
</properties>

<build>
@@ -139,7 +140,7 @@
<version>3.1.0</version>
<executions>
<execution>
<id>copy-resources</id>
<id>copy-compose</id>
<phase>compile</phase>
<goals>
<goal>copy-resources</goal>
@@ -154,6 +155,22 @@
</resources>
</configuration>
</execution>
<execution>
<id>copy-k8s</id>
<phase>compile</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/k8s</outputDirectory>
<resources>
<resource>
<directory>src/main/k8s</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
@@ -267,4 +284,62 @@
<artifactId>hadoop-ozone-upgrade</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>k8s-dev</id>
<properties>
<docker.image>${user.name}/ozone:${project.version}</docker.image>
</properties>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.29.0</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<images>
<image>
<name>${docker.image}</name>
<build>
<dockerFileDir>
${project.build.directory}/ozone-${project.version}
</dockerFileDir>
</build>
</image>
</images>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>k8s-dev-push</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.29.0</version>
<executions>
<execution>
<goals>
<goal>push</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -16,6 +16,6 @@

FROM apache/hadoop-runner:latest

ADD --chown=hadoop target/ozone-0.4.0-SNAPSHOT /opt/hadoop
ADD --chown=hadoop . /opt/hadoop

WORKDIR /opt/hadoop
16 changes: 16 additions & 0 deletions hadoop-ozone/dist/src/main/k8s/definitions/jaeger/flekszible.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
description: Jaeger tracing server
54 changes: 54 additions & 0 deletions hadoop-ozone/dist/src/main/k8s/definitions/jaeger/jaeger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: v1
kind: Service
metadata:
name: jaeger
spec:
clusterIP: None
selector:
app: jaeger
component: jaeger
ports:
- name: ui
port: 16686
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: jaeger
spec:
selector:
matchLabels:
app: jaeger
component: jaeger
replicas: 1
serviceName: jaeger
template:
metadata:
labels:
app: jaeger
component: jaeger
spec:
containers:
- name: jaeger
image: jaegertracing/all-in-one:latest
ports:
- containerPort: 16686
name: web
env:
- name: COLLECTOR_ZIPKIN_HTTP_PORT
value: "9411"
Original file line number Diff line number Diff line change
@@ -17,17 +17,15 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: config
labels: {}
annotations: {}
data:
OZONE-SITE.XML_hdds.datanode.dir: "/data/storage"
OZONE-SITE.XML_ozone.scm.datanode.id: "/data/datanode.id"
OZONE-SITE.XML_ozone.metadata.dirs: "/data/metadata"
OZONE-SITE.XML_ozone.scm.block.client.address: "scm-0.scm"
OZONE-SITE.XML_ozone.om.address: "om-0.om"
OZONE-SITE.XML_ozone.scm.client.address: "scm-0.scm"
OZONE-SITE.XML_ozone.scm.names: "scm-0.scm"
OZONE-SITE.XML_ozone.enabled: "true"
OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: "true"
LOG4J.PROPERTIES_log4j.rootLogger: "INFO, stdout"
LOG4J.PROPERTIES_log4j.appender.stdout: "org.apache.log4j.ConsoleAppender"
LOG4J.PROPERTIES_log4j.appender.stdout.layout: "org.apache.log4j.PatternLayout"
43 changes: 43 additions & 0 deletions hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: datanode
labels:
app.kubernetes.io/component: ozone
spec:
selector:
matchLabels:
app: ozone
component: datanode
template:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9882"
prometheus.io/path: "/prom"
labels:
app: ozone
component: datanode
spec:
containers:
- name: datanode
image: "@docker.image@"
args: ["ozone","datanode"]
ports:
- containerPort: 9870
name: rpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: ozone/profiler
description: Enable profiler endpoint.
---
- type: Add
trigger:
metadata:
name: config
path:
- data
value:
OZONE-SITE.XML_hdds.profiler.endpoint.enabled: "true"
ASYNC_PROFILER_HOME: /opt/profiler
Original file line number Diff line number Diff line change
@@ -13,17 +13,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: v1
kind: Service
metadata:
name: datanode-public
labels: {}
annotations: {}
spec:
selector:
app: ozone
component: datanode
ports:
- port: 9870
name: rpc
type: NodePort
name: ozone/prometheus
description: Enable prometheus monitoring in Ozone
---
- type: Add
trigger:
metadata:
name: config
path:
- data
value:
OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: "true"
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: ozone/tracing
description: Enable jaeger tracing
---
- type: Add
path:
- spec
- template
- spec
- containers
- .*
- env
value:
- name: JAEGER_SAMPLER_TYPE
value: probabilistic
- name: JAEGER_SAMPLER_PARAM
value: "0.01"
- name: JAEGER_AGENT_HOST
value: jaeger-0.jaeger
16 changes: 16 additions & 0 deletions hadoop-ozone/dist/src/main/k8s/definitions/ozone/flekszible.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
description: Apache Hadoop Ozone
Loading