apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: {{ template "risk-advisor.fullname" . }}
  labels:
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    app: "{{ template "risk-advisor.name" . }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  replicas: {{ .Values.replicaCount }}
  template:
    metadata:
      labels:
        app: "{{ template "risk-advisor.name" . }}"
        release: "{{ .Release.Name }}"
    spec:
      containers:
      - name: {{ .Chart.Name }}
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        ports:
        - containerPort: {{ .Values.service.targetPort }}
        livenessProbe:
          httpGet:
            path: /healthz
            port: {{ .Values.service.targetPort }}
          initialDelaySeconds: 3
          periodSeconds: 3
        readinessProbe:
          httpGet:
            path: /healthz
            port: {{ .Values.service.targetPort }}
          initialDelaySeconds: 3
          periodSeconds: 3
        resources:
{{ toYaml .Values.resources | indent 12 }}
