Enum DnsPolicy

    • Enum Constant Detail

      • CLUSTER_FIRST

        @Stability(Stable)
        public static final DnsPolicy CLUSTER_FIRST
        Any DNS query that does not match the configured cluster domain suffix, such as "www.kubernetes.io", is forwarded to the upstream nameserver inherited from the node. Cluster administrators may have extra stub-domain and upstream DNS servers configured.
      • CLUSTER_FIRST_WITH_HOST_NET

        @Stability(Stable)
        public static final DnsPolicy CLUSTER_FIRST_WITH_HOST_NET
        For Pods running with hostNetwork, you should explicitly set its DNS policy "ClusterFirstWithHostNet".
      • DEFAULT

        @Stability(Stable)
        public static final DnsPolicy DEFAULT
        The Pod inherits the name resolution configuration from the node that the pods run on.
      • NONE

        @Stability(Stable)
        public static final DnsPolicy NONE
        It allows a Pod to ignore DNS settings from the Kubernetes environment.

        All DNS settings are supposed to be provided using the dnsConfig field in the Pod Spec.

    • Method Detail

      • values

        public static DnsPolicy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DnsPolicy c : DnsPolicy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DnsPolicy valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null