This is an automated email from the ASF dual-hosted git repository. elek pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push: new f1673b0 HDDS-1478. Provide k8s resources files for prometheus and performance tests f1673b0 is described below commit f1673b0db136acb99c8735a1cce9c30ad6c3e15a Author: Márton Elek <e...@apache.org> AuthorDate: Thu May 2 11:23:44 2019 +0200 HDDS-1478. Provide k8s resources files for prometheus and performance tests Closes #783 --- .../prometheus.yaml => jaeger/flekszible.yaml} | 12 +--- .../prometheus.yaml => jaeger/jaeger.yaml} | 46 ++++++++++--- .../definitions/{prometheus.yaml => profiler.yaml} | 7 +- .../definitions/ozone/definitions/prometheus.yaml | 2 +- .../definitions/{prometheus.yaml => tracing.yaml} | 21 ++++-- .../main/k8s/definitions/prometheus/configmap.yaml | 49 ++++++++++++++ .../definitions/enable.yaml} | 6 +- .../prometheus.yaml => prometheus/deployment.yaml} | 40 ++++++++--- .../prometheus.yaml => prometheus/flekszible.yaml} | 12 +--- .../prometheus.yaml => prometheus/role.yaml} | 29 +++++--- .../rolebinding.yaml} | 23 ++++--- .../service-account.yaml} | 15 ++-- .../prometheus.yaml => prometheus/service.yaml} | 21 +++--- .../ozone-dev/LICENSE.header} | 11 --- .../k8s/examples/ozone-dev/config-configmap.yaml | 37 ++++++++++ .../k8s/examples/ozone-dev/datanode-daemonset.yaml | 63 +++++++++++++++++ .../ozone-dev/flekszible/flekszible.yaml} | 32 ++++++--- .../ozone-dev/freon/freon-deployment.yaml} | 47 ++++++++++--- .../ozone-dev/jaeger-public-service.yaml} | 24 ++++--- .../ozone-dev/jaeger-service.yaml} | 24 ++++--- .../ozone-dev/jaeger-statefulset.yaml} | 36 +++++++--- .../ozone-dev/om-public-service.yaml} | 24 ++++--- .../ozone-dev/om-service.yaml} | 24 ++++--- .../k8s/examples/ozone-dev/om-statefulset.yaml | 79 ++++++++++++++++++++++ .../ozone-dev/prometheus-clusterrole.yaml} | 38 ++++++++--- .../ozone-dev/prometheus-deployment.yaml} | 42 +++++++++--- .../prometheus-operator-clusterrolebinding.yaml} | 24 ++++--- .../prometheus-operator-serviceaccount.yaml} | 16 ++--- .../ozone-dev/prometheus-service.yaml} | 22 +++--- .../ozone-dev/prometheusconf-configmap.yaml | 50 ++++++++++++++ .../ozone-dev/s3g-public-service.yaml} | 24 ++++--- .../ozone-dev/s3g-service.yaml} | 24 ++++--- .../k8s/examples/ozone-dev/s3g-statefulset.yaml | 58 ++++++++++++++++ .../ozone-dev/scm-public-service.yaml} | 24 ++++--- .../ozone-dev/scm-service.yaml} | 24 ++++--- .../k8s/examples/ozone-dev/scm-statefulset.yaml | 74 ++++++++++++++++++++ 36 files changed, 821 insertions(+), 283 deletions(-) diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/jaeger/flekszible.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/jaeger/flekszible.yaml index 581481f..8fdc155 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/jaeger/flekszible.yaml @@ -13,14 +13,4 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -name: ozone/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true +description: Jaeger tracing server diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/jaeger/jaeger.yaml similarity index 53% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/jaeger/jaeger.yaml index 581481f..4796092 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/jaeger/jaeger.yaml @@ -13,14 +13,42 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone +apiVersion: v1 +kind: Service +metadata: + name: jaeger +spec: + clusterIP: None + selector: + app: jaeger + component: jaeger + ports: + - name: ui + port: 16686 --- -- type: Add - trigger: +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: jaeger +spec: + selector: + matchLabels: + app: jaeger + component: jaeger + replicas: 1 + serviceName: jaeger + template: metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + labels: + app: jaeger + component: jaeger + spec: + containers: + - name: jaeger + image: jaegertracing/all-in-one:latest + ports: + - containerPort: 16686 + name: web + env: + - name: COLLECTOR_ZIPKIN_HTTP_PORT + value: "9411" diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/profiler.yaml similarity index 84% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/profiler.yaml index 581481f..d76931a 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/profiler.yaml @@ -13,8 +13,8 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone +name: ozone/profiler +description: Enable profiler endpoint. --- - type: Add trigger: @@ -23,4 +23,5 @@ description: Enable prometheus monitoring in Ozone path: - data value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + OZONE-SITE.XML_hdds.profiler.endpoint.enabled: "true" + ASYNC_PROFILER_HOME: /opt/profiler \ No newline at end of file diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml index 581481f..604df1f 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml @@ -23,4 +23,4 @@ description: Enable prometheus monitoring in Ozone path: - data value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: "true" diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/tracing.yaml similarity index 72% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/tracing.yaml index 581481f..007b8d1 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/tracing.yaml @@ -13,14 +13,21 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone +name: ozone/tracing +description: Enable jaeger tracing --- - type: Add - trigger: - metadata: - name: config path: - - data + - spec + - template + - spec + - containers + - .* + - env value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + - name: JAEGER_SAMPLER_TYPE + value: probabilistic + - name: JAEGER_SAMPLER_PARAM + value: "0.01" + - name: JAEGER_AGENT_HOST + value: jaeger-0.jaeger diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/configmap.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/configmap.yaml new file mode 100644 index 0000000..f880987 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/configmap.yaml @@ -0,0 +1,49 @@ +# 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: prometheusconf +data: + prometheus.yaml: |- + global: + scrape_interval: 15s + scrape_configs: + - job_name: jmxexporter + kubernetes_sd_configs: + - role: pod + bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token + relabel_configs: + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] + action: keep + regex: true + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] + action: replace + target_label: __metrics_path__ + regex: (.+) + - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] + action: replace + regex: ([^:]+)(?::\d+)?;(\d+) + replacement: $1:$2 + target_label: __address__ + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - source_labels: [__meta_kubernetes_namespace] + action: replace + target_label: kubernetes_namespace + - source_labels: [__meta_kubernetes_pod_name] + action: replace + target_label: kubernetes_pod_name diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/definitions/enable.yaml similarity index 90% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/prometheus/definitions/enable.yaml index 581481f..6825e91 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/definitions/enable.yaml @@ -18,9 +18,9 @@ description: Enable prometheus monitoring in Ozone --- - type: Add trigger: - metadata: - name: config + metadata: + name: config path: - data value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: "true" diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/deployment.yaml similarity index 53% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/prometheus/deployment.yaml index 581481f..6368403 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/deployment.yaml @@ -13,14 +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. -name: ozone/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: +apiVersion: apps/v1beta1 +kind: Deployment +metadata: + name: prometheus + labels: + app: prometheus +spec: + replicas: 1 + selector: + matchLabels: + app: prometheus + template: metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + labels: + app: prometheus + spec: + serviceAccountName: prometheus-operator + containers: + - name: prometheus + image: prom/prometheus + args: ["--config.file=/conf/prometheus.yaml"] + ports: + - containerPort: 9090 + volumeMounts: + - name: config + mountPath: "/conf" + readOnly: true + volumes: + - name: config + configMap: + name: prometheusconf diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/flekszible.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/prometheus/flekszible.yaml index 581481f..20809e5 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/flekszible.yaml @@ -13,14 +13,4 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -name: ozone/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true +description: Prometheus monitoring diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/role.yaml similarity index 70% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/prometheus/role.yaml index 581481f..194e9f4 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/role.yaml @@ -13,14 +13,21 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + name: prometheus +rules: +- apiGroups: [""] + resources: + - nodes + - services + - endpoints + - pods + verbs: ["get", "list", "watch"] +- apiGroups: [""] + resources: + - configmaps + verbs: ["get"] +- nonResourceURLs: ["/metrics"] + verbs: ["get"] diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/rolebinding.yaml similarity index 73% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/prometheus/rolebinding.yaml index 581481f..ef5105d 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/rolebinding.yaml @@ -13,14 +13,15 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: prometheus-operator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: prometheus +subjects: +- kind: ServiceAccount + name: prometheus-operator + namespace: default diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/service-account.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/prometheus/service-account.yaml index 581481f..d5ba196 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/service-account.yaml @@ -13,14 +13,7 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true +apiVersion: v1 +kind: ServiceAccount +metadata: + name: prometheus-operator diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/definitions/prometheus/service.yaml index 581481f..e07aafc 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/definitions/prometheus/service.yaml @@ -13,14 +13,13 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true +kind: Service +apiVersion: v1 +metadata: + name: prometheus +spec: + selector: + app: prometheus + ports: + - protocol: TCP + port: 9090 diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/LICENSE.header similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/LICENSE.header index 581481f..635f0d9 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/LICENSE.header @@ -13,14 +13,3 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/config-configmap.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/config-configmap.yaml new file mode 100644 index 0000000..605f111 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/config-configmap.yaml @@ -0,0 +1,37 @@ +# 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: /data/datanode.id + OZONE-SITE.XML_ozone.metadata.dirs: /data/metadata + OZONE-SITE.XML_ozone.scm.block.client.address: scm-0.scm + OZONE-SITE.XML_ozone.om.address: om-0.om + OZONE-SITE.XML_ozone.scm.client.address: scm-0.scm + OZONE-SITE.XML_ozone.scm.names: scm-0.scm + OZONE-SITE.XML_ozone.enabled: "true" + 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' + OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: "true" + OZONE-SITE.XML_hdds.profiler.endpoint.enabled: "true" + ASYNC_PROFILER_HOME: /opt/profiler 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-daemonset.yaml new file mode 100644 index 0000000..0293cc2 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/datanode-daemonset.yaml @@ -0,0 +1,63 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: datanode + labels: + app.kubernetes.io/component: ozone +spec: + selector: + matchLabels: + app: ozone + component: datanode + template: + metadata: + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9882" + prometheus.io/path: /prom + labels: + app: ozone + component: datanode + spec: + containers: + - name: datanode + image: '@docker.image@' + args: + - ozone + - datanode + ports: + - containerPort: 9870 + name: rpc + env: + - name: JAEGER_SAMPLER_TYPE + value: probabilistic + - name: JAEGER_SAMPLER_PARAM + 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/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/flekszible/flekszible.yaml similarity index 62% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/flekszible/flekszible.yaml index 581481f..9b9f8f3 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/flekszible/flekszible.yaml @@ -13,14 +13,24 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true +source: + - path: ../../../definitions +import: + - path: ozone + transformations: + - type: Image + image: "@docker.image@" + - type: ozone/prometheus + - type: PublishStatefulSet + - type: ozone/tracing + - type: ozone/profiler + - path: prometheus + - path: jaeger + transformations: + - type: PublishService + - path: ozone/freon + destination: freon + transformations: + - type: Image + image: "@docker.image@" + - type: ozone/tracing \ No newline at end of file diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/freon/freon-deployment.yaml similarity index 51% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/freon/freon-deployment.yaml index 581481f..88c9045 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/freon/freon-deployment.yaml @@ -13,14 +13,41 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: freon + labels: + app.kubernetes.io/component: ozone +spec: + replicas: 1 + selector: + matchLabels: + app: ozone + component: freon + template: metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + labels: + app: ozone + component: freon + spec: + containers: + - name: freon + image: '@docker.image@' + args: + - ozone + - freon + - rk + - --factor=THREE + - --replicationType=RATIS + envFrom: + - configMapRef: + name: config + env: + - name: JAEGER_SAMPLER_TYPE + value: probabilistic + - name: JAEGER_SAMPLER_PARAM + value: "0.01" + - name: JAEGER_AGENT_HOST + value: jaeger-0.jaeger diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/jaeger-public-service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/jaeger-public-service.yaml index 581481f..fb06569 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/jaeger-public-service.yaml @@ -13,14 +13,16 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +apiVersion: v1 +kind: Service +metadata: + name: jaeger-public +spec: + selector: + app: jaeger + component: jaeger + ports: + - name: ui + port: 16686 + type: NodePort diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/jaeger-service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/jaeger-service.yaml index 581481f..6e6125a 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/jaeger-service.yaml @@ -13,14 +13,16 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +apiVersion: v1 +kind: Service +metadata: + name: jaeger +spec: + clusterIP: None + selector: + app: jaeger + component: jaeger + ports: + - name: ui + port: 16686 diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/jaeger-statefulset.yaml similarity index 61% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/jaeger-statefulset.yaml index 581481f..5141014 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/jaeger-statefulset.yaml @@ -13,14 +13,30 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: + +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: jaeger +spec: + selector: + matchLabels: + app: jaeger + component: jaeger + replicas: 1 + serviceName: jaeger + template: metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + labels: + app: jaeger + component: jaeger + spec: + containers: + - name: jaeger + image: jaegertracing/all-in-one:latest + ports: + - containerPort: 16686 + name: web + env: + - name: COLLECTOR_ZIPKIN_HTTP_PORT + value: "9411" diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-public-service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-public-service.yaml index 581481f..deb2c33 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-public-service.yaml @@ -13,14 +13,16 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +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/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-service.yaml index 581481f..617277d 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-service.yaml @@ -13,14 +13,16 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +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/ozone-dev/om-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-statefulset.yaml new file mode 100644 index 0000000..927186e --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/om-statefulset.yaml @@ -0,0 +1,79 @@ +# 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: + 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 + - name: JAEGER_SAMPLER_TYPE + value: probabilistic + - name: JAEGER_SAMPLER_PARAM + value: "0.01" + - name: JAEGER_AGENT_HOST + value: jaeger-0.jaeger + envFrom: + - configMapRef: + name: config + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + emptyDir: {} diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-clusterrole.yaml similarity index 70% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-clusterrole.yaml index 581481f..d5df196 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-clusterrole.yaml @@ -13,14 +13,30 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + name: prometheus +rules: +- apiGroups: + - "" + resources: + - nodes + - services + - endpoints + - pods + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get +- nonResourceURLs: + - /metrics + verbs: + - get diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-deployment.yaml similarity index 55% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-deployment.yaml index 581481f..86a188a 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-deployment.yaml @@ -13,14 +13,36 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: + +apiVersion: apps/v1beta1 +kind: Deployment +metadata: + name: prometheus + labels: + app: prometheus +spec: + replicas: 1 + selector: + matchLabels: + app: prometheus + template: metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + labels: + app: prometheus + spec: + serviceAccountName: prometheus-operator + containers: + - name: prometheus + image: prom/prometheus + args: + - --config.file=/conf/prometheus.yaml + ports: + - containerPort: 9090 + volumeMounts: + - name: config + mountPath: /conf + readOnly: true + volumes: + - name: config + configMap: + name: prometheusconf diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-operator-clusterrolebinding.yaml similarity index 73% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-operator-clusterrolebinding.yaml index 581481f..b0d8318 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-operator-clusterrolebinding.yaml @@ -13,14 +13,16 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: prometheus-operator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: prometheus +subjects: +- kind: ServiceAccount + name: prometheus-operator + namespace: default diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-operator-serviceaccount.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-operator-serviceaccount.yaml index 581481f..f816888 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-operator-serviceaccount.yaml @@ -13,14 +13,8 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +apiVersion: v1 +kind: ServiceAccount +metadata: + name: prometheus-operator diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-service.yaml index 581481f..312cf58 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheus-service.yaml @@ -13,14 +13,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -name: ozone/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +kind: Service +apiVersion: v1 +metadata: + name: prometheus +spec: + selector: + app: prometheus + ports: + - protocol: TCP + port: 9090 diff --git a/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheusconf-configmap.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheusconf-configmap.yaml new file mode 100644 index 0000000..6d5b123 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/prometheusconf-configmap.yaml @@ -0,0 +1,50 @@ +# 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: prometheusconf +data: + prometheus.yaml: |- + global: + scrape_interval: 15s + scrape_configs: + - job_name: jmxexporter + kubernetes_sd_configs: + - role: pod + bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token + relabel_configs: + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] + action: keep + regex: true + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] + action: replace + target_label: __metrics_path__ + regex: (.+) + - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] + action: replace + regex: ([^:]+)(?::\d+)?;(\d+) + replacement: $1:$2 + target_label: __address__ + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - source_labels: [__meta_kubernetes_namespace] + action: replace + target_label: kubernetes_namespace + - source_labels: [__meta_kubernetes_pod_name] + action: replace + target_label: kubernetes_pod_name diff --git a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-public-service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-public-service.yaml index 581481f..d2b2420 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-public-service.yaml @@ -13,14 +13,16 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +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/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-service.yaml index 581481f..dd1ca83 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-service.yaml @@ -13,14 +13,16 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +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-dev/s3g-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-statefulset.yaml new file mode 100644 index 0000000..1033f34 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/s3g-statefulset.yaml @@ -0,0 +1,58 @@ +# 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: s3g + labels: + app.kubernetes.io/component: ozone +spec: + selector: + matchLabels: + app: ozone + component: s3g + serviceName: s3g + replicas: 1 + template: + metadata: + labels: + app: ozone + component: s3g + spec: + containers: + - name: s3g + image: '@docker.image@' + args: + - ozone + - s3g + env: + - name: JAEGER_SAMPLER_TYPE + value: probabilistic + - name: JAEGER_SAMPLER_PARAM + 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/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-public-service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-public-service.yaml index 581481f..e3246fc 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-public-service.yaml @@ -13,14 +13,16 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +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/definitions/ozone/definitions/prometheus.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-service.yaml similarity index 78% copy from hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml copy to hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-service.yaml index 581481f..0df15d6 100644 --- a/hadoop-ozone/dist/src/main/k8s/definitions/ozone/definitions/prometheus.yaml +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-service.yaml @@ -13,14 +13,16 @@ # 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/prometheus -description: Enable prometheus monitoring in Ozone ---- -- type: Add - trigger: - metadata: - name: config - path: - - data - value: - OZONE-SITE.XML_hdds.prometheus.endpoint.enabled: true + +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/ozone-dev/scm-statefulset.yaml b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-statefulset.yaml new file mode 100644 index 0000000..87c8d38 --- /dev/null +++ b/hadoop-ozone/dist/src/main/k8s/examples/ozone-dev/scm-statefulset.yaml @@ -0,0 +1,74 @@ +# 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: + 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 + env: + - name: JAEGER_SAMPLER_TYPE + value: probabilistic + - name: JAEGER_SAMPLER_PARAM + value: "0.01" + - name: JAEGER_AGENT_HOST + value: jaeger-0.jaeger + envFrom: + - configMapRef: + name: config + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + emptyDir: {} --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org