apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: datagrid-service
    hazelcast: enabled
  name: datagrid-service
spec:
  selector:
    matchLabels:
      io.kompose.service: datagrid-service
  replicas: 3
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        io.kompose.service: datagrid-service
        hazelcast: enabled
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/port: '8080'
    spec:
      containers:
      - image: lreimer/datagrid-service:2.1
        name: datagrid-service
        env:
        - name: JAEGER_SERVICE_NAME
          value: "datagrid-service"
        - name: JAEGER_AGENT_HOST
          valueFrom:
            fieldRef:
              fieldPath: status.hostIP
        - name: JAEGER_REPORTER_LOG_SPANS
          value: "true"
        - name: JAEGER_SAMPLER_TYPE
          value: "const"
        - name: JAEGER_SAMPLER_PARAM
          value: "1"
        ports:
        - containerPort: 8080
        - containerPort: 5701
        resources:
          requests:
            memory: "400Mi"
            cpu: "250m"
          limits:
            memory: "600Mi"
            cpu: "1000m"
        livenessProbe:
          httpGet:
            path: /api/application.wadl
            port: 8080
          initialDelaySeconds: 120
          periodSeconds: 5
        readinessProbe:
          httpGet:
            path: /api/application.wadl
            port: 8080
          initialDelaySeconds: 60
          periodSeconds: 5
        volumeMounts:
        - mountPath: /opt/payara/config/
          name: datagrid-service-config-volume
          readOnly: true
      restartPolicy: Always
      volumes:
      - name: datagrid-service-config-volume
        configMap:
          name: datagrid-service-config
