apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: flux
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: flux
    spec:
      containers:
      - name: fluxd
        image: quay.io/weaveworks/fluxd:master-952c028
        args:
        - --fluxsvc-address=ws://localhost:3030/api/flux
      - name: fluxsvc
        image: quay.io/weaveworks/fluxsvc:master-952c028
        args:
        - --database-source=file://flux.db
        - --memcached-hostname=memcached.default.svc.cluster.local
        - --memcached-timeout=100ms
        - --memcached-service=memcached
        - --registry-cache-expiry=20m

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: flux
spec:
  replicas: 1

  # Having maxSurge 0 and maxUnavailable 1 means the deployment will update one
  # replica at a time as it will have to stop one (making one unavailable)
  # before it can start one (surge of zero)
  strategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1

  template:
    metadata:
      labels:
        name: flux
    spec:
      # Give fluxsvc up to 10 minutes grace to finish jobs in progress and exit
      # cleanly. Service is available during this time, as long as we don't
      # stop too many replicas at once.
      terminationGracePeriodSeconds: 600

      containers:
      - name: fluxd
        image: quay.io/weaveworks/fluxd:master-952c028
        args:
        - --fluxsvc-address=ws://localhost:3030/api/flux
      - name: fluxsvc
        image: quay.io/weaveworks/fluxsvc:master-952c028
        args:
        - --database-source=file://flux.db
        - --memcached-hostname=memcached.default.svc.cluster.local
        - --memcached-timeout=100ms
        - --memcached-service=memcached
        - --registry-cache-expiry=20m

Add a termination grace period to allow flux jobs to clean up before exiting
Add a termination grace period to allow flux jobs to clean up before exiting
