apiVersion: apps/v1
kind: Deployment
metadata:
  name: pagespeedinsights-collector
spec:
  selector: 
    matchLabels:
      app: pagespeedinsights-collector
  replicas: 1
  template:
    metadata:
      labels:
        app: pagespeedinsights-collector
      annotations:
        prometheus.io/scrape: "true"
    spec:
      imagePullSecrets:
      - name: githubdockerregistry
      containers:
      - name: pagespeedinsights-collector
        image: tomdavidson42/pagespeedinsights-collector
        resources:
          requests:
            cpu: 10m
            memory: 10Mi
        env:
        - name: APIKey
          valueFrom:
            configMapKeyRef:
              name: pagespeedinsights-collector-config
              key: APIKey
        - name: PAGES
          valueFrom:
            configMapKeyRef:
              name: pagespeedinsights-collector-config
              key: PAGES
        ports:
        - containerPort: 3000
        livenessProbe:
          httpGet:
            path: /healthz
            port: 3000
          initialDelaySeconds: 3
          periodSeconds: 3
