| 1 | --- |
| 2 | apiVersion: v1 |
| 3 | kind: Namespace |
| 4 | metadata: |
| 5 | name: redis |
| 6 | --- |
| 7 | apiVersion: apps/v1 |
| 8 | kind: Deployment |
| 9 | metadata: |
| 10 | namespace: redis |
| 11 | name: redis |
| 12 | spec: |
| 13 | replicas: 1 |
| 14 | selector: |
| 15 | matchLabels: |
| 16 | app: redis |
| 17 | template: |
| 18 | metadata: |
| 19 | annotations: |
| 20 | prometheus.io/scrape: "true" |
| 21 | prometheus.io/port: "9121" |
| 22 | labels: |
| 23 | app: redis |
| 24 | spec: |
| 25 | containers: |
| 26 | - name: redis |
| 27 | image: redis:4 |
| 28 | resources: |
| 29 | requests: |
| 30 | cpu: 100m |
| 31 | memory: 100Mi |
| 32 | ports: |
| 33 | - containerPort: 6379 |
| 34 | - name: redis-exporter |
| 35 | image: oliver006/redis_exporter:latest |
| 36 | securityContext: |
| 37 | runAsUser: 59000 |
| 38 | runAsGroup: 59000 |
| 39 | allowPrivilegeEscalation: false |
| 40 | capabilities: |
| 41 | drop: |
| 42 | - ALL |
| 43 | resources: |
| 44 | requests: |
| 45 | cpu: 100m |
| 46 | memory: 100Mi |
| 47 | ports: |
| 48 | - containerPort: 9121 |