add HostAliases field to PodSpec to support adding entries into hosts file

pull/6/head
Ricky Pai 2017-04-26 13:19:19 -07:00
parent 55f802b72a
commit 6ff5f06ec5
2 changed files with 26 additions and 0 deletions

View File

@ -2099,6 +2099,17 @@ type PodSpec struct {
// If specified, the pod's tolerations.
// +optional
Tolerations []Toleration
// HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts
// file if specified. This is only valid for non-hostNetwork pods.
// +optional
HostAliases []HostAlias
}
// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the
// pod's hosts file.
type HostAlias struct {
IP string
Hostnames []string
}
// Sysctl defines a kernel parameter to be set

View File

@ -2406,6 +2406,21 @@ type PodSpec struct {
// If specified, the pod's tolerations.
// +optional
Tolerations []Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`
// HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts
// file if specified. This is only valid for non-hostNetwork pods.
// +optional
// +patchMergeKey=IP
// +patchStrategy=merge
HostAliases []HostAlias `json:"hostMappings,omitempty" patchStrategy:"merge" patchMergeKey:"IP" protobuf:"bytes,23,rep,name=hostMappings"`
}
// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the
// pod's hosts file.
type HostAlias struct {
// IP address of the host file entry.
IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"`
// Hostnames for the the above IP address.
Hostnames []string `json:"hostnames,omitempty" protobuf:"bytes,2,rep,name=hostnames"`
}
// PodSecurityContext holds pod-level security attributes and common container settings.