Skip to content
Closed
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -28,6 +28,7 @@
<properties>
<file.encoding>UTF-8</file.encoding>
<downloadSources>true</downloadSources>
<docker.image>apache/hadoop:${project.version}</docker.image>
</properties>

<build>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
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
Expand Up @@ -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
Expand Up @@ -13,7 +13,4 @@
# 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: ServiceAccount
metadata:
name: prometheus-operator
description: Apache Hadoop Ozone
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,4 @@
# 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: skaffold/v1alpha5
kind: Config
build:
artifacts:
- image: apache/ozone
deploy:
kubectl:
manifests:
- src/main/k8s/ozone/*
description: Load test tool for Apache Hadoop Ozone
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apps/v1
kind: StatefulSet
kind: Deployment
metadata:
name: datanode
labels: {}
annotations: {}
name: freon
labels:
app.kubernetes.io/component: ozone
spec:
replicas: 1
selector:
matchLabels:
app: ozone
component: datanode
component: freon
template:
metadata:
labels:
app: ozone
component: datanode
component: freon
spec:
containers:
- name: datanode
image: apache/ozone
args:
- ozone
- datanode
ports:
- containerPort: 9870
name: rpc
volumeMounts:
- name: "data"
mountPath: "/data"
- name: freon
image: "@docker.image@"
args: ["ozone","freon", "rk", "--factor=THREE", "--replicationType=RATIS"]
envFrom:
- configMapRef:
name: config
volumes:
- name: "data"
emptyDir: {}
serviceName: datanode
replicas: 3
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.
apiVersion: v1
kind: Service
metadata:
name: om
spec:
ports:
- port: 9874
name: ui
clusterIP: None
selector:
app: ozone
component: om
Loading