From 91220e025b7c580ac0829b71615dcdc98dcb1f39 Mon Sep 17 00:00:00 2001 From: jinia91 Date: Tue, 12 Nov 2024 15:53:01 +0900 Subject: [PATCH] redis-exporter --- .../monolith/redis/redis-exporter.yml | 228 +++++++++--------- deploy/jiniaslog/monolith/redis/redis.yml | 30 ++- 2 files changed, 143 insertions(+), 115 deletions(-) diff --git a/deploy/jiniaslog/monolith/redis/redis-exporter.yml b/deploy/jiniaslog/monolith/redis/redis-exporter.yml index 69870c0a..5bb695db 100644 --- a/deploy/jiniaslog/monolith/redis/redis-exporter.yml +++ b/deploy/jiniaslog/monolith/redis/redis-exporter.yml @@ -1,114 +1,114 @@ ---- -# Source: prometheus-redis-exporter/templates/serviceaccount.yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: redis-exporter-prometheus-redis-exporter - labels: - app.kubernetes.io/name: prometheus-redis-exporter - app.kubernetes.io/instance: redis-exporter - app.kubernetes.io/version: "v1.66.0" ---- -# Source: prometheus-redis-exporter/templates/role.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: redis-exporter-prometheus-redis-exporter - labels: - app.kubernetes.io/name: prometheus-redis-exporter - app.kubernetes.io/instance: redis-exporter - app.kubernetes.io/version: "v1.66.0" -rules: -- apiGroups: ['extensions'] - resources: ['podsecuritypolicies'] - verbs: ['use'] - resourceNames: [redis-exporter-prometheus-redis-exporter] ---- -# Source: prometheus-redis-exporter/templates/rolebinding.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: redis-exporter-prometheus-redis-exporter - labels: - app.kubernetes.io/name: prometheus-redis-exporter - app.kubernetes.io/instance: redis-exporter - app.kubernetes.io/version: "v1.66.0" -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: redis-exporter-prometheus-redis-exporter -subjects: -- kind: ServiceAccount - name: redis-exporter-prometheus-redis-exporter ---- -# Source: prometheus-redis-exporter/templates/service.yaml -apiVersion: v1 -kind: Service -metadata: - name: redis-exporter-prometheus-redis-exporter - labels: - app.kubernetes.io/name: prometheus-redis-exporter - app.kubernetes.io/instance: redis-exporter - app.kubernetes.io/version: "v1.66.0" - prometheus.io/scrape: "true" - prometheus.io/port: "9121" - annotations: - {} -spec: - type: ClusterIP - ports: - - name: redis-exporter - port: 9121 - targetPort: exporter-port - protocol: TCP - selector: - app.kubernetes.io/name: prometheus-redis-exporter - app.kubernetes.io/instance: redis-exporter ---- -# Source: prometheus-redis-exporter/templates/deployment.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: redis-exporter-prometheus-redis-exporter - labels: - app.kubernetes.io/name: prometheus-redis-exporter - app.kubernetes.io/instance: redis-exporter - app.kubernetes.io/version: "v1.66.0" - annotations: - {} -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: prometheus-redis-exporter - app.kubernetes.io/instance: redis-exporter - template: - metadata: - annotations: - {} - labels: - app.kubernetes.io/name: prometheus-redis-exporter - app.kubernetes.io/instance: redis-exporter - app.kubernetes.io/version: "v1.66.0" - spec: - serviceAccountName: redis-exporter-prometheus-redis-exporter - containers: - - name: prometheus-redis-exporter - image: "oliver006/redis_exporter:v1.66.0" - imagePullPolicy: IfNotPresent - ports: - - name: exporter-port - containerPort: 9121 - env: - - name: REDIS_ADDR - value: redis://jinias-redis-ha:6379 - livenessProbe: - httpGet: - path: / - port: exporter-port - readinessProbe: - httpGet: - path: / - port: exporter-port - resources: - {} +#--- +## Source: prometheus-redis-exporter/templates/serviceaccount.yaml +#apiVersion: v1 +#kind: ServiceAccount +#metadata: +# name: redis-exporter-prometheus-redis-exporter +# labels: +# app.kubernetes.io/name: prometheus-redis-exporter +# app.kubernetes.io/instance: redis-exporter +# app.kubernetes.io/version: "v1.66.0" +#--- +## Source: prometheus-redis-exporter/templates/role.yaml +#apiVersion: rbac.authorization.k8s.io/v1 +#kind: Role +#metadata: +# name: redis-exporter-prometheus-redis-exporter +# labels: +# app.kubernetes.io/name: prometheus-redis-exporter +# app.kubernetes.io/instance: redis-exporter +# app.kubernetes.io/version: "v1.66.0" +#rules: +#- apiGroups: ['extensions'] +# resources: ['podsecuritypolicies'] +# verbs: ['use'] +# resourceNames: [redis-exporter-prometheus-redis-exporter] +#--- +## Source: prometheus-redis-exporter/templates/rolebinding.yaml +#apiVersion: rbac.authorization.k8s.io/v1 +#kind: RoleBinding +#metadata: +# name: redis-exporter-prometheus-redis-exporter +# labels: +# app.kubernetes.io/name: prometheus-redis-exporter +# app.kubernetes.io/instance: redis-exporter +# app.kubernetes.io/version: "v1.66.0" +#roleRef: +# apiGroup: rbac.authorization.k8s.io +# kind: Role +# name: redis-exporter-prometheus-redis-exporter +#subjects: +#- kind: ServiceAccount +# name: redis-exporter-prometheus-redis-exporter +#--- +## Source: prometheus-redis-exporter/templates/service.yaml +#apiVersion: v1 +#kind: Service +#metadata: +# name: redis-exporter-prometheus-redis-exporter +# labels: +# app.kubernetes.io/name: prometheus-redis-exporter +# app.kubernetes.io/instance: redis-exporter +# app.kubernetes.io/version: "v1.66.0" +# prometheus.io/scrape: "true" +# prometheus.io/port: "9121" +# annotations: +# {} +#spec: +# type: ClusterIP +# ports: +# - name: redis-exporter +# port: 9121 +# targetPort: exporter-port +# protocol: TCP +# selector: +# app.kubernetes.io/name: prometheus-redis-exporter +# app.kubernetes.io/instance: redis-exporter +#--- +## Source: prometheus-redis-exporter/templates/deployment.yaml +#apiVersion: apps/v1 +#kind: Deployment +#metadata: +# name: redis-exporter-prometheus-redis-exporter +# labels: +# app.kubernetes.io/name: prometheus-redis-exporter +# app.kubernetes.io/instance: redis-exporter +# app.kubernetes.io/version: "v1.66.0" +# annotations: +# {} +#spec: +# replicas: 1 +# selector: +# matchLabels: +# app.kubernetes.io/name: prometheus-redis-exporter +# app.kubernetes.io/instance: redis-exporter +# template: +# metadata: +# annotations: +# {} +# labels: +# app.kubernetes.io/name: prometheus-redis-exporter +# app.kubernetes.io/instance: redis-exporter +# app.kubernetes.io/version: "v1.66.0" +# spec: +# serviceAccountName: redis-exporter-prometheus-redis-exporter +# containers: +# - name: prometheus-redis-exporter +# image: "oliver006/redis_exporter:v1.66.0" +# imagePullPolicy: IfNotPresent +# ports: +# - name: exporter-port +# containerPort: 9121 +# env: +# - name: REDIS_ADDR +# value: redis://jinias-redis-ha:6379 +# livenessProbe: +# httpGet: +# path: / +# port: exporter-port +# readinessProbe: +# httpGet: +# path: / +# port: exporter-port +# resources: +# {} diff --git a/deploy/jiniaslog/monolith/redis/redis.yml b/deploy/jiniaslog/monolith/redis/redis.yml index 0118dd0d..1317d544 100644 --- a/deploy/jiniaslog/monolith/redis/redis.yml +++ b/deploy/jiniaslog/monolith/redis/redis.yml @@ -787,6 +787,10 @@ spec: port: 26379 protocol: TCP targetPort: sentinel + - name: metrics + port: 9121 + protocol: TCP + targetPort: 9121 selector: release: jinias app: redis-ha @@ -899,6 +903,9 @@ spec: metadata: annotations: checksum/init-config: 35476e45d4cc022feb5f56366eec7a3f71e1f3a10d86c29d8dca4c122db291fe + prometheus.io/scrape: "true" + prometheus.io/port: "9121" + labels: release: jinias app: redis-ha @@ -1088,6 +1095,28 @@ spec: lifecycle: {} + - name: redis-exporter + image: oliver006/redis_exporter:v1.66.0 + imagePullPolicy: IfNotPresent + env: + - name: REDIS_ADDR + value: "redis://localhost:6379" + ports: + - name: exporter-port + containerPort: 9121 + livenessProbe: + httpGet: + path: / + port: exporter-port + initialDelaySeconds: 5 + periodSeconds: 10 + readinessProbe: + httpGet: + path: / + port: exporter-port + initialDelaySeconds: 5 + periodSeconds: 10 + - name: split-brain-fix image: public.ecr.aws/docker/library/redis:7.2.4-alpine imagePullPolicy: IfNotPresent @@ -1132,7 +1161,6 @@ spec: kind: PersistentVolumeClaim metadata: name: data - annotations: labels: {}