apiVersion: apps/v1
kind: Deployment
metadata:
  name: launchpad
spec:
  replicas: 1
  selector:
    matchLabels:
      app: launchpad
  template:
    metadata:
      labels:
        app: launchpad
    spec:
      containers:
        - name: launchpad
          image: docker.pkg.github.com/getlaunchpad/server/launchpad:$COMMIT_SHA1
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
          livenessProbe:
            httpGet:
              path: /v1/status/health
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds: 15
            timeoutSeconds: 5
          readinessProbe:
            httpGet:
              path: /v1/status/readiness
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 5
            timeoutSeconds: 1
          env: # TODO: Try and achomplish this in a more pragmatic way
            - name: "GOOGLE_OAUTH_CLIENT_ID"
              valueFrom:
                secretKeyRef:
                  name: env-vars
                  key: google_client
            - name: "GOOGLE_OAUTH_CLIENT_SECRET"
              valueFrom:
                secretKeyRef:
                  name: env-vars
                  key: google_secret
            - name: "ACCESS_TOKEN_SECRET"
              valueFrom:
                secretKeyRef:
                  name: env-vars
                  key: access_token
            - name: "DB_URL"
              valueFrom:
                secretKeyRef:
                  name: env-vars
                  key: db_connurl
      imagePullSecrets:
        - name: regcred
