---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: updater
  namespace: my-application
  labels:
    app: updater
spec:
  selector:
    matchLabels:
      app: updater
  template:
    metadata:
      labels:
        app: updater
    spec:
      serviceAccountName: updater
      containers:
        - name: updater
          image: bitsbeats/updater:0.1.0
          workingDir: /
          securityContext:
            capabilities:
              drop:
                - ALL
            readOnlyRootFilesystem: true
            runAsNonRoot: true
          ports:
            - name: http
              containerPort: 8080
          envFrom:
            - secretRef:
                name: updater
          env:
            - name: NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          resources:
            limits:
              cpu: 50m
              memory: 32Mi
            requests:
              cpu: 50m
              memory: 32Mi
          livenessProbe:
            httpGet:
              path: /healthz
              port: http
          readinessProbe:
            httpGet:
              path: /healthz
              port: http
