Added redis support
This commit is contained in:
@@ -26,6 +26,7 @@ type: Opaque
|
|||||||
data:
|
data:
|
||||||
nexus.secrets.json: ewogICJhY3RpdmUiOiAia2hvbmdpc2Eta2V5LTIwMjYiLAogICJrZXlzIjogWwogICAgewogICAgICAiaWQiOiAia2hvbmdpc2Eta2V5LTIwMjYiLAogICAgICAia2V5IjogIk5tTmhZMll3TkdNMUltVXdOVGt4WkROa1l6a3habVk1WVRJek5UWTVOalE9IgogICAgfQogIF0KfQo=
|
nexus.secrets.json: ewogICJhY3RpdmUiOiAia2hvbmdpc2Eta2V5LTIwMjYiLAogICJrZXlzIjogWwogICAgewogICAgICAiaWQiOiAia2hvbmdpc2Eta2V5LTIwMjYiLAogICAgICAia2V5IjogIk5tTmhZMll3TkdNMUltVXdOVGt4WkROa1l6a3habVk1WVRJek5UWTVOalE9IgogICAgfQogIF0KfQo=
|
||||||
postgres-password: TWd6dUxVakZianA5ZjQ=
|
postgres-password: TWd6dUxVakZianA5ZjQ=
|
||||||
|
redis-password: NjI4akZL
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@@ -37,6 +38,8 @@ data:
|
|||||||
POSTGRES_PORT: "5432"
|
POSTGRES_PORT: "5432"
|
||||||
POSTGRES_USER: "nexus"
|
POSTGRES_USER: "nexus"
|
||||||
POSTGRES_DBNAME: "nexus"
|
POSTGRES_DBNAME: "nexus"
|
||||||
|
REDIS_HOST: "redis-service.redis.svc.cluster.local"
|
||||||
|
REDIS_PORT: "6379"
|
||||||
JVM_PARAMS: "-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dnexus.secrets.file=/nexus-data/nexus.secrets.json"
|
JVM_PARAMS: "-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dnexus.secrets.file=/nexus-data/nexus.secrets.json"
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -99,6 +102,23 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: nexus-secrets
|
name: nexus-secrets
|
||||||
key: postgres-password
|
key: postgres-password
|
||||||
|
- name: NEXUS_CACHE_TYPE
|
||||||
|
value: "redis"
|
||||||
|
- name: NEXUS_CACHE_REDIS_HOST
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: nexus-configs
|
||||||
|
key: REDIS_HOST
|
||||||
|
- name: NEXUS_CACHE_REDIS_PORT
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: nexus-configs
|
||||||
|
key: REDIS_PORT
|
||||||
|
- name: NEXUS_CACHE_REDIS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: nexus-secrets
|
||||||
|
key: redis-password
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: "500m"
|
cpu: "500m"
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: redis
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: redis-secret
|
||||||
|
namespace: redis
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
password: NjI4akZL
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: redis-data-pvc
|
||||||
|
namespace: redis
|
||||||
|
spec:
|
||||||
|
accessModes: ["ReadWriteMany"]
|
||||||
|
storageClassName: nfs-storage
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: redis
|
||||||
|
namespace: redis
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: redis
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: redis
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: node-role.kubernetes.io/control-plane
|
||||||
|
operator: DoesNotExist
|
||||||
|
containers:
|
||||||
|
- name: redis
|
||||||
|
image: redis:7-alpine
|
||||||
|
command: ["redis-server", "--requirepass", "$(REDIS_PASSWORD)", "--appendonly", "yes"]
|
||||||
|
ports:
|
||||||
|
- containerPort: 6379
|
||||||
|
name: redis
|
||||||
|
env:
|
||||||
|
- name: REDIS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: redis-secret
|
||||||
|
key: password
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /data
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: redis-data-pvc
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: redis-service
|
||||||
|
namespace: redis
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
selector:
|
||||||
|
app: redis
|
||||||
|
ports:
|
||||||
|
- name: redis
|
||||||
|
protocol: TCP
|
||||||
|
port: 6379
|
||||||
|
targetPort: 6379
|
||||||
|
nodePort: 36379
|
||||||
@@ -10,7 +10,8 @@ metadata:
|
|||||||
name: redisinsight-config
|
name: redisinsight-config
|
||||||
namespace: redisinsight
|
namespace: redisinsight
|
||||||
data:
|
data:
|
||||||
database.host: "192.168.1.137"
|
# Pointing to the internal service name of the new Redis instance
|
||||||
|
database.host: "redis-service.redis.svc.cluster.local"
|
||||||
database.port: "6379"
|
database.port: "6379"
|
||||||
database.instance: "redis"
|
database.instance: "redis"
|
||||||
RI_LOG_LEVEL: "info"
|
RI_LOG_LEVEL: "info"
|
||||||
@@ -57,36 +58,13 @@ roleRef:
|
|||||||
name: redisinsight-role
|
name: redisinsight-role
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolume
|
|
||||||
metadata:
|
|
||||||
name: redisinsight-pv
|
|
||||||
spec:
|
|
||||||
capacity:
|
|
||||||
storage: 2Gi
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
storageClassName: local-pvs
|
|
||||||
local:
|
|
||||||
path: /home/ansible/k3s/makhiwane/redisinsight
|
|
||||||
nodeAffinity:
|
|
||||||
required:
|
|
||||||
nodeSelectorTerms:
|
|
||||||
- matchExpressions:
|
|
||||||
- key: kubernetes.io/hostname
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- lead
|
|
||||||
persistentVolumeReclaimPolicy: Retain
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: redisinsight-pvc
|
name: redisinsight-pvc
|
||||||
namespace: redisinsight
|
namespace: redisinsight
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes: ["ReadWriteMany"]
|
||||||
- ReadWriteOnce
|
storageClassName: nfs-storage
|
||||||
storageClassName: local-pvs
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 2Gi
|
storage: 2Gi
|
||||||
@@ -107,6 +85,13 @@ spec:
|
|||||||
app: redisinsight
|
app: redisinsight
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: redisinsight-sa
|
serviceAccountName: redisinsight-sa
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: node-role.kubernetes.io/control-plane
|
||||||
|
operator: DoesNotExist
|
||||||
containers:
|
containers:
|
||||||
- name: redisinsight
|
- name: redisinsight
|
||||||
image: redislabs/redisinsight:latest
|
image: redislabs/redisinsight:latest
|
||||||
|
|||||||
Reference in New Issue
Block a user