-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdns-policy-clusterfirst.yaml
15 lines (15 loc) · 1.15 KB
/
dns-policy-clusterfirst.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
kind: Pod # resources
apiVersion: v1 # api group
metadata: # contain less but important information about Pod
name: firsthost-policy # Should be unique | case sensitive
labels: # useful to detect Pod within cluster
policy: clusterhost
spec: # Pod template begins
containers: # pod.spec.containers
- image: bash # image name
name: bash-3 # container name, if other pods has same container name doesn't effect.
command: ["sleep","4500"] # command to run as a main process. If we use /bin/sh then shell will execute this process.
dnsPolicy: ClusterFirstWithHostNet # policy type is Default. Others are: ClusterFirst | None | Default
hostNetwork: true # Should be true if we defining, dnsPolicy: ClusterFirstWithHostNet
# It takes same entry as in host system have in /etc/hosts
# Can see all ip addresses, because accessing host network