1
0
Fork 0
manifests/syscom-redis.yaml

79 lines
1.5 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
namespace: syscom
name: redis-config
data:
# Increase the number of databases if necessary.
# If you add another app which uses this Redis instance, make sure
# to also update the NetworkPolicy in this file.
#
# Database 0: Harbor core
# Database 1: Harbor job service
# database 2: Harbor registry
redis.conf: |
databases 16
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: syscom
name: redis
labels:
app: redis
spec:
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:6.2
volumeMounts:
- mountPath: "/usr/local/etc/redis"
name: redis-conf-vol
ports:
- name: redis
containerPort: 6379
volumes:
- name: redis-conf-vol
configMap:
name: redis-config
---
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: syscom
spec:
selector:
app: redis
ports:
- protocol: TCP
port: 6379
targetPort: 6379
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: redis-network-policy
namespace: syscom
spec:
podSelector:
matchLabels:
app: redis
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: syscom
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: harbor