Package org.cdk8s.plus24
Class PodDnsProps.Builder
- java.lang.Object
-
- org.cdk8s.plus24.PodDnsProps.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<PodDnsProps>
- Enclosing interface:
- PodDnsProps
@Stability(Stable) public static final class PodDnsProps.Builder extends Object implements software.amazon.jsii.Builder<PodDnsProps>
A builder forPodDnsProps
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PodDnsProps
build()
Builds the configured instance.PodDnsProps.Builder
hostname(String hostname)
Sets the value ofPodDnsProps.getHostname()
PodDnsProps.Builder
hostnameAsFqdn(Boolean hostnameAsFqdn)
Sets the value ofPodDnsProps#getHostnameAsFqdn
PodDnsProps.Builder
nameservers(List<String> nameservers)
Sets the value ofPodDnsProps.getNameservers()
PodDnsProps.Builder
options(List<? extends DnsOption> options)
Sets the value ofPodDnsProps.getOptions()
PodDnsProps.Builder
policy(DnsPolicy policy)
Sets the value ofPodDnsProps.getPolicy()
PodDnsProps.Builder
searches(List<String> searches)
Sets the value ofPodDnsProps.getSearches()
PodDnsProps.Builder
subdomain(String subdomain)
Sets the value ofPodDnsProps.getSubdomain()
-
-
-
Method Detail
-
hostname
@Stability(Stable) public PodDnsProps.Builder hostname(String hostname)
Sets the value ofPodDnsProps.getHostname()
- Parameters:
hostname
- Specifies the hostname of the Pod.- Returns:
this
-
hostnameAsFqdn
@Stability(Stable) public PodDnsProps.Builder hostnameAsFqdn(Boolean hostnameAsFqdn)
Sets the value ofPodDnsProps#getHostnameAsFqdn
- Parameters:
hostnameAsFqdn
- If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters to FQDN. If a pod does not have FQDN, this has no effect.- Returns:
this
-
nameservers
@Stability(Stable) public PodDnsProps.Builder nameservers(List<String> nameservers)
Sets the value ofPodDnsProps.getNameservers()
- Parameters:
nameservers
- A list of IP addresses that will be used as DNS servers for the Pod. There can be at most 3 IP addresses specified. When the policy is set to "NONE", the list must contain at least one IP address, otherwise this property is optional. The servers listed will be combined to the base nameservers generated from the specified DNS policy with duplicate addresses removed.- Returns:
this
-
options
@Stability(Stable) public PodDnsProps.Builder options(List<? extends DnsOption> options)
Sets the value ofPodDnsProps.getOptions()
- Parameters:
options
- List of objects where each object may have a name property (required) and a value property (optional). The contents in this property will be merged to the options generated from the specified DNS policy. Duplicate entries are removed.- Returns:
this
-
policy
@Stability(Stable) public PodDnsProps.Builder policy(DnsPolicy policy)
Sets the value ofPodDnsProps.getPolicy()
- Parameters:
policy
- Set DNS policy for the pod. If policy is set toNone
, other configuration must be supplied.- Returns:
this
-
searches
@Stability(Stable) public PodDnsProps.Builder searches(List<String> searches)
Sets the value ofPodDnsProps.getSearches()
- Parameters:
searches
- A list of DNS search domains for hostname lookup in the Pod. When specified, the provided list will be merged into the base search domain names generated from the chosen DNS policy. Duplicate domain names are removed.Kubernetes allows for at most 6 search domains.
- Returns:
this
-
subdomain
@Stability(Stable) public PodDnsProps.Builder subdomain(String subdomain)
Sets the value ofPodDnsProps.getSubdomain()
- Parameters:
subdomain
- If specified, the fully qualified Pod hostname will be ". . .svc. ". - Returns:
this
-
build
@Stability(Stable) public PodDnsProps build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PodDnsProps>
- Returns:
- a new instance of
PodDnsProps
- Throws:
NullPointerException
- if any required attribute was not provided
-
-