apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis-deployment
  namespace: redis
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis
  template:
    metadata:
      labels:
        app: redis
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "6379"
    spec:
      containers:
      - name: redis
        image: private-repo:5000/redis:7.2.1
        ports:
        - containerPort: 6379
        volumeMounts:
        - mountPath: "/data"
          name: redis-pv-volume
      volumes:
        - name: redis-pv-volume
          persistentVolumeClaim:
            claimName: redis-pv-claim
      nodeSelector:
        name: node-1 


---

apiVersion: v1
kind: Service
metadata:
  name: redis-service
  namespace: redis
  annotations:
      prometheus.io/scrape: 'true'
      prometheus.io/port: '6379'
spec:
  selector:
    app: redis
  ports:
    - protocol: TCP
      port: 6379
      targetPort: 6379
  type: ClusterIP
