apiVersion: apps/v1
kind: Deployment
metadata:
  name: checkerboard
  labels:
    app: checkerboard
spec:
  replicas: 1
  selector:
    matchLabels:
      name: checkerboard
  template:
    metadata:
      labels:
        name: checkerboard
    spec:
      automountServiceAccountToken: false
      containers:
        - name: checkerboard
          imagePullPolicy: "Always"
          image: "lsstsqre/checkerboard"
          ports:
            - containerPort: 8080
              name: app
          envFrom:
            - configMapRef:
                name: checkerboard
          env:
            - name: CHECKERBOARD_USERNAME
              valueFrom:
                secretKeyRef:
                  name: checkerboard
                  key: username
            - name: CHECKERBOARD_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: checkerboard
                  key: password
            - name: CHECKERBOARD_SLACK_TOKEN
              valueFrom:
                secretKeyRef:
                  name: checkerboard
                  key: slack_token
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - all
            readOnlyRootFilesystem: true
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
        runAsGroup: 1000
