# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START anthosbaremetal_release_payments_deployment_payments]
apiVersion: apps/v1
kind: Deployment
metadata:
  name: payments
spec:
  selector:
    matchLabels:
      app: payments
  template:
    metadata:
      labels:
        app: payments
    spec:
      serviceAccountName: default
      terminationGracePeriodSeconds: 5
      containers:
      - name: payments
        # TODO:: remove the snapshot tag once we make the first release
        image: us-docker.pkg.dev/point-of-sale-ci/pos-images/payments:v0.1.0
        env:
        - name: SPRING_PROFILES_ACTIVE
          valueFrom:
            configMapKeyRef:
              name: spring-profile
              key: SPRING_PROFILES_ACTIVE
        resources:
          requests:
            cpu: 100m
            memory: 512Mi
          limits:
            cpu: 500m
            memory: 1Gi
        readinessProbe:
          httpGet:
            path: /ready
            port: 8080
          initialDelaySeconds: 60
          periodSeconds: 5
          timeoutSeconds: 10
        livenessProbe:
          httpGet:
            path: /healthy
            port: 8080
          initialDelaySeconds: 120
          periodSeconds: 5
          timeoutSeconds: 10
# [END anthosbaremetal_release_payments_deployment_payments]
