apiVersion: apps/v1
kind: Deployment
metadata:
  name: drone-runner
  labels:
    app.kubernetes.io/name: drone-runner
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: drone
  template:
    metadata:
      labels:
        app.kubernetes.io/name: drone
    spec:
      serviceAccountName: drone-runner
      containers:
      - name: runner
        image: drone/drone-runner-kube:latest
        ports:
        - containerPort: 3000
        env:
        - name: DRONE_NAMESPACE_DEFAULT
          value: drone
        - name: DRONE_SERVICE_ACCOUNT_DEFAULT
          value: drone-runner
        - name: DRONE_RPC_HOST
          value: droneserver.drone
        - name: DRONE_RPC_PROTO
          value: http
        - name: DRONE_RPC_SECRET 
          valueFrom:
            secretKeyRef:
              name: drone-server-secret
              key: DRONE_RPC_SECRET
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: drone-runner
  labels:
    app.kubernetes.io/name: drone-runner