---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Values.rabbitmq.name }}
spec:
  selector:
    matchLabels:
      app:  {{ .Values.rabbitmq.app }}
  replicas: {{ .Values.rabbitmq.replicaCount }}
  template:
    metadata:
      labels:
        app: {{ .Values.rabbitmq.app }}
    spec:
      containers:
      - image: "{{ .Values.rabbitmq.image}}:{{ .Values.rabbitmq.tag}}"
        imagePullPolicy: {{ .Values.rabbitmq.imagePullPolicy}}
        name:  {{ .Values.rabbitmq.name }}
        ports:
        - containerPort: 5672
        
---
apiVersion: v1
kind: Service
metadata:
  name:  {{ .Values.rabbitmq.name }}
spec:
  ports:
    - port: 5672
      targetPort: 5672
      protocol: TCP
  type: ClusterIP
  selector:
    app: {{ .Values.rabbitmq.app }}
---