Skip to content

Commit 6a01729

Browse files
committed
added k3s install , tested dind by other devs - podman, docker, k3s
1 parent 04a2cb7 commit 6a01729

File tree

5 files changed

+96
-2
lines changed

5 files changed

+96
-2
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,48 @@ arm, arm64, x86, x86_64 mips, mips64
126126
watch, watchdog, wc, wget, which, who, whoami, whois, xargs, xxd, xz,
127127
xzcat, yes, zcat, zcip
128128

129+
130+
### k3s instal with curl script
131+
132+
```shell
133+
134+
apiVersion: apps/v1
135+
kind: Deployment
136+
metadata:
137+
name: ubuntu-dind-deployment
138+
spec:
139+
replicas: 1
140+
selector:
141+
matchLabels:
142+
app: ubuntu-dind
143+
template:
144+
metadata:
145+
labels:
146+
app: ubuntu-dind
147+
spec:
148+
containers:
149+
- name: ubuntu-dind
150+
image: cruizba/ubuntu-dind
151+
securityContext:
152+
privileged: true
153+
env:
154+
- name: PUID
155+
value: "1001"
156+
- name: PGID
157+
value: "1001"
158+
159+
---
160+
apiVersion: v1
161+
kind: Service
162+
metadata:
163+
name: ubuntu-dind-service
164+
spec:
165+
selector:
166+
app: ubuntu-dind
167+
ports:
168+
- protocol: TCP
169+
port: 80
170+
targetPort: 8080
171+
type: ClusterIP
172+
173+
```

examples/DinD.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
## With Podman or Docker
3+
4+
```shell
5+
6+
# with Podman
7+
podman run --privileged --rm -it -e PUID=1001 -e PGID=1001 cruizba/ubuntu-dind /bin/bash
8+
9+
# with Docker
10+
docker run --privileged --rm -it -e PUID=1002 -e PGID=1002 cruizba/ubuntu-dind /bin/bash
11+
12+
# once the container is up and running , just run bellow command in Ubuntu container
13+
docker run --rm -it alpine /bin/sh
14+
15+
16+
```
17+
18+
19+
## With k3s
20+
21+
```shell
22+
23+
kubectl apply -f dind.yml
24+
25+
# once the container is up and running
26+
kubectl get pods
27+
28+
# just exec inside the container
29+
kubectl get exec -it your-pod-name -- /bin/bash
30+
31+
# run bellow command in Ubuntu container
32+
docker run --rm -it alpine /bin/sh
33+
34+
```
35+

examples/dind.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: ubuntu-dind-pod-777
5+
spec:
6+
containers:
7+
- name: ubuntu-dind-container
8+
image: cruizba/ubuntu-dind:latest
9+
securityContext:
10+
privileged: true
11+
command: ["sh", "-c", "supervisord && tail -f /dev/null" ]

scripts/dqops/install-k3.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
curl -sfL https://get.k3s.io | sh -

scripts/dqops/install-podman.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ sh -c 'echo 'kernel.unprivileged_userns_clone=1' >> /etc/sysctl.conf'
6767

6868
sh -c 'sysctl --system'
6969

70-
sudo apt-get install -y dbus-user-session
71-
sudo apt-get install -y fuse-overlayfs
70+
apt-get install -y dbus-user-session
71+
apt-get install -y fuse-overlayfs
7272

7373

7474

0 commit comments

Comments
 (0)