From 3e0d4647705c664fbaf3ee99fa4330a007203179 Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Fri, 3 May 2024 21:32:53 -0400 Subject: [PATCH] Add redis insight --- redis-insight/redis-insight-deployment.yaml | 47 +++++++++++++++++++++ redis-insight/redis-insight-pvc-db.yaml | 14 ++++++ redis-insight/redis-insight-service.yaml | 12 ++++++ 3 files changed, 73 insertions(+) create mode 100644 redis-insight/redis-insight-deployment.yaml create mode 100644 redis-insight/redis-insight-pvc-db.yaml create mode 100644 redis-insight/redis-insight-service.yaml diff --git a/redis-insight/redis-insight-deployment.yaml b/redis-insight/redis-insight-deployment.yaml new file mode 100644 index 0000000..94bfe19 --- /dev/null +++ b/redis-insight/redis-insight-deployment.yaml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: redisinsight #deployment name + namespace: redis-system + labels: + app: redisinsight #deployment label +spec: + replicas: 1 #a single replica pod + strategy: + type: Recreate + selector: + matchLabels: + app: redisinsight #which pods is the deployment managing, as defined by the pod template + template: #pod template + metadata: + labels: + app: redisinsight #label for pod/s + spec: + volumes: + - name: db + persistentVolumeClaim: + claimName: redisinsight-pvc + initContainers: + - name: init + image: busybox + command: + - /bin/sh + - '-c' + - | + chown -R 1001 /db + resources: {} + volumeMounts: + - name: db + mountPath: /db + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + containers: + - name: redisinsight #Container name (DNS_LABEL, unique) + image: redislabs/redisinsight:latest #repo/image + imagePullPolicy: IfNotPresent #Always pull image + volumeMounts: + - name: db #Pod volumes to mount into the container's filesystem. Cannot be updated. + mountPath: /db + ports: + - containerPort: 8001 #exposed container port and protocol + protocol: TCP diff --git a/redis-insight/redis-insight-pvc-db.yaml b/redis-insight/redis-insight-pvc-db.yaml new file mode 100644 index 0000000..3bd8ba5 --- /dev/null +++ b/redis-insight/redis-insight-pvc-db.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: redisinsight-pvc + namespace: redis-system + labels: + app: redisinsight +spec: + storageClassName: longhorn + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi diff --git a/redis-insight/redis-insight-service.yaml b/redis-insight/redis-insight-service.yaml new file mode 100644 index 0000000..f9c3ea2 --- /dev/null +++ b/redis-insight/redis-insight-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: redisinsight-service # name should not be 'redisinsight' + namespace: redis-system +spec: + type: LoadBalancer + ports: + - port: 80 + targetPort: 8001 + selector: + app: redisinsight