apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-gateway
  labels:
    app: api-gateway
  annotations:
    fluentbit.io/parser: nginx
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: api-gateway
  template:
    metadata:
      labels:
        app: api-gateway
    spec:
      containers:
      - name: dnsmasq
        image: janeczku/go-dnsmasq:release-1.0.7
        imagePullPolicy: Always
        volumeMounts: []
        args:
          - '--listen'
          - '127.0.0.1:53'
          - '--default-resolver'
          - '--enable-search'
          - '--hostsfile=/etc/hosts'
        env: []
        resources:
            limits:
              memory: 20Mi
              cpu: 10m
            requests:
              memory: 5Mi
              cpu: 10m
      - name: api-gateway
        image: riccardoatzori/api-gateway:latest
        imagePullPolicy: Always
        resources:
          limits:
            memory: "150Mi"
            cpu: "500m"
          requests:
              memory: "100Mi"
              cpu: 10m
        ports:
          - containerPort: 80
        volumeMounts:
          - name: server
            mountPath: /etc/nginx/conf.d
            readOnly: true
          - name: customization
            mountPath: /etc/nginx/customization.d
            readOnly: true
          - name: location
            mountPath: /etc/nginx/location.d
      volumes:
        - name: server
          configMap:
              name: api-gateway-server
        - name: customization
          configMap:
              name: api-gateway-customization
        - name: location
          configMap:
              name: api-gateway-location
