From fd9c6ceb3959cae55d15ebf85b7cc3ff5729520e Mon Sep 17 00:00:00 2001 From: Jussi Nummelin Date: Fri, 14 Jun 2019 13:47:49 +0300 Subject: [PATCH] Kontena Storage: add ceph-prom-exporter (#1407) --- .../resources/50-ceph-prom-exporter-rbac.yml | 36 +++++++++++++++++++ .../51-ceph-prom-exporter-deployment.yml.erb | 32 +++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 non-oss/pharos_pro/addons/kontena-storage/resources/50-ceph-prom-exporter-rbac.yml create mode 100644 non-oss/pharos_pro/addons/kontena-storage/resources/51-ceph-prom-exporter-deployment.yml.erb diff --git a/non-oss/pharos_pro/addons/kontena-storage/resources/50-ceph-prom-exporter-rbac.yml b/non-oss/pharos_pro/addons/kontena-storage/resources/50-ceph-prom-exporter-rbac.yml new file mode 100644 index 000000000..3b67b4cfe --- /dev/null +++ b/non-oss/pharos_pro/addons/kontena-storage/resources/50-ceph-prom-exporter-rbac.yml @@ -0,0 +1,36 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: ceph-prom-exporter + namespace: kontena-storage +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + name: ceph-prom-exporter +rules: + - apiGroups: [""] + resources: ["persistentvolumes"] + verbs: + - get + - apiGroups: [""] + resources: ["pods"] + verbs: + - get + - list + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["create"] +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: ceph-prom-exporter +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: ceph-prom-exporter +subjects: + - name: ceph-prom-exporter + namespace: kontena-storage + kind: ServiceAccount diff --git a/non-oss/pharos_pro/addons/kontena-storage/resources/51-ceph-prom-exporter-deployment.yml.erb b/non-oss/pharos_pro/addons/kontena-storage/resources/51-ceph-prom-exporter-deployment.yml.erb new file mode 100644 index 000000000..952b67de6 --- /dev/null +++ b/non-oss/pharos_pro/addons/kontena-storage/resources/51-ceph-prom-exporter-deployment.yml.erb @@ -0,0 +1,32 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: ceph-prom-exporter + namespace: kontena-storage +spec: + replicas: 1 + selector: + matchLabels: + app: ceph-prom-exporter + template: + metadata: + labels: + app: ceph-prom-exporter + annotations: + prometheus.io/path: "/metrics" + prometheus.io/scrape: 'true' + prometheus.io/port: '9292' + spec: + serviceAccountName: ceph-prom-exporter + containers: + - name: ceph-prom-exporter + image: "<%= image_repository %>/ceph-prom-exporter:0.1.0" + ports: + - containerPort: 9292 + resources: + requests: + cpu: 100m + memory: 100M + limits: + cpu: 200m + memory: 100M \ No newline at end of file