Documentation
¶
Index ¶
- Constants
- Variables
- type APIExtClientset
- type CiliumClientset
- type ClientBuilderFunc
- type ClientParams
- type Clientset
- type ClientsetGetters
- type Config
- type ConfigureK8sClientsetDialer
- type Getters
- type K8sServiceEndpointMapping
- type KubernetesClientset
- type MCSAPIClientset
- type SharedConfig
- type SlimClientset
Constants ¶
const OptUserAgent = "user-agent"
Variables ¶
var Cell = cell.Module( "k8s-client", "Kubernetes Client", cell.Config(defaultSharedConfig), cell.Config(defaultClientParams), cell.Provide(NewClientConfig), cell.Provide(newClientset), cell.Invoke(registerMappingsUpdater), )
client.Cell provides Clientset, a composition of clientsets to Kubernetes resources used by Cilium.
var ClientBuilderCell = cell.Module( "k8s-client-builder", "Kubernetes Client Builder", cell.Config(defaultSharedConfig), cell.Provide(NewClientConfig), cell.Provide(NewClientBuilder), )
client.ClientBuilderCell provides a function to create a new composite Clientset, allowing a controller to use its own Clientset with a different user agent.
var ( // K8sAPIServerFilePath is the file path for storing kube-apiserver service and // endpoints for high availability failover. K8sAPIServerFilePath = filepath.Join(option.Config.StateDir, "k8sapi_server_state.json") )
Functions ¶
This section is empty.
Types ¶
type APIExtClientset ¶
type APIExtClientset = slim_apiext_clientset.Clientset
Type aliases for the clientsets to avoid name collision on 'Clientset' when composing them.
type CiliumClientset ¶
type CiliumClientset = cilium_clientset.Clientset
Type aliases for the clientsets to avoid name collision on 'Clientset' when composing them.
type ClientBuilderFunc ¶ added in v1.16.0
func NewClientBuilder ¶ added in v1.16.0
func NewClientBuilder(params compositeClientsetParams) ClientBuilderFunc
NewClientBuilder returns a function that creates a new Clientset with the given name appended to the user agent, or returns an error if the Clientset cannot be created.
type ClientParams ¶ added in v1.17.0
type ClientParams struct {
// K8sClientQPS is the queries per second limit for the K8s client. Defaults to k8s client defaults.
K8sClientQPS float32
// K8sClientBurst is the burst value allowed for the K8s client. Defaults to k8s client defaults.
K8sClientBurst int
}
func (ClientParams) Flags ¶ added in v1.17.0
func (def ClientParams) Flags(flags *pflag.FlagSet)
type Clientset ¶
type Clientset interface {
mcsapi_clientset.Interface
kubernetes.Interface
apiext_clientset.Interface
cilium_clientset.Interface
Getters
// Slim returns the slim client, which contains some of the same APIs as the
// normal kubernetes client, but with slimmed down messages to reduce memory
// usage. Prefer the slim version when caching messages.
Slim() slim_clientset.Interface
// IsEnabled returns true if Kubernetes support is enabled and the
// clientset can be used.
IsEnabled() bool
// Config returns the configuration used to create this client.
Config() Config
// RestConfig returns the deep copy of rest configuration.
RestConfig() *rest.Config
}
Clientset is a composition of the different client sets used by Cilium.
type ClientsetGetters ¶ added in v1.18.0
type ClientsetGetters struct {
Clientset
}
ClientsetGetters implements the Getters interface in terms of the clientset.
func (*ClientsetGetters) GetSecrets ¶ added in v1.18.0
func (cs *ClientsetGetters) GetSecrets(ctx context.Context, ns, name string) (map[string][]byte, error)
GetSecrets returns the secrets found in the given namespace and name.
type Config ¶
type Config struct {
ClientParams
}
func NewClientConfig ¶ added in v1.17.0
func NewClientConfig(cfg SharedConfig, params ClientParams) Config
type ConfigureK8sClientsetDialer ¶ added in v1.19.0
ConfigureK8sClientsetDialer provides an optional extension point to configure the dialer used by the clientset.
type Getters ¶
type Getters interface {
GetSecrets(ctx context.Context, namespace, name string) (map[string][]byte, error)
}
Getters is a set of methods for retrieving common objects.
type K8sServiceEndpointMapping ¶ added in v1.18.0
type K8sServiceEndpointMapping struct {
Service string `json:"service"`
Endpoints []string `json:"endpoints"`
}
func (K8sServiceEndpointMapping) Equal ¶ added in v1.18.0
func (m K8sServiceEndpointMapping) Equal(other K8sServiceEndpointMapping) bool
type KubernetesClientset ¶
type KubernetesClientset = kubernetes.Clientset
Type aliases for the clientsets to avoid name collision on 'Clientset' when composing them.
type MCSAPIClientset ¶ added in v1.17.0
type MCSAPIClientset = mcsapi_clientset.Clientset
Type aliases for the clientsets to avoid name collision on 'Clientset' when composing them.
type SharedConfig ¶ added in v1.17.0
type SharedConfig struct {
// operates with CNI-compatible orchestrators other than Kubernetes. Default to true.
EnableK8s bool
K8sAPIServerURLs []string
K8sAPIServer string
K8sKubeConfigPath string
K8sClientConnectionTimeout time.Duration
K8sClientConnectionKeepAlive time.Duration
K8sHeartbeatTimeout time.Duration
EnableK8sAPIDiscovery bool
}
func (SharedConfig) Flags ¶ added in v1.17.0
func (def SharedConfig) Flags(flags *pflag.FlagSet)
type SlimClientset ¶
type SlimClientset = slim_clientset.Clientset
Type aliases for the clientsets to avoid name collision on 'Clientset' when composing them.
Directories
¶
| Path | Synopsis |
|---|---|
|
applyconfiguration
|
|
|
clientset
|
|
|
versioned/fake
This package has the automatically generated fake clientset.
|
This package has the automatically generated fake clientset. |
|
versioned/scheme
This package contains the scheme of the automatically generated clientset.
|
This package contains the scheme of the automatically generated clientset. |
|
versioned/typed/cilium.io/v2
This package has the automatically generated typed clients.
|
This package has the automatically generated typed clients. |
|
versioned/typed/cilium.io/v2/fake
Package fake has the automatically generated clients.
|
Package fake has the automatically generated clients. |
|
versioned/typed/cilium.io/v2alpha1
This package has the automatically generated typed clients.
|
This package has the automatically generated typed clients. |
|
versioned/typed/cilium.io/v2alpha1/fake
Package fake has the automatically generated clients.
|
Package fake has the automatically generated clients. |
|
informers
|
|
|
listers
|
|