apiVersion: apps/v1
kind: Deployment
metadata:
  name: ecsdemo-frontend
  labels:
    app: ecsdemo-frontend
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: ecsdemo-frontend
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: ecsdemo-frontend
    spec:
      containers:
        - image: brentley/ecsdemo-frontend:latest
          imagePullPolicy: Always
          name: ecsdemo-frontend
          ports:
            - containerPort: 3000
              protocol: TCP
          env:
            - name: CRYSTAL_URL
              value: "http://ecsdemo-crystal.default.svc.cluster.local/crystal"
            - name: NODEJS_URL
              value: "http://ecsdemo-nodejs.default.svc.cluster.local/"
