Skip to content

Instantly share code, notes, and snippets.

@tvvignesh
Created December 22, 2019 18:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvvignesh/25850fe4e0ce3bbdfac479f5ff020168 to your computer and use it in GitHub Desktop.
Save tvvignesh/25850fe4e0ce3bbdfac479f5ff020168 to your computer and use it in GitHub Desktop.
Dind service for Kubernetes
kind: Namespace
apiVersion: v1
metadata:
name: dind
labels:
name: dind
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dind-pv-claim
namespace: dind
labels:
app: dind
spec:
# storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dind
namespace: dind
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
resources:
limits:
memory: "2Gi"
cpu: "1000m"
requests:
memory: "1Gi"
cpu: "250m"
volumes:
- name: dind-storage
persistentVolumeClaim:
claimName: dind-pv-claim
---
apiVersion: v1
kind: Service
metadata:
name: dind
namespace: dind
spec:
selector:
app: dind
type: LoadBalancer
ports:
- protocol: TCP
name: http
port: 2375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment