diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ss-service.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ss-service.yaml new file mode 100644 index 0000000000..7c221d9c44 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ss-service.yaml @@ -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: datanode +spec: + ports: + - port: 9870 + name: rpc + clusterIP: None + selector: + app: ozone + component: datanode diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ss.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ss.yaml new file mode 100644 index 0000000000..94dc570c45 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ss.yaml @@ -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 cdatanodepliance +# 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: StatefulSet +metadata: + name: datanode + labels: + app.kubernetes.io/component: ozone +spec: + selector: + matchLabels: + app: ozone + component: datanode + serviceName: datanode + replicas: 3 + template: + metadata: + labels: + app: ozone + component: datanode + annotations: + prdatanodeetheus.io/scrape: "true" + prdatanodeetheus.io/port: "9882" + prdatanodeetheus.io/path: "/prom" + spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: component + operator: In + values: + - datanode + topologyKey: "kubernetes.io/hostname" + securityContext: + fsGroup: 1000 + containers: + - name: datanode + image: "@docker.image@" + args: ["ozone","datanode"] diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/transformations/emptydir.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/emptydir.yaml similarity index 82% rename from hadoop-ozone/dist/src/main/k8s/definitions/ozone/transformations/emptydir.yaml rename to hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/emptydir.yaml index 5f9b94a2c5..7a717bfb36 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/transformations/emptydir.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/emptydir.yaml @@ -13,6 +13,9 @@ # 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/emptydir +description: Add empty dir based ephemeral persistence +--- - type: Add trigger: metadata: @@ -22,22 +25,7 @@ - spec - template - spec - - containers - - "*" - - volumeMounts - value: - - name: data - mountPath: /data -- type: Add - trigger: - metadata: - labels: - app.kubernetes.io/component: ozone - path: - - spec - - template - - spec - - initContainers + - (initContainers|containers) - "*" - volumeMounts value: diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/persistence.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/persistence.yaml new file mode 100644 index 0000000000..33a818d5ca --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/persistence.yaml @@ -0,0 +1,66 @@ +# 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/persistence +description: Add real PVC based persistence +--- +- type: Add + path: + - spec + trigger: + kind: StatefulSet + value: + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 2Gi +- type: Add + trigger: + metadata: + name: datanode + path: + - spec + - template + - spec + value: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: component + operator: In + values: + - datanode + topologyKey: kubernetes.io/hostname +- type: Add + trigger: + metadata: + labels: + app.kubernetes.io/component: ozone + path: + - spec + - template + - spec + - (initContainers|containers) + - "*" + - volumeMounts + value: + - name: data + mountPath: /data \ No newline at end of file diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/om-ss.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/om-ss.yaml index 9f9d87df7d..5c2f7cc669 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/om-ss.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/om-ss.yaml @@ -36,6 +36,8 @@ spec: prometheus.io/port: "9874" prometheus.io/path: "/prom" spec: + securityContext: + fsGroup: 1000 initContainers: - name: init image: "@docker.image@" diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/scm-ss.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/scm-ss.yaml index 9329a5ffe1..b3c36b7d0d 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/scm-ss.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/scm-ss.yaml @@ -36,6 +36,8 @@ spec: prometheus.io/port: "9876" prometheus.io/path: "/prom" spec: + securityContext: + fsGroup: 1000 initContainers: - name: init image: "@docker.image@" diff --git a/hadoop-ozone/dist/src/main/k8s/examples/minikube/flekszible/flekszible.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/Flekszible similarity index 96% rename from hadoop-ozone/dist/src/main/k8s/examples/minikube/flekszible/flekszible.yaml rename to hadoop-ozone/dist/src/main/k8s/examples/getting-started/Flekszible index 81207e72e7..e00d9ce818 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/minikube/flekszible/flekszible.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/Flekszible @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. source: - - path: ../../../definitions + - path: ../../definitions import: - path: ozone transformations: - type: Image image: "@docker.image@" - - type: DaemonToStatefulSet - type: PublishStatefulSet + - type: ozone/emptydir - path: ozone/freon destination: freon transformations: diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/LICENSE.header b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/LICENSE.header new file mode 100644 index 0000000000..635f0d9e60 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/LICENSE.header @@ -0,0 +1,15 @@ +# 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. diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/config-configmap.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/config-configmap.yaml new file mode 100644 index 0000000000..94d16d2f74 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/config-configmap.yaml @@ -0,0 +1,34 @@ +# 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: ConfigMap +metadata: + name: config +data: + OZONE-SITE.XML_hdds.datanode.dir: /data/storage + OZONE-SITE.XML_ozone.scm.datanode.id.dir: /data + 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" + 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 + LOG4J.PROPERTIES_log4j.appender.stdout.layout.ConversionPattern: '%d{yyyy-MM-dd + HH:mm:ss} %-5p %c{1}:%L - %m%n' diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/datanode-public-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/datanode-public-service.yaml new file mode 100644 index 0000000000..89b59140a2 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/datanode-public-service.yaml @@ -0,0 +1,28 @@ +# 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: datanode-public +spec: + ports: + - port: 9870 + name: rpc + selector: + app: ozone + component: datanode + type: NodePort diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/datanode-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/datanode-service.yaml new file mode 100644 index 0000000000..929e7a2595 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/datanode-service.yaml @@ -0,0 +1,28 @@ +# 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: datanode +spec: + ports: + - port: 9870 + name: rpc + clusterIP: None + selector: + app: ozone + component: datanode diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/datanode-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/datanode-statefulset.yaml new file mode 100644 index 0000000000..6c8d1bfdb1 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/datanode-statefulset.yaml @@ -0,0 +1,66 @@ +# 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: StatefulSet +metadata: + name: datanode + labels: + app.kubernetes.io/component: ozone +spec: + selector: + matchLabels: + app: ozone + component: datanode + serviceName: datanode + replicas: 3 + template: + metadata: + labels: + app: ozone + component: datanode + annotations: + prdatanodeetheus.io/scrape: "true" + prdatanodeetheus.io/port: "9882" + prdatanodeetheus.io/path: /prom + spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: component + operator: In + values: + - datanode + topologyKey: kubernetes.io/hostname + securityContext: + fsGroup: 1000 + containers: + - name: datanode + image: '@docker.image@' + args: + - ozone + - datanode + envFrom: + - configMapRef: + name: config + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + emptyDir: {} diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ds.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/freon/freon-deployment.yaml similarity index 72% rename from hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ds.yaml rename to hadoop-ozone/dist/src/main/k8s/examples/getting-started/freon/freon-deployment.yaml index fbc340c714..1662c4e3f2 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/datanode-ds.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/freon/freon-deployment.yaml @@ -13,31 +13,34 @@ # 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 +kind: Deployment metadata: - name: datanode + name: freon labels: app.kubernetes.io/component: ozone spec: + replicas: 1 selector: matchLabels: app: ozone - component: datanode + component: freon template: metadata: - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "9882" - prometheus.io/path: "/prom" labels: app: ozone - component: datanode + component: freon spec: containers: - - name: datanode - image: "@docker.image@" - args: ["ozone","datanode"] - ports: - - containerPort: 9870 - name: rpc + - name: freon + image: '@docker.image@' + args: + - ozone + - freon + - rk + - --factor=THREE + - --replicationType=RATIS + envFrom: + - configMapRef: + name: config diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/om-public-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/om-public-service.yaml new file mode 100644 index 0000000000..deb2c333c3 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/om-public-service.yaml @@ -0,0 +1,28 @@ +# 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-public +spec: + ports: + - port: 9874 + name: ui + selector: + app: ozone + component: om + type: NodePort diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/om-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/om-service.yaml new file mode 100644 index 0000000000..617277d9b8 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/om-service.yaml @@ -0,0 +1,28 @@ +# 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 diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/om-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/om-statefulset.yaml new file mode 100644 index 0000000000..c8ff81b0b9 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/om-statefulset.yaml @@ -0,0 +1,75 @@ +# 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: StatefulSet +metadata: + name: om + labels: + app.kubernetes.io/component: ozone +spec: + selector: + matchLabels: + app: ozone + component: om + serviceName: om + replicas: 1 + template: + metadata: + labels: + app: ozone + component: om + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9874" + prometheus.io/path: /prom + spec: + securityContext: + fsGroup: 1000 + initContainers: + - name: init + image: '@docker.image@' + args: + - ozone + - om + - --init + env: + - name: WAITFOR + value: scm-0.scm:9876 + envFrom: + - configMapRef: + name: config + volumeMounts: + - name: data + mountPath: /data + containers: + - name: om + image: '@docker.image@' + args: + - ozone + - om + env: + - name: WAITFOR + value: scm-0.scm:9876 + envFrom: + - configMapRef: + name: config + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + emptyDir: {} diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/s3g-public-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/s3g-public-service.yaml new file mode 100644 index 0000000000..d2b2420576 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/s3g-public-service.yaml @@ -0,0 +1,28 @@ +# 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: s3g-public +spec: + ports: + - port: 9878 + name: rest + selector: + app: ozone + component: s3g + type: NodePort diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/s3g-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/s3g-service.yaml new file mode 100644 index 0000000000..dd1ca83479 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/s3g-service.yaml @@ -0,0 +1,28 @@ +# 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: s3g +spec: + ports: + - port: 9878 + name: rest + clusterIP: None + selector: + app: ozone + component: s3g diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone/datanode-daemonset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/s3g-statefulset.yaml similarity index 78% rename from hadoop-ozone/dist/src/main/k8s/examples/ozone/datanode-daemonset.yaml rename to hadoop-ozone/dist/src/main/k8s/examples/getting-started/s3g-statefulset.yaml index 6e3b3b96cf..c7e13e55cf 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone/datanode-daemonset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/s3g-statefulset.yaml @@ -15,42 +15,36 @@ # limitations under the License. apiVersion: apps/v1 -kind: DaemonSet +kind: StatefulSet metadata: - name: datanode + name: s3g labels: app.kubernetes.io/component: ozone spec: selector: matchLabels: app: ozone - component: datanode + component: s3g + serviceName: s3g + replicas: 1 template: metadata: - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "9882" - prometheus.io/path: /prom labels: app: ozone - component: datanode + component: s3g spec: containers: - - name: datanode + - name: s3g image: '@docker.image@' args: - ozone - - datanode - ports: - - containerPort: 9870 - name: rpc + - s3g envFrom: - configMapRef: name: config volumeMounts: - name: data mountPath: /data - initContainers: [] volumes: - name: data emptyDir: {} diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/scm-public-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/scm-public-service.yaml new file mode 100644 index 0000000000..e3246fc5e3 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/scm-public-service.yaml @@ -0,0 +1,28 @@ +# 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: scm-public +spec: + ports: + - port: 9876 + name: ui + selector: + app: ozone + component: scm + type: NodePort diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/scm-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/scm-service.yaml new file mode 100644 index 0000000000..0df15d6453 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/scm-service.yaml @@ -0,0 +1,28 @@ +# 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: scm +spec: + ports: + - port: 9876 + name: ui + clusterIP: None + selector: + app: ozone + component: scm diff --git a/hadoop-ozone/dist/src/main/k8s/examples/getting-started/scm-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/scm-statefulset.yaml new file mode 100644 index 0000000000..e1deed8ab8 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/getting-started/scm-statefulset.yaml @@ -0,0 +1,69 @@ +# 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: StatefulSet +metadata: + name: scm + labels: + app.kubernetes.io/component: ozone +spec: + selector: + matchLabels: + app: ozone + component: scm + serviceName: scm + replicas: 1 + template: + metadata: + labels: + app: ozone + component: scm + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9876" + prometheus.io/path: /prom + spec: + securityContext: + fsGroup: 1000 + initContainers: + - name: init + image: '@docker.image@' + args: + - ozone + - scm + - --init + envFrom: + - configMapRef: + name: config + volumeMounts: + - name: data + mountPath: /data + containers: + - name: scm + image: '@docker.image@' + args: + - ozone + - scm + envFrom: + - configMapRef: + name: config + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + emptyDir: {} diff --git a/hadoop-ozone/dist/src/main/k8s/examples/minikube/Flekszible b/hadoop-ozone/dist/src/main/k8s/examples/minikube/Flekszible new file mode 100644 index 0000000000..e00d9ce818 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/minikube/Flekszible @@ -0,0 +1,45 @@ +# 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. +source: + - path: ../../definitions +import: + - path: ozone + transformations: + - type: Image + image: "@docker.image@" + - type: PublishStatefulSet + - type: ozone/emptydir + - path: ozone/freon + destination: freon + transformations: + - type: Image + image: "@docker.image@" +header: |- + # 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. diff --git a/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-public-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-public-service.yaml new file mode 100644 index 0000000000..89b59140a2 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-public-service.yaml @@ -0,0 +1,28 @@ +# 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: datanode-public +spec: + ports: + - port: 9870 + name: rpc + selector: + app: ozone + component: datanode + type: NodePort diff --git a/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-service.yaml index 0e5927d162..929e7a2595 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-service.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-service.yaml @@ -19,6 +19,9 @@ kind: Service metadata: name: datanode spec: + ports: + - port: 9870 + name: rpc clusterIP: None selector: app: ozone diff --git a/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-statefulset.yaml index a453b9a3d6..6c8d1bfdb1 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/minikube/datanode-statefulset.yaml @@ -25,34 +25,42 @@ spec: matchLabels: app: ozone component: datanode + serviceName: datanode + replicas: 3 template: metadata: - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "9882" - prometheus.io/path: /prom labels: app: ozone component: datanode + annotations: + prdatanodeetheus.io/scrape: "true" + prdatanodeetheus.io/port: "9882" + prdatanodeetheus.io/path: /prom spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: component + operator: In + values: + - datanode + topologyKey: kubernetes.io/hostname + securityContext: + fsGroup: 1000 containers: - name: datanode image: '@docker.image@' args: - ozone - datanode - ports: - - containerPort: 9870 - name: rpc envFrom: - configMapRef: name: config volumeMounts: - name: data mountPath: /data - initContainers: [] volumes: - name: data emptyDir: {} - serviceName: datanode - replicas: 3 diff --git a/hadoop-ozone/dist/src/main/k8s/examples/minikube/om-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/minikube/om-statefulset.yaml index e0811e4a73..c8ff81b0b9 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/minikube/om-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/minikube/om-statefulset.yaml @@ -37,6 +37,8 @@ spec: prometheus.io/port: "9874" prometheus.io/path: /prom spec: + securityContext: + fsGroup: 1000 initContainers: - name: init image: '@docker.image@' @@ -44,6 +46,9 @@ spec: - ozone - om - --init + env: + - name: WAITFOR + value: scm-0.scm:9876 envFrom: - configMapRef: name: config @@ -56,6 +61,9 @@ spec: args: - ozone - om + env: + - name: WAITFOR + value: scm-0.scm:9876 envFrom: - configMapRef: name: config diff --git a/hadoop-ozone/dist/src/main/k8s/examples/minikube/s3g-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/minikube/s3g-statefulset.yaml index b608cde832..c7e13e55cf 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/minikube/s3g-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/minikube/s3g-statefulset.yaml @@ -45,7 +45,6 @@ spec: volumeMounts: - name: data mountPath: /data - initContainers: [] volumes: - name: data emptyDir: {} diff --git a/hadoop-ozone/dist/src/main/k8s/examples/minikube/scm-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/minikube/scm-statefulset.yaml index 55b56722d1..e1deed8ab8 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/minikube/scm-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/minikube/scm-statefulset.yaml @@ -37,6 +37,8 @@ spec: prometheus.io/port: "9876" prometheus.io/path: /prom spec: + securityContext: + fsGroup: 1000 initContainers: - name: init image: '@docker.image@' diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/flekszible/flekszible.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/Flekszible similarity index 93% rename from hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/flekszible/flekszible.yaml rename to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/Flekszible index 9b9f8f39d9..d28ecf5c1d 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/flekszible/flekszible.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/Flekszible @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. source: - - path: ../../../definitions + - path: ../../definitions import: - path: ozone transformations: @@ -24,6 +24,7 @@ import: - type: PublishStatefulSet - type: ozone/tracing - type: ozone/profiler + - type: ozone/emptydir - path: prometheus - path: jaeger transformations: @@ -33,4 +34,4 @@ import: transformations: - type: Image image: "@docker.image@" - - type: ozone/tracing \ No newline at end of file + - type: ozone/tracing diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-public-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-public-service.yaml new file mode 100644 index 0000000000..89b59140a2 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-public-service.yaml @@ -0,0 +1,28 @@ +# 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: datanode-public +spec: + ports: + - port: 9870 + name: rpc + selector: + app: ozone + component: datanode + type: NodePort diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-service.yaml new file mode 100644 index 0000000000..929e7a2595 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-service.yaml @@ -0,0 +1,28 @@ +# 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: datanode +spec: + ports: + - port: 9870 + name: rpc + clusterIP: None + selector: + app: ozone + component: datanode diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-daemonset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-statefulset.yaml similarity index 74% rename from hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-daemonset.yaml rename to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-statefulset.yaml index 0293cc25ea..843aa948e1 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-daemonset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-statefulset.yaml @@ -15,7 +15,7 @@ # limitations under the License. apiVersion: apps/v1 -kind: DaemonSet +kind: StatefulSet metadata: name: datanode labels: @@ -25,25 +25,39 @@ spec: matchLabels: app: ozone component: datanode + serviceName: datanode + replicas: 3 template: metadata: - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "9882" - prometheus.io/path: /prom labels: app: ozone component: datanode + annotations: + prdatanodeetheus.io/scrape: "true" + prdatanodeetheus.io/port: "9882" + prdatanodeetheus.io/path: /prom spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: component + operator: In + values: + - datanode + topologyKey: kubernetes.io/hostname + securityContext: + fsGroup: 1000 containers: - name: datanode image: '@docker.image@' args: - ozone - datanode - ports: - - containerPort: 9870 - name: rpc + envFrom: + - configMapRef: + name: config env: - name: JAEGER_SAMPLER_TYPE value: probabilistic @@ -51,13 +65,9 @@ spec: value: "0.01" - name: JAEGER_AGENT_HOST value: jaeger-0.jaeger - envFrom: - - configMapRef: - name: config volumeMounts: - name: data mountPath: /data - initContainers: [] volumes: - name: data emptyDir: {} diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-statefulset.yaml index 927186e76c..8d7e9f1e99 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-statefulset.yaml @@ -37,6 +37,8 @@ spec: prometheus.io/port: "9874" prometheus.io/path: /prom spec: + securityContext: + fsGroup: 1000 initContainers: - name: init image: '@docker.image@' diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-statefulset.yaml index 1033f34820..72d5550422 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-statefulset.yaml @@ -39,6 +39,9 @@ spec: args: - ozone - s3g + envFrom: + - configMapRef: + name: config env: - name: JAEGER_SAMPLER_TYPE value: probabilistic @@ -46,13 +49,9 @@ spec: value: "0.01" - name: JAEGER_AGENT_HOST value: jaeger-0.jaeger - envFrom: - - configMapRef: - name: config volumeMounts: - name: data mountPath: /data - initContainers: [] volumes: - name: data emptyDir: {} diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-statefulset.yaml index 87c8d38783..8717ff741c 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-statefulset.yaml @@ -37,6 +37,8 @@ spec: prometheus.io/port: "9876" prometheus.io/path: /prom spec: + securityContext: + fsGroup: 1000 initContainers: - name: init image: '@docker.image@' @@ -56,6 +58,9 @@ spec: args: - ozone - scm + envFrom: + - configMapRef: + name: config env: - name: JAEGER_SAMPLER_TYPE value: probabilistic @@ -63,9 +68,6 @@ spec: value: "0.01" - name: JAEGER_AGENT_HOST value: jaeger-0.jaeger - envFrom: - - configMapRef: - name: config volumeMounts: - name: data mountPath: /data diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone/flekszible/flekszible.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone/Flekszible similarity index 96% rename from hadoop-ozone/dist/src/main/k8s/examples/ozone/flekszible/flekszible.yaml rename to hadoop-ozone/dist/src/main/k8s/examples/ozone/Flekszible index 5da1f20d41..434b0b6f57 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone/flekszible/flekszible.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone/Flekszible @@ -14,12 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. source: - - path: ../../../definitions + - path: ../../definitions import: - path: ozone transformations: - type: Image image: "@docker.image@" + - type: ozone/persistence - path: ozone/freon destination: freon transformations: diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone/datanode-service.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone/datanode-service.yaml new file mode 100644 index 0000000000..929e7a2595 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone/datanode-service.yaml @@ -0,0 +1,28 @@ +# 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: datanode +spec: + ports: + - port: 9870 + name: rpc + clusterIP: None + selector: + app: ozone + component: datanode diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone/datanode-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone/datanode-statefulset.yaml new file mode 100644 index 0000000000..b74d58e856 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone/datanode-statefulset.yaml @@ -0,0 +1,72 @@ +# 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: StatefulSet +metadata: + name: datanode + labels: + app.kubernetes.io/component: ozone +spec: + selector: + matchLabels: + app: ozone + component: datanode + serviceName: datanode + replicas: 3 + template: + metadata: + labels: + app: ozone + component: datanode + annotations: + prdatanodeetheus.io/scrape: "true" + prdatanodeetheus.io/port: "9882" + prdatanodeetheus.io/path: /prom + spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: component + operator: In + values: + - datanode + topologyKey: kubernetes.io/hostname + securityContext: + fsGroup: 1000 + containers: + - name: datanode + image: '@docker.image@' + args: + - ozone + - datanode + envFrom: + - configMapRef: + name: config + volumeMounts: + - name: data + mountPath: /data + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone/om-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone/om-statefulset.yaml index 884dd46241..6cb53e7501 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone/om-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone/om-statefulset.yaml @@ -37,6 +37,8 @@ spec: prometheus.io/port: "9874" prometheus.io/path: /prom spec: + securityContext: + fsGroup: 1000 initContainers: - name: init image: '@docker.image@' @@ -68,6 +70,13 @@ spec: volumeMounts: - name: data mountPath: /data - volumes: - - name: data - emptyDir: {} + volumes: [] + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone/s3g-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone/s3g-statefulset.yaml index b608cde832..2ad951f922 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone/s3g-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone/s3g-statefulset.yaml @@ -45,7 +45,12 @@ spec: volumeMounts: - name: data mountPath: /data - initContainers: [] - volumes: - - name: data - emptyDir: {} + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone/scm-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone/scm-statefulset.yaml index 55b56722d1..a63c3fc52e 100644 --- a/hadoop-ozone/dist/src/main/k8s/examples/ozone/scm-statefulset.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone/scm-statefulset.yaml @@ -37,6 +37,8 @@ spec: prometheus.io/port: "9876" prometheus.io/path: /prom spec: + securityContext: + fsGroup: 1000 initContainers: - name: init image: '@docker.image@' @@ -62,6 +64,12 @@ spec: volumeMounts: - name: data mountPath: /data - volumes: - - name: data - emptyDir: {} + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi