---
apiVersion: v1
kind: Service
metadata:
  name: "{{ ansible_operator_meta.name }}-redis"
  namespace: "{{ ansible_operator_meta.namespace }}"
  labels:
    app.kubernetes.io/name: 'redis'
    app.kubernetes.io/instance: 'redis-{{ ansible_operator_meta.name }}'
    app.kubernetes.io/component: cache
    app.kubernetes.io/part-of: '{{ deployment_type }}'
    app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
spec:
  selector:
    app.kubernetes.io/name: 'redis'
    app.kubernetes.io/instance: 'redis-{{ ansible_operator_meta.name }}'
    app.kubernetes.io/component: cache
    app.kubernetes.io/part-of: '{{ deployment_type }}'
    app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
  ports:
    - protocol: TCP
      targetPort: 6379
      name: redis-6379
      port: 6379
