apiVersion: apps/v1
kind: Deployment
metadata:
  name: sc-product-service-deployment
  namespace: default
  labels:
    app: sc-product-service
spec:
  replicas: 2
  selector:
    matchLabels:
      app: sc-product-service
  template:
    metadata:
      labels:
        app: sc-product-service
    spec:
      containers:
        - name: sc-product-service
          image: tsalm/sc-product-service
          ports:
            - containerPort: 8080
          env:
          - name: MANAGEMENT_METRICS_EXPORT_WAVEFRONT_API_TOKEN
            valueFrom:
              secretKeyRef:
                name: sc-wavefront-secret
                key: api-token
                optional: true
          - name: MANAGEMENT_METRICS_EXPORT_WAVEFRONT_URI
            valueFrom:
              secretKeyRef:
                name: sc-wavefront-secret
                key: uri
                optional: true
          livenessProbe:
            initialDelaySeconds: 60
            periodSeconds: 3
            httpGet:
              path: /actuator/health/liveness
              port: 8080
          readinessProbe:
            initialDelaySeconds: 60
            periodSeconds: 10
            httpGet:
              path: /actuator/health/readiness
              port: 8080
          resources:
            requests:
              memory: 768Mi
              cpu: 500m
            limits:
              memory: 768Mi