---
# Source: sumologic/templates/metrics/remote-write-proxy/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: RELEASE-NAME-sumologic-remote-write-proxy
  labels:
    app: RELEASE-NAME-sumologic-remote-write-proxy
    chart: "sumologic-%CURRENT_CHART_VERSION%"
    release: "RELEASE-NAME"
    heritage: "Helm"
spec:
  selector:
    matchLabels:
      app: RELEASE-NAME-sumologic-remote-write-proxy
  replicas: 3
  template:
    metadata:
      annotations:
        checksum/config: "%CONFIG_CHECKSUM%"
      labels:
        app: RELEASE-NAME-sumologic-remote-write-proxy
        chart: "sumologic-%CURRENT_CHART_VERSION%"
        release: "RELEASE-NAME"
        heritage: "Helm"
    spec:
      containers:
      - name: nginx
        image: public.ecr.aws/nginx/nginx:1.21-alpine
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 80
        resources:
          limits:
            cpu: 1000m
            memory: 256Mi
          requests:
            cpu: 200m
            memory: 128Mi
        livenessProbe:
          tcpSocket:
            port: 80
          failureThreshold: 6
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        readinessProbe:
          tcpSocket:
            port: 80
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 5
          successThreshold: 1
          timeoutSeconds: 3
        env:
        # this setting makes the entrypoint automatically set the number of worker processes based
        # on cpu limit data, by using the cgroups API
        - name: NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE
          value: "1"
        volumeMounts:
          - name: config
            mountPath: /etc/nginx/conf.d/remote-write-proxy.conf
            subPath: remote-write-proxy.conf
      volumes:
        - name: config
          configMap:
            name: RELEASE-NAME-sumologic-remote-write-proxy
