new ClientConfig(options)
Kubernetes API Client Configuration
Create a new ClientConfig
object. The given object will supply the necessary fields to initialize
the object. If any required parameters are missing an error will be thrown.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | module:client~ClientConfig | Input parameters Properties
|
Throws:
Members
-
<readonly, nullable> auth :object
-
User credentials for authentication with the API server
Specify a username and password in the object's 'user' and 'pass' properties, respectively. If authentication is handled externally and a valid token has been supplied, or if authentication is not required for the given API server host, then this parameter may be excluded.
Type:
- object
- Default Value:
-
- null
Properties:
Name Type Description user
string Client username
pass
string Client password
-
<readonly> authOptions :object
-
Request options for authentication
Contained properties are passed directly to the request module and override the default configuration for token requests. Consult the documentation for the
request
module (linked below) for information on valid properties.Type:
- object
- Default Value:
-
- {}
- See:
-
<readonly, non-null> host :string
-
Kubernetes API server host
Defines the full URL endpoint for the API server, including protocol and port. If port or protocol are excluded from the host specification, then the ClientConfig will look for them as
port
orprotocol
input parameters, respectively. If they are not defined in either format then the default values will be used to complete the URL.Default if only hostname is provided:
https://{hostname}
Type:
- string
Example
'http://localhost:8080'
-
<readonly, nullable> namespace :string
-
Default Kubernetes project namespace
This is used to restrict the scope of all methods to the given project. If defined, all of the client's methods will use this namespace as their project scope. Individual calls to an API endpoint may override this default by defining the
namespace
property of their request options. An empty namespace is equivalent to the global scope.Type:
- string
- Default Value:
-
- null
-
<readonly> requestOptions :object
-
Request options for API endpoints
These are passed directly to the request module and override the default configuration for every method. Consult the documentation for the
request
module (linked below) for information on valid properties for this object.The most common use case is to supply custom headers needed by your proxy or API server.
Type:
- object
- Default Value:
-
- {}
- See:
-
<readonly, nullable> timeout :number
-
Request timeout in milliseconds
Type:
- number
- Default Value:
-
- null
-
<nullable> token :string
-
oAuth token for authentication
If this is omitted and the
auth
property is set, then the credentials found inauth
will be used to request a new oAuth token from the API server automatically. Invalid or expired tokens will also be silently refreshed without an error being thrown for the first authentication failure.If the
auth
property is not defined then this token must be set manually for authentication of API requests.Type:
- string
- Default Value:
-
- null
-
<readonly, non-null> version :string
-
Kubernetes API version
If a number is provided, it is converted to a string and prepended with 'v' for compatibility with the Kubernetes API schema for API versions.
Type:
- string
Example
'v1'