Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
3c4201d
initial commit
Dec 20, 2018
bd37fec
fix formatting
Dec 20, 2018
b829580
for ci script
Dec 20, 2018
de4787c
add rbac permissions when setting namespace
Dec 21, 2018
3975183
fix roles for namespace
Dec 21, 2018
a570768
change to clusterrole
Dec 21, 2018
edf2aed
correct data path
Dec 21, 2018
0881bde
rename
Dec 21, 2018
38ceb6f
change back to clusterrole
Dec 21, 2018
5e22b24
rename
Dec 21, 2018
f256eb5
clean up
Dec 21, 2018
98830e0
simplify
Dec 21, 2018
7e2a052
add rpc env variables
Dec 21, 2018
3cf6ce9
changed chart name to match dir
Dec 21, 2018
39543f0
use most recent helm
Dec 21, 2018
b51d9b8
conversion of helm
Dec 21, 2018
6cc283c
switch to our own docker image
Dec 21, 2018
90bd9f9
add kubectl proxy
Dec 21, 2018
bbba938
run proxy in background
Dec 21, 2018
43f8d0b
run on port 8080
Dec 21, 2018
ea8637e
add library for helm
Dec 21, 2018
8e15c80
remove proxy
Dec 21, 2018
6e84576
add kubernetes environment variables to runner pods
Dec 22, 2018
23427a6
print out environment variables
Dec 22, 2018
dfcade4
fix runner env
Dec 22, 2018
dfa34ad
add kube api secret to runner containers
Dec 22, 2018
4e0f2d2
correctly mlunt service account dir
Dec 22, 2018
2628687
print contents of mounted dir
Dec 22, 2018
de915ff
list dir contents
Dec 22, 2018
45606e8
fix drone runner dir
Dec 22, 2018
8239da3
fix typo
Dec 22, 2018
0f70f71
run container as privilieged
Dec 22, 2018
0d18932
add kube secrets
Dec 23, 2018
978ad09
add volume
Dec 23, 2018
e204f0a
inject runner k8s runner env on startup
Dec 23, 2018
809b4fc
inject k8s
Dec 23, 2018
f9445b8
try webhook
Dec 23, 2018
b3a339e
echo api_key
Dec 23, 2018
19c485b
modify env name
Dec 23, 2018
9ca87a9
encode cacrt
Dec 23, 2018
7d97d03
cicd test
Dec 27, 2018
2868aa6
change CACART
Dec 27, 2018
e87d62f
correct variable name
Dec 27, 2018
9b6d8f2
echo value set in chart
Dec 27, 2018
4f881be
fix syntax error
Dec 27, 2018
f585628
use kubeonfig secret
Dec 27, 2018
95b5221
fixed yaml
Dec 28, 2018
c1e20f2
updated kubeconfig
Dec 28, 2018
96f5f01
encode kubeconfig
Dec 28, 2018
0d3bc15
decode correctly
Dec 28, 2018
bc2909c
fix pipeline
Dec 28, 2018
c3d7ee5
fix typo
Dec 28, 2018
21a2d8e
debug pipeline
Dec 28, 2018
c6e29b9
limit chart name length
Dec 28, 2018
f048aaf
fix pipeline
Dec 28, 2018
e5de994
pipe first delete into null command
Dec 28, 2018
fb68210
delete any fail test runs
Dec 28, 2018
434ec03
make chart name random
Dec 28, 2018
5755a1d
use keyporttech image for init
Dec 28, 2018
0f60712
fix upgrade
Dec 28, 2018
735d4c8
fix upgrade/delete
Dec 28, 2018
a709f78
fix pipeline and clean up
Dec 28, 2018
c2aa057
set namespace
Dec 28, 2018
e9c4182
fix documentation
Dec 29, 2018
230d825
add admin user initialization
Jan 15, 2019
1987fe6
Merge branch 'master' of github.com:keyporttech/drone-helm-chart into…
Jan 15, 2019
016d9ef
update README.md
Jan 15, 2019
1f7d3d2
state update
Mar 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: drone
name: drone-helm-chart
home: https://drone.io/
icon: https://drone.io/apple-touch-icon.png
version: 1.0.0-rc.3
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ helm install .
```

## Installing the Chart
Running drone on kubernetes requires a service account that has rbac privileges to create namespaces. Since this is a clusterrole, which cannot installed by most tiller installs, manual set-up is needed.
Running drone on kubernetes requires running with a service account that has rbac privileges to create namespaces. Since this is a clusterrole, which cannot installed by most tiller installs, manual set up is needed.

The following will install a service account with admin clusterrole binding in the default namespace:

Expand Down Expand Up @@ -133,12 +133,13 @@ The following table lists the configurable parameters of the drone charts and th
| `server.host` | Drone **server** scheme and hostname | `(internal hostname)` |
| `server.env` | Drone **server** environment variables | `(default values)` |
| `server.envSecrets`        | Drone **server** secret environment variables                                                 | `(default values)`         |
| `server.adminAccount` | Drone **server** admin account - set specified user as admin | `unset` |
| `server.annotations` | Drone **server** annotations | `{}` |
| `server.resources` | Drone **server** pod resource requests & limits | `{}` |
| `server.schedulerName` | Drone **server** alternate scheduler name | `nil` |
| `server.affinity` | Drone **server** scheduling preferences | `{}` |
| `server.nodeSelector` | Drone **server** node labels for pod assignment | `{}` |
| `server.extraContainers` | Additional sidecar containers | `""` |
| `server.extraContainers` | Additional sidecar containers | `""` |
| `server.extraVolumes` | Additional volumes for use in extraContainers | `""` | |
| `metrics.prometheus.enabled` | Enable Prometheus metrics endpoint | `false` |
| `persistence.enabled` | Use a PVC to persist data | `true` |
Expand Down
28 changes: 28 additions & 0 deletions templates/containers/_drone_k8s_secrets.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{/*
Create helm partial for drone secrets container
*/}}
{{- define "drone-k8s-secrets" }}
- name: {{ template "drone.fullname" . }}-secrets
image: "{{ .Values.images.server.secrets }}"
imagePullPolicy: {{ .Values.images.server.pullPolicy }}
env:
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ template "drone.fullname" $ }}
key: secretKey
ports:
- name: http
containerPort: 3000
protocol: TCP
readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 15
periodSeconds: 20
{{- end }}
49 changes: 49 additions & 0 deletions templates/containers/_drone_server.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{{/*
Create helm partial for drone server
*/}}
{{- define "drone" }}
- name: {{ template "drone.fullname" . }}-server
image: "{{ .Values.images.server.repository }}:{{ .Values.images.server.tag }}"
imagePullPolicy: {{ .Values.images.server.pullPolicy }}
env:
- name: DRONE_KUBERNETES_ENABLED
value: "true"
- name: DRONE_RPC_PROTO
value: http
- name: DRONE_RPC_HOST
value: "{{ template "drone.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local"
- name: DRONE_KUBERNETES_NAMESPACE
value: {{ .Release.Namespace }}
{{- if .Values.server.adminAccount }}
- name: DRONE_USER_CREATE
value: "username:{{ .Values.server.adminAccount }},machine:false,admin:true"
{{- end }}
{{- range $key, $value := .Values.server.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
- name: DRONE_SECRET_SECRET
valueFrom:
secretKeyRef:
name: {{ template "drone.fullname" $ }}
key: secretKey
- name: DRONE_SECRET_ENDPOINT
value: http://localhost:3000
ports:
- name: http
{{- if not (.Values.server.env.DRONE_SERVER_PORT) }}
containerPort: 80
{{ else }}
containerPort: {{ .Values.server.env.DRONE_SERVER_PORT }}
{{ end -}}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
resources:
{{ toYaml .Values.server.resources | indent 10 }}
volumeMounts:
- name: data
mountPath: /data
{{- end }}
47 changes: 3 additions & 44 deletions templates/deployment-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,50 +39,9 @@ spec:
{{- end }}
serviceAccountName: {{ .Values.server.serviceAccount }}
containers:
- name: {{ template "drone.fullname" . }}-server
image: "{{ .Values.images.server.repository }}:{{ .Values.images.server.tag }}"
imagePullPolicy: {{ .Values.images.server.pullPolicy }}
env:
- name: DRONE_KUBERNETES_ENABLED
value: "true"
- name: DRONE_RPC_PROTO
value: http
- name: DRONE_RPC_HOST
value: "{{ template "drone.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local"
- name: DRONE_KUBERNETES_NAMESPACE
value: {{ .Release.Namespace }}
{{- range $key, $value := .Values.server.envSecrets }}
- name: {{ $key }}
valueFrom:
secretKeyRef:
{{- if $.Values.existingSecret }}
name: {{ $.Values.existingSecret }}
{{ else }}
name: {{ template "drone.fullname" $ }}
{{ end -}}
key: {{ $key }}
{{- end }}
{{- range $key, $value := .Values.server.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
ports:
- name: http
{{- if not (.Values.server.env.DRONE_SERVER_PORT) }}
containerPort: 80
{{ else }}
containerPort: {{ .Values.server.env.DRONE_SERVER_PORT }}
{{ end -}}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
resources:
{{ toYaml .Values.server.resources | indent 10 }}
volumeMounts:
- name: data
mountPath: /data
{{ include "drone" . | indent 6 }}
{{ include "drone-k8s-secrets" . | indent 6 }}

{{- with .Values.server.extraContainers }}
{{ tpl . $ | indent 6 }}
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if (not .Values.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -10,7 +9,8 @@ metadata:
heritage: "{{ .Release.Service }}"
type: Opaque
data:
{{- range $key, $value := .Values.server.envSecrets }}
{{ $key }}: {{ $value | b64enc }}
{{- end }}
{{ if .Values.secretKey }}
secretKey: {{ .Values.secretKey | b64enc | quote }}
{{ else }}
secretKey: {{ randAlphaNum 16 | b64enc | quote }}
{{ end }}
25 changes: 15 additions & 10 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ images:
repository: "docker.io/drone/drone"
tag: 1.0.0-rc.3
pullPolicy: IfNotPresent
secrets: docker.io/drone/kubernetes-secrets:latest

service:
httpPort: 80
Expand Down Expand Up @@ -52,7 +53,15 @@ ingress:
# hosts:
# - drone.domain.io

# secret key used by the kubernetes secret manager - if not specified a random value is generated
# secretKey: 1234567890ABCDEF

server:


## account to bootstrap as an admin user when the server starts
#adminAccount: octocat

serviceAccount: drone-runner

## Drone server configuration.
Expand All @@ -62,17 +71,13 @@ server:
env:
DRONE_DEBUG: "false"

DRONE_GITHUB_SERVER: https://github.com
DRONE_GITHUB_SKIP_VERIFY: true

## Drone requires some environment variables to bootstrap the
## git service or it won't start up.
## Uncomment this and add your own custom configuration.
##
# DRONE_PROVIDER: "github"
# DRONE_OPEN: "true"
# DRONE_GITHUB: "true"
# DRONE_ORGS: "my-github-org,my-other-github-org"
# DRONE_ADMIN:"admin-1,admin-2"
# DRONE_GITHUB_CLIENT: "github-oauth2-client-id"
# replace with your values - TODO: use secrets
DRONE_GITHUB_CLIENT_ID: "1234567890"
DRONE_GITHUB_CLIENT_SECRET: "ABCDEFGHIHKLMNOPQRSTUBQXYZ"
DRONE_RPC_SECRET:

## Secret environment variables are configured in `server.envSecrets`.
## Each item in `server.envSecrets` references a Kubernetes Secret.
Expand Down