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 00000000000..7c221d9c44b --- /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 00000000000..94dc570c451 --- /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 5f9b94a2c5d..7a717bfb363 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 00000000000..33a818d5cae --- /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 9f9d87df7dd..5c2f7cc6694 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 9329a5ffe1a..b3c36b7d0de 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 81207e72e76..e00d9ce8182 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 00000000000..635f0d9e60e --- /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 00000000000..94d16d2f74d --- /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 00000000000..89b59140a25 --- /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 00000000000..929e7a25950 --- /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 00000000000..6c8d1bfdb1a --- /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 fbc340c714a..1662c4e3f24 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 00000000000..deb2c333c38 --- /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 00000000000..617277d9b85 --- /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 00000000000..c8ff81b0b93 --- /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 00000000000..d2b2420576c --- /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 00000000000..dd1ca834799 --- /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 6e3b3b96cf0..c7e13e55cf5 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 00000000000..e3246fc5e35 --- /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 00000000000..0df15d64531 --- /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 00000000000..e1deed8ab84 --- /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 00000000000..e00d9ce8182 --- /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 00000000000..89b59140a25 --- /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 0e5927d1622..929e7a25950 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 a453b9a3d61..6c8d1bfdb1a 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 e0811e4a73e..c8ff81b0b93 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 b608cde832e..c7e13e55cf5 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 55b56722d10..e1deed8ab84 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 9b9f8f39d95..d28ecf5c1d5 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 00000000000..89b59140a25 --- /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 00000000000..929e7a25950 --- /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 0293cc25eac..843aa948e10 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 927186e76c6..8d7e9f1e999 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 1033f348207..72d55504226 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 87c8d387838..8717ff741cf 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 5da1f20d41b..434b0b6f576 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 00000000000..929e7a25950 --- /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 00000000000..b74d58e8569 --- /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 884dd462417..6cb53e75016 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 b608cde832e..2ad951f922d 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 55b56722d10..a63c3fc52e9 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