Created
August 29, 2020 15:50
-
-
Save remcohendriks/abb6bee55952837f33debe13882b7cf2 to your computer and use it in GitHub Desktop.
Docker-in-docker service for docker image layer caching with distributed Gitlab build runners.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: dind | |
namespace: gitlab-runner | |
spec: | |
selector: | |
matchLabels: | |
app: dind | |
strategy: | |
type: Recreate | |
template: | |
metadata: | |
labels: | |
app: dind | |
spec: | |
containers: | |
- image: docker:dind | |
imagePullPolicy: Always | |
name: dind | |
ports: | |
- containerPort: 2375 | |
name: dind | |
env: | |
- name: DOCKER_HOST | |
value: tcp://localhost:2375 | |
- name: DOCKER_TLS_CERTDIR | |
value: "" | |
securityContext: | |
privileged: true | |
volumeMounts: | |
- name: dind-storage | |
mountPath: /var/lib/docker | |
volumes: | |
- name: dind-storage | |
persistentVolumeClaim: | |
claimName: dind-pv-claim | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: dind | |
namespace: gitlab-runner | |
spec: | |
selector: | |
app: dind | |
ports: | |
- protocol: TCP | |
name: http | |
port: 2375 | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: dind-pv-claim | |
namespace: gitlab-runner | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 32Gi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment