apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: Settings provider
  labels:
    app: settings
    environment: Development
    tier: Service
  name: settings
  namespace: sirius
spec:
  revisionHistoryLimit: 1
  minReadySeconds: 10
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  replicas: 1
  selector:
    matchLabels:
      app: settings
  template:
    metadata:
      labels:
        app: settings
      name: settings
    spec:
      containers:
      - name: settings
        image: docker.io/swisschains/settings-sirius-prod:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 5000
        readinessProbe:
          httpGet:
            path: /common
            port: 5000
          initialDelaySeconds: 10
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /common
            port: 5000
          initialDelaySeconds: 10
          periodSeconds: 20
        resources:
          requests:
            memory: 64Mi 
            cpu: 31m 
          limits:
            memory: 128Mi 
            cpu: 125m 
        env:
        - name: KEY_VALUE_STORAGE
          valueFrom:
            secretKeyRef:
              name: settings
              key: ConnectionString
        - name: ENVIRONMENT_MODE
          valueFrom:
            secretKeyRef:
              name: settings
              key: ENVIRONMENT_MODE
        - name: ENV_INFO
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
      tolerations:
       - effect: NoSchedule
         operator: Exists
      nodeSelector:
          agentpool: sirius