Documentation ¶
Index ¶
- Constants
- Variables
- func FakeClientCommand(fc *FakeClientset) script.Cmd
- func NewFakeClientset() (*FakeClientset, Clientset)
- func NewFakeClientsetWithVersion(version string) (*FakeClientset, Clientset)
- type APIExtClientset
- type APIExtFakeClientset
- type CiliumClientset
- type CiliumFakeClientset
- type ClientBuilderFunc
- type ClientParams
- type Clientset
- type Config
- type FakeClientset
- func (c *FakeClientset) Config() Config
- func (c *FakeClientset) Disable()
- func (c *FakeClientset) Discovery() discovery.DiscoveryInterface
- func (cs *FakeClientset) GetCiliumNode(ctx context.Context, nodeName string) (*cilium_v2.CiliumNode, error)
- func (cs *FakeClientset) GetK8sNode(ctx context.Context, nodeName string) (*slim_corev1.Node, error)
- func (cs *FakeClientset) GetSecrets(ctx context.Context, ns, name string) (map[string][]byte, error)
- func (c *FakeClientset) IsEnabled() bool
- func (c *FakeClientset) RestConfig() *rest.Config
- func (c *FakeClientset) Slim() slim_clientset.Interface
- type Getters
- type KubernetesClientset
- type KubernetesFakeClientset
- type MCSAPIClientset
- type MCSAPIFakeClientset
- type SharedConfig
- type SlimClientset
- type SlimFakeClientset
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), )
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 FakeClientBuilderCell = cell.Provide(FakeClientBuilder)
var FakeClientCell = cell.Module( "k8s-fake-client", "Fake Kubernetes client", cell.Provide( NewFakeClientset, func(fc *FakeClientset) hive.ScriptCmdOut { return hive.NewScriptCmd("k8s", FakeClientCommand(fc)) }, ), )
Functions ¶
func FakeClientCommand ¶ added in v1.17.0
func FakeClientCommand(fc *FakeClientset) script.Cmd
func NewFakeClientset ¶
func NewFakeClientset() (*FakeClientset, Clientset)
func NewFakeClientsetWithVersion ¶ added in v1.17.0
func NewFakeClientsetWithVersion(version string) (*FakeClientset, Clientset)
Types ¶
type APIExtClientset ¶
type APIExtClientset = slim_apiext_clientset.Clientset
Type aliases for the clientsets to avoid name collision on 'Clientset' when composing them.
type APIExtFakeClientset ¶
type APIExtFakeClientset = apiext_fake.Clientset
type CiliumClientset ¶
type CiliumClientset = cilium_clientset.Clientset
Type aliases for the clientsets to avoid name collision on 'Clientset' when composing them.
type CiliumFakeClientset ¶
type CiliumFakeClientset = cilium_fake.Clientset
type ClientBuilderFunc ¶ added in v1.16.0
func FakeClientBuilder ¶ added in v1.16.0
func FakeClientBuilder() ClientBuilderFunc
func NewClientBuilder ¶ added in v1.16.0
func NewClientBuilder(lc cell.Lifecycle, log logrus.FieldLogger, cfg Config) 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 // Disable disables the client. Panics if called after the clientset has been // started. Disable() // 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 Config ¶
type Config struct { ClientParams }
func NewClientConfig ¶ added in v1.17.0
func NewClientConfig(cfg SharedConfig, params ClientParams) Config
type FakeClientset ¶
type FakeClientset struct { *MCSAPIFakeClientset *KubernetesFakeClientset *CiliumFakeClientset *APIExtFakeClientset SlimFakeClientset *SlimFakeClientset // contains filtered or unexported fields }
func (*FakeClientset) Config ¶
func (c *FakeClientset) Config() Config
func (*FakeClientset) Disable ¶
func (c *FakeClientset) Disable()
func (*FakeClientset) Discovery ¶
func (c *FakeClientset) Discovery() discovery.DiscoveryInterface
func (*FakeClientset) GetCiliumNode ¶
func (cs *FakeClientset) GetCiliumNode(ctx context.Context, nodeName string) (*cilium_v2.CiliumNode, error)
GetCiliumNode returns the CiliumNode with the given nodeName.
func (*FakeClientset) GetK8sNode ¶
func (cs *FakeClientset) GetK8sNode(ctx context.Context, nodeName string) (*slim_corev1.Node, error)
GetK8sNode returns the node with the given nodeName.
func (*FakeClientset) GetSecrets ¶
func (cs *FakeClientset) GetSecrets(ctx context.Context, ns, name string) (map[string][]byte, error)
GetSecrets returns the secrets found in the given namespace and name.
func (*FakeClientset) IsEnabled ¶
func (c *FakeClientset) IsEnabled() bool
func (*FakeClientset) RestConfig ¶
func (c *FakeClientset) RestConfig() *rest.Config
func (*FakeClientset) Slim ¶
func (c *FakeClientset) Slim() slim_clientset.Interface
type Getters ¶
type Getters interface { GetSecrets(ctx context.Context, namespace, name string) (map[string][]byte, error) GetK8sNode(ctx context.Context, nodeName string) (*slim_corev1.Node, error) GetCiliumNode(ctx context.Context, nodeName string) (*cilium_v2.CiliumNode, error) }
Getters is a set of methods for retrieving common objects.
type KubernetesClientset ¶
type KubernetesClientset = kubernetes.Clientset
Type aliases for the clientsets to avoid name collision on 'Clientset' when composing them.
type KubernetesFakeClientset ¶
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 MCSAPIFakeClientset ¶ added in v1.17.0
type MCSAPIFakeClientset = mcsapi_fake.Clientset
type SharedConfig ¶ added in v1.17.0
type SharedConfig struct { // operates with CNI-compatible orchestrators other than Kubernetes. Default to true. EnableK8s bool 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.
type SlimFakeClientset ¶
Directories ¶
Path | Synopsis |
---|---|
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
|
|