Class Config

    • Field Detail

      • KUBERNETES_DISABLE_AUTO_CONFIG_SYSTEM_PROPERTY

        public static final String KUBERNETES_DISABLE_AUTO_CONFIG_SYSTEM_PROPERTY
        Disables autoconfiguration based on opinionated defaults in a Config object in the all arguments constructor
        See Also:
        Constant Field Values
      • KUBERNETES_API_VERSION_SYSTEM_PROPERTY

        public static final String KUBERNETES_API_VERSION_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_TRUST_CERT_SYSTEM_PROPERTY

        public static final String KUBERNETES_TRUST_CERT_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_DISABLE_HOSTNAME_VERIFICATION_SYSTEM_PROPERTY

        public static final String KUBERNETES_DISABLE_HOSTNAME_VERIFICATION_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_CA_CERTIFICATE_FILE_SYSTEM_PROPERTY

        public static final String KUBERNETES_CA_CERTIFICATE_FILE_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_CA_CERTIFICATE_DATA_SYSTEM_PROPERTY

        public static final String KUBERNETES_CA_CERTIFICATE_DATA_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_CLIENT_CERTIFICATE_FILE_SYSTEM_PROPERTY

        public static final String KUBERNETES_CLIENT_CERTIFICATE_FILE_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_CLIENT_CERTIFICATE_DATA_SYSTEM_PROPERTY

        public static final String KUBERNETES_CLIENT_CERTIFICATE_DATA_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_CLIENT_KEY_FILE_SYSTEM_PROPERTY

        public static final String KUBERNETES_CLIENT_KEY_FILE_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_CLIENT_KEY_DATA_SYSTEM_PROPERTY

        public static final String KUBERNETES_CLIENT_KEY_DATA_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_CLIENT_KEY_ALGO_SYSTEM_PROPERTY

        public static final String KUBERNETES_CLIENT_KEY_ALGO_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_CLIENT_KEY_PASSPHRASE_SYSTEM_PROPERTY

        public static final String KUBERNETES_CLIENT_KEY_PASSPHRASE_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_AUTH_BASIC_USERNAME_SYSTEM_PROPERTY

        public static final String KUBERNETES_AUTH_BASIC_USERNAME_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_AUTH_BASIC_PASSWORD_SYSTEM_PROPERTY

        public static final String KUBERNETES_AUTH_BASIC_PASSWORD_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY

        public static final String KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_AUTH_TRYSERVICEACCOUNT_SYSTEM_PROPERTY

        public static final String KUBERNETES_AUTH_TRYSERVICEACCOUNT_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_AUTH_SERVICEACCOUNT_TOKEN_FILE_SYSTEM_PROPERTY

        public static final String KUBERNETES_AUTH_SERVICEACCOUNT_TOKEN_FILE_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_OAUTH_TOKEN_SYSTEM_PROPERTY

        public static final String KUBERNETES_OAUTH_TOKEN_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_WATCH_RECONNECT_INTERVAL_SYSTEM_PROPERTY

        public static final String KUBERNETES_WATCH_RECONNECT_INTERVAL_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_WATCH_RECONNECT_LIMIT_SYSTEM_PROPERTY

        public static final String KUBERNETES_WATCH_RECONNECT_LIMIT_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_CONNECTION_TIMEOUT_SYSTEM_PROPERTY

        public static final String KUBERNETES_CONNECTION_TIMEOUT_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_UPLOAD_REQUEST_TIMEOUT_SYSTEM_PROPERTY

        public static final String KUBERNETES_UPLOAD_REQUEST_TIMEOUT_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_REQUEST_TIMEOUT_SYSTEM_PROPERTY

        public static final String KUBERNETES_REQUEST_TIMEOUT_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_REQUEST_RETRY_BACKOFFLIMIT_SYSTEM_PROPERTY

        public static final String KUBERNETES_REQUEST_RETRY_BACKOFFLIMIT_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_REQUEST_RETRY_BACKOFFINTERVAL_SYSTEM_PROPERTY

        public static final String KUBERNETES_REQUEST_RETRY_BACKOFFINTERVAL_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_LOGGING_INTERVAL_SYSTEM_PROPERTY

        public static final String KUBERNETES_LOGGING_INTERVAL_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_SCALE_TIMEOUT_SYSTEM_PROPERTY

        public static final String KUBERNETES_SCALE_TIMEOUT_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_WEBSOCKET_PING_INTERVAL_SYSTEM_PROPERTY

        public static final String KUBERNETES_WEBSOCKET_PING_INTERVAL_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_MAX_CONCURRENT_REQUESTS_PER_HOST

        public static final String KUBERNETES_MAX_CONCURRENT_REQUESTS_PER_HOST
        See Also:
        Constant Field Values
      • KUBERNETES_TRUSTSTORE_PASSPHRASE_PROPERTY

        public static final String KUBERNETES_TRUSTSTORE_PASSPHRASE_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_KEYSTORE_PASSPHRASE_PROPERTY

        public static final String KUBERNETES_KEYSTORE_PASSPHRASE_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_TRYNAMESPACE_PATH_SYSTEM_PROPERTY

        public static final String KUBERNETES_TRYNAMESPACE_PATH_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_NAMESPACE_SYSTEM_PROPERTY

        public static final String KUBERNETES_NAMESPACE_SYSTEM_PROPERTY
        See Also:
        Constant Field Values
      • KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH

        public static final String KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH
        See Also:
        Constant Field Values
      • KUBERNETES_SERVICE_ACCOUNT_CA_CRT_PATH

        public static final String KUBERNETES_SERVICE_ACCOUNT_CA_CRT_PATH
        See Also:
        Constant Field Values
      • DEFAULT_SCALE_TIMEOUT

        public static final Long DEFAULT_SCALE_TIMEOUT
      • DEFAULT_REQUEST_TIMEOUT

        public static final int DEFAULT_REQUEST_TIMEOUT
        See Also:
        Constant Field Values
      • DEFAULT_LOGGING_INTERVAL

        public static final int DEFAULT_LOGGING_INTERVAL
        See Also:
        Constant Field Values
      • DEFAULT_WEBSOCKET_PING_INTERVAL

        public static final Long DEFAULT_WEBSOCKET_PING_INTERVAL
      • DEFAULT_MAX_CONCURRENT_REQUESTS

        public static final Integer DEFAULT_MAX_CONCURRENT_REQUESTS
      • DEFAULT_MAX_CONCURRENT_REQUESTS_PER_HOST

        public static final Integer DEFAULT_MAX_CONCURRENT_REQUESTS_PER_HOST
      • DEFAULT_REQUEST_RETRY_BACKOFFLIMIT

        public static final Integer DEFAULT_REQUEST_RETRY_BACKOFFLIMIT
      • DEFAULT_REQUEST_RETRY_BACKOFFINTERVAL

        public static final Integer DEFAULT_REQUEST_RETRY_BACKOFFINTERVAL
      • DEFAULT_UPLOAD_REQUEST_TIMEOUT

        public static final int DEFAULT_UPLOAD_REQUEST_TIMEOUT
        See Also:
        Constant Field Values
    • Constructor Detail

      • Config

        protected Config​(boolean autoConfigure)
      • Config

        protected Config()
      • Config

        public Config​(SundrioConfig config)
        Please use ConfigBuilder or static factory methods to create new instances.

        All arguments constructor (only for serialization purposes).

        Parameters:
        config - delegate configuration for deserialization.
    • Method Detail

      • disableAutoConfig

        protected static boolean disableAutoConfig()
      • empty

        public static Config empty()
        Create an empty Config class without any automatic configuration (i.e. reading system properties/environment variables to set values).

        The configuration does include the Kubernetes Client default values for timeouts, etc.

        You can also reuse this object to build your own Config object without any auto configuration like this:

        
         Config configFromBuilder = new ConfigBuilder(Config.empty())
                                        // ...
                                       .build();
         
        Returns:
        a Config object without any automatic configuration.
      • autoConfigure

        public static Config autoConfigure​(String context)
        Does auto-detection with some opinionated defaults.
        Parameters:
        context - if null will use current-context
        Returns:
        Config object
      • configFromSysPropsOrEnvVars

        public static void configFromSysPropsOrEnvVars​(Config config)
      • fromKubeconfig

        public static Config fromKubeconfig​(String kubeconfigContents)
      • fromKubeconfig

        public static Config fromKubeconfig​(File kubeconfigFile)
      • fromKubeconfig

        public static Config fromKubeconfig​(String context,
                                            File kubeconfig)
      • refresh

        public Config refresh()
        Refresh the config from file / env sources. Any values that the user have programmatically set will be lost.
        Returns:
        this Config instance with the refreshed values (if applicable)
      • getKubeconfigFilenames

        public static Collection<String> getKubeconfigFilenames()
      • getKeyAlgorithm

        public static String getKeyAlgorithm​(String clientKeyFile,
                                             String clientKeyData)
      • getImpersonateUsername

        public String getImpersonateUsername()
      • setImpersonateUsername

        public void setImpersonateUsername​(String impersonateUsername)
      • getImpersonateGroups

        public String[] getImpersonateGroups()
      • setImpersonateExtras

        public void setImpersonateExtras​(Map<String,​List<String>> impersonateExtras)
      • setMasterUrl

        public void setMasterUrl​(String masterUrl)
      • isTrustCerts

        public boolean isTrustCerts()
      • setTrustCerts

        public void setTrustCerts​(boolean trustCerts)
      • isDisableHostnameVerification

        public boolean isDisableHostnameVerification()
      • setDisableHostnameVerification

        public void setDisableHostnameVerification​(boolean disableHostnameVerification)
      • getWatchReconnectInterval

        public Integer getWatchReconnectInterval()
      • setWatchReconnectInterval

        public void setWatchReconnectInterval​(Integer watchReconnectInterval)
      • getWatchReconnectLimit

        public Integer getWatchReconnectLimit()
      • setWatchReconnectLimit

        public void setWatchReconnectLimit​(Integer watchReconnectLimit)
      • getUploadRequestTimeout

        public Integer getUploadRequestTimeout()
      • setUploadRequestTimeout

        public void setUploadRequestTimeout​(Integer requestTimeout)
      • getRequestTimeout

        public Integer getRequestTimeout()
      • setRequestTimeout

        public void setRequestTimeout​(Integer requestTimeout)
      • getRequestRetryBackoffLimit

        public Integer getRequestRetryBackoffLimit()
      • setRequestRetryBackoffLimit

        public void setRequestRetryBackoffLimit​(Integer requestRetryBackoffLimit)
      • getRequestRetryBackoffInterval

        public Integer getRequestRetryBackoffInterval()
      • setRequestRetryBackoffInterval

        public void setRequestRetryBackoffInterval​(Integer requestRetryBackoffInterval)
      • getScaleTimeout

        public Long getScaleTimeout()
      • setScaleTimeout

        public void setScaleTimeout​(Long scaleTimeout)
      • getLoggingInterval

        public Integer getLoggingInterval()
      • setLoggingInterval

        public void setLoggingInterval​(Integer loggingInterval)
      • isHttp2Disable

        public boolean isHttp2Disable()
      • isDefaultNamespace

        public boolean isDefaultNamespace()
      • setDefaultNamespace

        public void setDefaultNamespace​(boolean defaultNamespace)
      • getFile

        public File getFile()
        Returns the path to the file that contains the context from which this configuration was loaded from.

        Returns null if no file was used.

        Returns:
        the path to the kubeconfig file.
      • getFileWithCluster

        public File getFileWithCluster()
        Returns the path to the file that contains the cluster information from which this configuration was loaded from.

        Returns null if no file was used.

        Returns:
        the path to the kubeconfig file.
      • getFileWithAuthInfo

        public File getFileWithAuthInfo()
        Returns the path to the file that contains the user information from which this configuration was loaded from.

        Returns null if no file was used.

        Returns:
        the path to the kubeconfig file.
      • getReadiness

        public Readiness getReadiness()
      • isOnlyHttpWatches

        public boolean isOnlyHttpWatches()
      • setOnlyHttpWatches

        public void setOnlyHttpWatches​(boolean onlyHttpWatches)