{{tag ' if .Values.base.enabled '}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: "{{tag '  .Chart.Name '}}-basedeployment"
  labels:
    chart: '{{tag ' .Chart.Name '}}-{{tag ' .Chart.Version | replace "+" "_" '}}'
spec:
  replicas: {{tag ' .Values.base.replicaCount '}}
  revisionHistoryLimit: {{tag ' .Values.revisionHistoryLimit '}}
  template:
    metadata:
      labels:
        app: "{{tag '  .Chart.Name '}}-selector"
        version: "base"
    spec:
      containers:
      - name: "{{tag '  .Chart.Name  '}}"
        image: "{{tag ' .Values.image.repository '}}:{{tag ' .Values.base.image.tag '}}"
        imagePullPolicy: {{tag ' .Values.image.pullPolicy '}}
{{tag ' if .Values.istio.enabled '}}
{{tag ' else '}}
        readinessProbe:
          httpGet:
          {{! healthEndpoint is configured in the index.js and is different for basicweb}}
          {{#has language 'java'}}
            path: /{{#if healthEndpoint}}{{healthEndpoint}}{{else}}health{{/if}}
            port: 9080
          {{/has}}
          {{#has language 'spring'}}
            path: /{{#if healthEndpoint}}{{healthEndpoint}}{{else}}health{{/if}}
            port: 8080
          {{/has}}
          initialDelaySeconds: 20
{{tag ' end '}}
        resources:
          requests:
            cpu: "{{tag ' .Values.image.resources.requests.cpu '}}"
            memory: "{{tag ' .Values.image.resources.requests.memory '}}"
        env:
          - name: PORT
            value: "{{tag ' .Values.service.servicePort '}}"
{{tag ' end '}}