apiVersion: apps/v1
kind: Deployment
metadata:
  name: todomvc-web
  labels:
    app: todomvc-web
spec:
  selector:
    matchLabels:
      app: todomvc-web
  template:
    metadata:
      labels:
        app: todomvc-web
    spec:
      containers:
        - name: todomvc-web
          image: todomvc_web_server
          imagePullPolicy: IfNotPresent
          env:
            - name: API_URL
              value: http://todo.red-badger.com/api
            - name: WEB_URL
              value: http://todo.red-badger.com
            - name: CLIENT_ID
              valueFrom:
                secretKeyRef:
                  name: oauth-creds
                  key: client_id
            - name: CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: oauth-creds
                  key: client_secret
            - name: AUTH_URL
              valueFrom:
                secretKeyRef:
                  name: oauth-creds
                  key: auth_uri
            - name: TOKEN_URL
              valueFrom:
                secretKeyRef:
                  name: oauth-creds
                  key: token_uri
          ports:
            - containerPort: 8080
          resources:
            requests:
              memory: "32Mi"
              cpu: "100m"
            limits:
              memory: "128Mi"
              cpu: "500m"
