---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: tea
  name: chatservice
spec:
  replicas: 2
  selector:
    matchLabels:
      app: chatservice
  template:
    metadata:
      labels:
        app: chatservice
    spec:
      volumes:
        - name: micronaut-config
          secret:
            secretName: micronaut-config
      containers:
        - name: chatservice
          image: IMAGE_REF
          ports:
            - containerPort: 8080
          resources:
            limits:
              cpu: 500m
              memory: 256Mi
            requests:
              cpu: 100m
              memory: 128Mi
          readinessProbe:
            httpGet:
              path: /chattest
              port: 8080
            periodSeconds: 5
            initialDelaySeconds: 10
            timeoutSeconds: 3
          livenessProbe:
            httpGet:
              path: /chattest
              port: 8080
            periodSeconds: 5
            initialDelaySeconds: 15
            timeoutSeconds: 3
          volumeMounts:
            - name: micronaut-config
              mountPath: "/etc/micronaut"
              readOnly: true
          env:
            - name: _JAVA_OPTIONS
              value: "-Xss256K -Xmx192M -Xms64M -XX:MaxRAM=256M -XX:MaxMetaspaceSize=64M"
            - name: MICRONAUT_CONFIG_FILES
              value: /etc/micronaut/mongo.yml
