Check the logs of the docker
container in each pod of the deploy to verify dind is working on your kubernetes cluster. Pods will restart if they cannot talk to docker server.
Last active
August 2, 2019 20:12
-
-
Save atheiman/bab73f105ef7fc282f144acee291b7f0 to your computer and use it in GitHub Desktop.
verify dind (docker in docker) working on each node of a kubernetes cluster
This file contains 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: DaemonSet | |
metadata: | |
name: dind-test | |
labels: | |
run: dind-test | |
spec: | |
selector: | |
matchLabels: | |
run: dind-test | |
template: | |
metadata: | |
labels: | |
run: dind-test | |
spec: | |
containers: | |
# docker ≥19 serves a tls server by default on port 2376, ≤18 serves unencrypted on 2375 | |
- image: docker:18-dind | |
name: dind | |
securityContext: | |
privileged: true | |
- image: docker:stable | |
name: docker | |
command: [/bin/sh] | |
args: | |
- -c | |
- | | |
set -x; | |
fails=0; | |
while true; do | |
sleep 10 && date; | |
if ! docker version; then fails=$((fails+1)); fi; | |
if [[ $fails -ge 3 ]]; then exit 1; fi; | |
done | |
env: | |
- name: DOCKER_HOST | |
value: tcp://localhost:2375 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment