apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: demo
  name: demo
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: demo
  template:
    metadata:
      labels:
        app.kubernetes.io/name: demo
    spec:
      automountServiceAccountToken: false
      containers:
        - image: google-analytics-proxy
          name: google-analytics-proxy
          imagePullPolicy: Always
          env:
            - name: LISTEN
              value: 0.0.0.0:8080
            - name: UPSTREAM_ENDPOINT
              value: http://:80
            - name: UPSTREAM_HOSTNAME
              value: example.com # Value must be replaced.
            - name: GOOGLE_ANALYTICS_TRACKING_ID
              value: UA-123456789-1 # Value must be replaced.
            - name: GOOGLE_ANALYTICS_PROPERTY_NAME
              value: example.com # Value must be replaced.
          ports:
            - containerPort: 8080
          resources:
            requests:
              cpu: 100m
              memory: 20Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            privileged: false
            readOnlyRootFilesystem: true
            runAsGroup: 65534
            runAsNonRoot: true
            runAsUser: 65534

        - name: upstream
          image: upstream
          imagePullPolicy: Always
          ports:
            - containerPort: 80
