---
apiVersion: v1
kind: Service
metadata:
  name: fx-preview-_SITE_NAME-srv-_SAASSTAGE
  namespace: fx-webgen
  labels:
    stage: _SAASSTAGE
    run: fx-preview-_SITE_NAME-_SAASSTAGE
  selfLink: /api/v1/namespaces/default/services/fx-preview-_SITE_NAME-srv-_SAASSTAGE
spec:
  ports:
    - port: 80
      name: http
      protocol: TCP
      targetPort: 80
    - port: 8000
      name: preview
      protocol: TCP
      targetPort: 8000
    - port: 1337
      name: refresh
      protocol: TCP
      targetPort: 1337
  selector:
    stage: _SAASSTAGE
    run: fx-preview-_SITE_NAME-_SAASSTAGE
  sessionAffinity: None
---
apiVersion: v1
kind: Pod
metadata:
  name: fx-preview-_SITE_NAME-_SAASSTAGE
  namespace: fx-webgen
  labels:
    stage: _SAASSTAGE
    run: fx-preview-_SITE_NAME-_SAASSTAGE
spec:
  nodeSelector:
    doks.digitalocean.com/node-pool: _PREVIEW_NODEPOOL
  containers:
    - image: floomltd/fx_preview_src:latest
      command: ["/bin/sh"]
      args: ["-c", "node pending.js & make populate-project-hook GATSBY_PROJECT_ID=_SITE_NAME & yarn develop:cache-clear-external;"]
      imagePullPolicy: Always
      name: fx-preview-_SITE_NAME-_SAASSTAGE
  imagePullSecrets:
    - name: regcred-preview
  dnsPolicy: ClusterFirst
  restartPolicy: Always
