apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: stack
    tier: backend
    deployedBy: deploy-node-app
  name: stack
spec:
  minReadySeconds: 5
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: stack
      tier: backend
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: stack
        tier: backend
        deployedBy: deploy-node-app
    spec:
      containers:
        - image: 'jefftian/stackedit:latest'
          imagePullPolicy: Always
          name: stack
          env:
            - name: GET_HOSTS_FROM
              value: dns
            - name: GITHUB_CLIENT_ID
              valueFrom:
                secretKeyRef:
                  name: stack-secrets
                  key: githubClientId
            - name: GITHUB_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: stack-secrets
                  key: githubClientSecret
          ports:
            - containerPort: 8080
              name: http
              protocol: TCP
          resources:
            limits:
              cpu: 150m
              memory: 128Mi
            requests:
              cpu: 3m
              memory: 64Mi
