Class PodDns.Builder

  • All Implemented Interfaces:
    software.amazon.jsii.Builder<PodDns>
    Enclosing class:
    PodDns

    @Stability(Stable)
    public static final class PodDns.Builder
    extends Object
    implements software.amazon.jsii.Builder<PodDns>
    A fluent builder for PodDns.
    • Method Detail

      • hostname

        @Stability(Stable)
        public PodDns.Builder hostname​(String hostname)
        Specifies the hostname of the Pod.

        Default: - Set to a system-defined value.

        Parameters:
        hostname - Specifies the hostname of the Pod. This parameter is required.
        Returns:
        this
      • hostnameAsFqdn

        @Stability(Stable)
        public PodDns.Builder hostnameAsFqdn​(Boolean 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.

        Default: false

        Parameters:
        hostnameAsFqdn - If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). This parameter is required.
        Returns:
        this
      • nameservers

        @Stability(Stable)
        public PodDns.Builder nameservers​(List<String> 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.

        Parameters:
        nameservers - A list of IP addresses that will be used as DNS servers for the Pod. This parameter is required.
        Returns:
        this
      • options

        @Stability(Stable)
        public PodDns.Builder options​(List<? extends DnsOption> 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.

        Parameters:
        options - List of objects where each object may have a name property (required) and a value property (optional). This parameter is required.
        Returns:
        this
      • policy

        @Stability(Stable)
        public PodDns.Builder policy​(DnsPolicy policy)
        Set DNS policy for the pod.

        If policy is set to None, other configuration must be supplied.

        Default: DnsPolicy.CLUSTER_FIRST

        Parameters:
        policy - Set DNS policy for the pod. This parameter is required.
        Returns:
        this
      • searches

        @Stability(Stable)
        public PodDns.Builder searches​(List<String> 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.

        Parameters:
        searches - A list of DNS search domains for hostname lookup in the Pod. This parameter is required.
        Returns:
        this
      • subdomain

        @Stability(Stable)
        public PodDns.Builder subdomain​(String subdomain)
        If specified, the fully qualified Pod hostname will be "...svc.".

        Default: - No subdomain.

        Parameters:
        subdomain - If specified, the fully qualified Pod hostname will be "...svc.". This parameter is required.
        Returns:
        this
      • build

        @Stability(Stable)
        public PodDns build()
        Specified by:
        build in interface software.amazon.jsii.Builder<PodDns>