1
0
Fork 0
home-stack-kustomize/kustomize/bases/drone/drone-runner-deployment.yaml

99 lines
2.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: drone-runner
labels:
app.kubernetes.io/name: drone
app.kubernetes.io/component: runner
spec:
selector:
matchLabels:
app.kubernetes.io/name: drone
app.kubernetes.io/component: runner
template:
metadata:
labels:
app.kubernetes.io/name: drone
app.kubernetes.io/component: runner
spec:
containers:
- name: drone
image: drone/drone-runner-kube
env:
- name: DRONE_NAMESPACE_DEFAULT
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: DRONE_RPC_HOST
value: drone-server.$(DRONE_NAMESPACE_DEFAULT).svc.cluster.local
- name: DRONE_RPC_PROTO
value: http
- name: DRONE_RPC_SECRET
valueFrom:
secretKeyRef:
name: drone-secret
key: rpc_secret
ports:
- name: http
containerPort: 3000
resources:
requests:
cpu: 250m
memory: 250Mi
limits:
cpu: 500m
memory: 500Mi
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: drone-runner-role
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- delete
- apiGroups:
- ""
resources:
- pods
- pods/log
verbs:
- get
- create
- delete
- list
- watch
- update
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: drone-runner-rolebinding
subjects:
- kind: ServiceAccount
name: default
roleRef:
kind: Role
name: drone-runner-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Service
metadata:
name: drone-runner
labels:
app.kubernetes.io/name: drone
app.kubernetes.io/component: runner
# monitor: prometheus
spec:
selector:
app.kubernetes.io/name: drone
app.kubernetes.io/component: runner
ports:
- name: http
port: 3000
targetPort: http