Documentation ¶
Overview ¶
Package plugin implements fsm cni plugin.
Package plugin implements ecnet cni plugin.
Index ¶
- Constants
- Variables
- func BuildClientCmd(kubeconfig, context string, overrides ...func(*clientcmd.ConfigOverrides)) clientcmd.ClientConfig
- func BuildClientConfig(kubeconfig, context string) (*rest.Config, error)
- func CmdAdd(args *skel.CmdArgs) error
- func CmdCheck(*skel.CmdArgs) (err error)
- func CmdDelete(args *skel.CmdArgs) error
- func DefaultRestConfig(kubeconfig, configContext string, fns ...func(*rest.Config)) (*rest.Config, error)
- func SetRestDefaults(config *rest.Config) *rest.Config
- type Config
- type K8sArgs
- type Kubernetes
Constants ¶
const (
// SidecarInjectionAnnotation is the annotation used for sidecar injection
SidecarInjectionAnnotation = "flomesh.io/sidecar-injection"
)
Variables ¶
var (
// KubeScheme returns a scheme will all known related types added
KubeScheme = kubeScheme()
)
Functions ¶
func BuildClientCmd ¶
func BuildClientCmd(kubeconfig, context string, overrides ...func(*clientcmd.ConfigOverrides)) clientcmd.ClientConfig
BuildClientCmd builds a client cmd config from a kubeconfig filepath and context. It overrides the current context with the one provided (empty to use default).
This is a modified version of k8s.io/client-go/tools/clientcmd/BuildConfigFromFlags with the difference that it loads default configs if not running in-cluster.
func BuildClientConfig ¶
BuildClientConfig builds a client rest config from a kubeconfig filepath and context. It overrides the current context with the one provided (empty to use default).
This is a modified version of k8s.io/client-go/tools/clientcmd/BuildConfigFromFlags with the difference that it loads default configs if not running in-cluster.
Types ¶
type Config ¶
type Config struct { types.NetConf // You may wish to not nest this type RuntimeConfig *struct { } `json:"runtimeConfig"` // This is the previous result, when called in the context of a chained // plugin. Because this plugin supports multiple versions, we'll have to // parse this in two passes. If your plugin is not chained, this can be // removed (though you may wish to error if a non-chainable plugin is // chained. // If you need to modify the result before returning it, you will need // to actually convert it to a concrete versioned struct. RawPrevResult *map[string]any `json:"prevResult"` PrevResult *cniv1.Result `json:"-"` // Add plugin-specific flags here LogLevel string `json:"log_level"` LogUDSAddress string `json:"log_uds_address"` Kubernetes Kubernetes `json:"kubernetes"` HostNSEnterExec bool `json:"hostNSEnterExec"` }
Config is whatever you expect your configuration json to be. This is whatever is passed in on stdin. Your plugin may wish to expose its functionality via runtime args, see CONVENTIONS.md in the CNI spec.
type K8sArgs ¶
type K8sArgs struct { types.CommonArgs IP net.IP K8S_POD_NAME types.UnmarshallableString // nolint: revive, stylecheck K8S_POD_NAMESPACE types.UnmarshallableString // nolint: revive, stylecheck K8S_POD_INFRA_CONTAINER_ID types.UnmarshallableString // nolint: revive, stylecheck }
K8sArgs is the valid CNI_ARGS used for Kubernetes The field names need to match exact keys in kubelet args for unmarshalling
type Kubernetes ¶
type Kubernetes struct { K8sAPIRoot string `json:"k8s_api_root"` Kubeconfig string `json:"kubeconfig"` InterceptRuleMgrType string `json:"intercept_type"` NodeName string `json:"node_name"` ExcludeNamespaces []string `json:"exclude_namespaces"` CNIBinDir string `json:"cni_bin_dir"` }
Kubernetes a K8s specific struct to hold config