Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
Created January 17, 2023 12:09
Show Gist options
  • Save ipedrazas/0813320a8a523083d7aa282a809ffabb to your computer and use it in GitHub Desktop.
Save ipedrazas/0813320a8a523083d7aa282a809ffabb to your computer and use it in GitHub Desktop.
Kubernetes DNS - Adding additional entries with hostAliases
apiVersion: v1
kind: Pod
metadata:
name: hostaliases-pod
spec:
restartPolicy: Never
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:1.28
command:
- cat
args:
- "/etc/hosts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment