IT漫步

技术生活札记©Yaohui

Customize hosts record on docker and kubernetes

Docker: docker run -it --rm --add-host=host1:172.17.0.2 --add-host=host2:192.168.1.3 busybox use “–add-host” to add entries to /etc/hosts   Kubernetes: apiVersion: v1 kind: Pod metadata: name: hostaliases-pod spec: hostAliases: - ip: "127.0.0.1" hostnames: - "foo.local" - "bar.local" - ip: "10.1.2.3" hostnames: - "foo.remote" - "bar.remote" containers: - name: cat-hosts image: busybox command: - cat args: - "/etc/hosts" use …

Proudly powered by WordPress