Skip to content

Commit 997ce5d

Browse files
milantracygvisor-bot
authored andcommitted
Remove DNS config docker in GKE sandbox.
The fix #11800 is relased. No DNS config is needed for GKE standard nor GKE autopilot when running docker in GKE sandbox. PiperOrigin-RevId: 788584517
1 parent 2305d33 commit 997ce5d

File tree

1 file changed

+6
-44
lines changed

1 file changed

+6
-44
lines changed

g3doc/user_guide/tutorials/docker-in-gke-sandbox.md

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ with gVisor enabled. You can view the full documentation
1717
### GKE Autopilot cluster
1818

1919
Alternatively to GKE standard cluster, you could run docker in gVisor at GKE
20-
autopilot cluster, the version needs to be 1.32 or higher. When creating the
21-
autopilot cluster, please add the option `--workload-policies=allow-net-admin`
22-
to allow NET_ADMIN capability that will be granted by the gVisor sandbox.
20+
autopilot cluster, the version needs to be 1.33.2-gke.4655000 or higher. When
21+
creating the autopilot cluster, please add the option
22+
`--workload-policies=allow-net-admin` to allow NET_ADMIN capability that will be
23+
granted by the gVisor sandbox.
2324

2425
An example command to start an GKE autopilot cluster will be:
2526

2627
```sh
27-
gcloud container clusters create-auto [CLUTER_NAME] --workload-policies=allow-net-admin --location=[LOCATION] --cluster-version=1.32.2-gke.1182001
28+
gcloud container clusters create-auto [CLUTER_NAME] --workload-policies=allow-net-admin --location=[LOCATION] --cluster-version=1.33.2-gke.4655000
2829
```
2930

3031
### Get started
@@ -45,17 +46,12 @@ metadata:
4546
name: docker-in-gvisor
4647
spec:
4748
runtimeClassName: gvisor
48-
# DNS config is only needed for GKE Autopilot
49-
dnsPolicy: "None"
50-
dnsConfig:
51-
nameservers:
52-
- "1.1.1.1"
53-
- "8.8.8.8"
5449
containers:
5550
- name: docker-in-gvisor
5651
image: {registry_url}/docker-in-gvisor:latest
5752
securityContext:
5853
capabilities:
54+
# NET_ADMIN and SYS_ADMIN are required.
5955
add: [AUDIT_WRITE,CHOWN,DAC_OVERRIDE,FOWNER,FSETID,KILL,MKNOD,NET_BIND_SERVICE,NET_RAW,SETFCAP,SETGID,SETPCAP,SETUID,SYS_CHROOT,SYS_PTRACE,NET_ADMIN,SYS_ADMIN]
6056
volumeMounts:
6157
- name: docker
@@ -81,40 +77,6 @@ $ kubectl apply -f docker.yaml
8177
Verify that the docker-in-gvisor pid is running successfully: `shell $ kubectl
8278
get pods | grep docker-in-gvisor`
8379

84-
#### DNS config
85-
86-
##### GKE standard cluster
87-
88-
The `dnsConfig` in the yaml file is not needed for GKE standard clusters.
89-
90-
##### GKE Autopilot
91-
92-
You have 3 options to deal with DNS config in the cluster:
93-
94-
* Public DNS
95-
96-
If public DNS works for you, you will be able to leverage public DNS like
97-
`1.1.1.1` or `8.8.8.8` like we listed above;
98-
99-
* kube-dns
100-
101-
Otherwise, `kube-dns` will be a helpful option. The `kube-dns` is a pod which
102-
deployed with your k8s cluster.
103-
104-
You will look for kube-dns's address you can specify in the `dnsConfig`
105-
106-
```
107-
$ kubectl get services kube-dns -n kube-system
108-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
109-
kube-dns ClusterIP 34.118.224.10 <none> 53/UDP,53/TCP 3d1h
110-
```
111-
112-
* Host network driver
113-
114-
If you are OK with using Docker host network driver, you can ignore DNS config
115-
in the yaml file. For every command you execute in docker in gVisor, you have to
116-
specify host network driver as `--network=host`.
117-
11880
### Build and run the image with docker in gVisor
11981

12082
You can access the container by executing a shell inside it. Use the following

0 commit comments

Comments
 (0)