Skip to content

Commit

Permalink
Merge pull request #57 from 0x0I/add_sidecar_support
Browse files Browse the repository at this point in the history
add dind.enable easy-button and 'podContainers' param to allow specification of agent side-cars
  • Loading branch information
rimusz authored May 11, 2020
2 parents 3a07b8c + b90b198 commit eecee73
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: Buildkite Agent Chart
name: agent
version: 0.3.12
version: 0.3.13
appVersion: 3.17.0
icon: https://raw.githubusercontent.com/buildkite/site/master/assets/images/brand-assets/buildkite-mark-on-light.png
keywords:
Expand Down
4 changes: 4 additions & 0 deletions stable/agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ Parameter | Description | Default
`tolerations` | Node tolerations for pod assignment | `{}`
`affinity` | Node/pod affinity | `{}`
`podAnnotations` | Extra annotation to apply to the pod | `{}`
`podContainers` | Extra pod container or sidecar configuration | `nil`
`dind.enabled` | Enable preconfigured Docker-in-Docker (DinD) pod configuration | `false`
`dind.image` | Image to use for Docker-in-Docker (DinD) pod | `docker:19.03-dind`
`dind.port` | Port Docker-in-Docker (DinD) daemon listens on as REST request proxy | `2375`

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Expand Down
32 changes: 32 additions & 0 deletions stable/agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ metadata:
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "name" . }}
template:
metadata:
labels:
Expand Down Expand Up @@ -59,6 +62,10 @@ spec:
name: {{ template "fullname" . }}
key: agent-ssh
{{- end }}
{{- if .Values.dind.enabled }}
- name: DOCKER_HOST
value: "tcp://localhost:{{ .Values.dind.port | default "2375" }}"
{{- end }}
# EXTRA BUILDKITE AGENT ENV VARS
{{- if .Values.extraEnv }}
{{ toYaml .Values.extraEnv | nindent 12 }}
Expand All @@ -81,6 +88,25 @@ spec:
- name: docker-config
mountPath: /root/.docker
{{- end }}
{{- if .Values.dind.enabled }}
- name: shared-volume
mountPath: "/var/buildkite"
{{- end }}
{{- if .Values.dind.enabled }}
- name: dind
image: {{ .Values.dind.image | default "docker:19.03-dind" }}
securityContext:
privileged: true
env:
- name: DOCKER_TLS_CERTDIR
value: ""
volumeMounts:
- name: "docker-graph-storage"
mountPath: "/var/lib/docker"
- name: shared-volume
mountPath: "/var/buildkite"
{{- end }}
{{- if .Values.podContainers }}{{ toYaml .Values.podContainers | nindent 8 }}{{- end }}
volumes:
{{- if .Values.volumes }}{{ toYaml .Values.volumes | nindent 8 }}{{- end }}
{{- if .Values.enableHostDocker }}
Expand All @@ -98,6 +124,12 @@ spec:
secret:
secretName: {{ template "fullname" . }}-registry
{{- end }}
{{- if .Values.dind.enabled }}
- name: docker-graph-storage
emptyDir: {}
- name: shared-volume
emptyDir: {}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
Expand Down

0 comments on commit eecee73

Please sign in to comment.