Add existing public redis pod/service 37/55037/1
authorEddie Arrage <eddie.arrage@huawei.com>
Wed, 4 Apr 2018 00:28:12 +0000 (00:28 +0000)
committerEddie Arrage <eddie.arrage@huawei.com>
Thu, 5 Apr 2018 23:39:15 +0000 (23:39 +0000)
- Use a community yaml for redis in k8s as simple data store
- Redis can be used for tracing and also by the snort-ids
to store alerts that can be processed by other services
- If flannel is used, the redis CLI can be accessed on the
host OS with redis-cli -h <flannel ip>
- Within the k8s cluster, the redis service can be accessed with
DNS using name 'redis'
- The same yaml for redis is also included in toplevel manifest for SDC
scenario. Included here if intention is to use separately (tracing
only)

Change-Id: Ibad283a4cc8938fe01f5de6b7743bdb5511be3af
Signed-off-by: Eddie Arrage <eddie.arrage@huawei.com>
(cherry picked from commit 66cc1be27b7fbb27c01a726663e42608eb411672)

clover/tools/yaml/redis.yaml [new file with mode: 0644]

diff --git a/clover/tools/yaml/redis.yaml b/clover/tools/yaml/redis.yaml
new file mode 100644 (file)
index 0000000..8a05495
--- /dev/null
@@ -0,0 +1,45 @@
+---
+apiVersion: v1
+kind: Pod
+metadata:
+  labels:
+    name: redis
+    redis-sentinel: "true"
+    role: master
+  name: redis
+spec:
+  containers:
+    - name: redis
+      image: k8s.gcr.io/redis:v1
+      env:
+        - name: MASTER
+          value: "true"
+      ports:
+        - containerPort: 6379
+      resources:
+        limits:
+          cpu: "0.1"
+      volumeMounts:
+        - mountPath: /redis-master-data
+          name: data
+    - name: sentinel
+      image: kubernetes/redis:v1
+      env:
+        - name: SENTINEL
+          value: "true"
+      ports:
+        - containerPort: 26379
+  volumes:
+    - name: data
+      emptyDir: {}
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: redis
+spec:
+  ports:
+  - port: 6379
+  selector:
+    name: redis
+---