kubeclient

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package kubeclient implement the kube client for the applications that use the API Server of kubernetes

Index

Constants

View Source
const (
	Profile = "kubeclient"
)
View Source
const (
	Subject = "subject"
)

Variables

This section is empty.

Functions

func GetClusterConfig added in v1.2.0

func GetClusterConfig(clusterName string, token *oidc.Token, prop *Properties) (clusterConfig *kubeconfig.ClusterConfig)

func NewKubeClient added in v1.2.0

func NewKubeClient(scheme *runtime.Scheme, cfg *RestConfig) (k8sClient client.Client, err error)

NewKubeClient new kube client

func NewRuntimeKubeClient added in v1.2.0

func NewRuntimeKubeClient(scheme *runtime.Scheme, token *oidc.Token, useToken bool, properties *Properties, cluster *kubeconfig.ClusterConfig) (cli client.Client, err error)

NewRuntimeKubeClient new runtime kube client

Types

type Client

type Client struct {
	at.Scope `value:"prototype"`

	client.Client
}

Client is the encapsulation of the default kube client

type ClientCreation added in v1.2.0

type ClientCreation struct {
	at.Scope `value:"prototype"`

	client.Client
}

ClientCreation is the encapsulation of the default kube client

type Properties added in v1.1.2

type Properties struct {
	at.ConfigurationProperties `value:"kubeclient"`
	at.AutoWired

	// operator deployment namespace
	Namespace string `json:"namespace" default:"kube-system"`

	// use DefaultInCluster as default
	// Deprecated
	DefaultInCluster *bool `json:"defaultInCluster"`

	//OIDC Scope Impersonate
	OIDCScope string `json:"oidcScope"`

	QPS float32 `json:"qps"`

	// Maximum burst for throttle.
	// If it's zero, the created RESTClient will use DefaultBurst: 10.
	Burst int `json:"burst"`

	// The maximum length of time to wait before giving up on a server request. A value of zero means no timeout.
	Timeout time.Duration `json:"timeout"`

	// Use default cluster selector
	DefaultClusterSelector bool `json:"defaultClusterSelector"`

	// the default kube config in base64
	Clusters map[string]kubeconfig.ClusterInfo `json:"clusters"`
}

Properties the operator properties

type RestConfig added in v1.2.0

type RestConfig struct {
	at.Scope `value:"prototype"`

	*rest.Config
}

type RuntimeClient added in v1.1.2

type RuntimeClient struct {
	at.Scope `value:"prototype"`

	client.Client

	Context context.Context `json:"context"`
}

RuntimeClient is the client the runtime kube client

type RuntimeClientCreation added in v1.2.0

type RuntimeClientCreation struct {
	at.Scope `value:"prototype"`

	client.Client

	Context context.Context `json:"context"`
}

RuntimeClientCreation is the client the runtime kube client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL