Documentation
¶
Index ¶
- func AddIgnoreUnknownArgs() error
- func ConfigureLogging(logLevel string)
- func CreateClient(conf NetConf) (*client.Client, error)
- func CreateContextLogger(workloadID string) *log.Entry
- func CreateResultFromEndpoint(ep *api.WorkloadEndpoint) (*types.Result, error)
- func DoNetworking(args *skel.CmdArgs, conf NetConf, res *types.Result, logger *log.Entry) (hostVethName, contVethMAC string, err error)
- func GetIdentifiers(args *skel.CmdArgs) (workloadID string, orchestratorID string, err error)
- func PopulateEndpointNets(endpoint *api.WorkloadEndpoint, result *types.Result) error
- func ReleaseIPAllocation(logger *log.Entry, ipamType string, stdinData []byte)
- func ValidateNetworkName(name string) error
- type Args
- type K8sArgs
- type Kubernetes
- type Mesos
- type NetConf
- type NetworkInfo
- type Policy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddIgnoreUnknownArgs ¶
func AddIgnoreUnknownArgs() error
AddIgnoreUnknownArgs appends the 'IgnoreUnknown=1' option to CNI_ARGS before calling the IPAM plugin. Otherwise, it will complain about the Kubernetes arguments. See https://github.com/kubernetes/kubernetes/pull/24983
func ConfigureLogging ¶
func ConfigureLogging(logLevel string)
Set up logging for both Calico and libcalico usng the provided log level,
func CreateContextLogger ¶
Create a logger which always includes common fields
func CreateResultFromEndpoint ¶
func CreateResultFromEndpoint(ep *api.WorkloadEndpoint) (*types.Result, error)
func DoNetworking ¶
func DoNetworking(args *skel.CmdArgs, conf NetConf, res *types.Result, logger *log.Entry) (hostVethName, contVethMAC string, err error)
DoNetworking performs the networking for the given config and IPAM result
func GetIdentifiers ¶
func PopulateEndpointNets ¶
func PopulateEndpointNets(endpoint *api.WorkloadEndpoint, result *types.Result) error
func ReleaseIPAllocation ¶
ReleaseIPAM is called to cleanup IPAM allocations if something goes wrong during CNI ADD execution.
func ValidateNetworkName ¶
ValidateNetworkName checks that the network name meets felix's expectations
Types ¶
type K8sArgs ¶
type K8sArgs struct {
types.CommonArgs
IP net.IP
K8S_POD_NAME types.UnmarshallableString
K8S_POD_NAMESPACE types.UnmarshallableString
K8S_POD_INFRA_CONTAINER_ID types.UnmarshallableString
}
K8sArgs is the valid CNI_ARGS used for Kubernetes
type Kubernetes ¶
type Kubernetes struct {
K8sAPIRoot string `json:"k8s_api_root"`
Kubeconfig string `json:"kubeconfig"`
NodeName string `json:"node_name"`
}
Kubernetes a K8s specific struct to hold config
type Mesos ¶
type Mesos struct {
NetworkInfo NetworkInfo `json:"network_info"`
}
type NetConf ¶
type NetConf struct {
Name string `json:"name"`
Type string `json:"type"`
IPAM struct {
Name string
Type string `json:"type"`
Subnet string `json:"subnet"`
AssignIpv4 *string `json:"assign_ipv4"`
AssignIpv6 *string `json:"assign_ipv6"`
} `json:"ipam,omitempty"`
MTU int `json:"mtu"`
Hostname string `json:"hostname"`
EtcdAuthority string `json:"etcd_authority"`
EtcdEndpoints string `json:"etcd_endpoints"`
LogLevel string `json:"log_level"`
Policy Policy `json:"policy"`
Kubernetes Kubernetes `json:"kubernetes"`
Args Args `json:"args"`
EtcdScheme string `json:"etcd_scheme"`
EtcdKeyFile string `json:"etcd_key_file"`
EtcdCertFile string `json:"etcd_cert_file"`
EtcdCaCertFile string `json:"etcd_ca_cert_file"`
}
NetConf stores the common network config for Calico CNI plugin
type NetworkInfo ¶
type Policy ¶
type Policy struct {
PolicyType string `json:"type"`
K8sAPIRoot string `json:"k8s_api_root"`
K8sAuthToken string `json:"k8s_auth_token"`
K8sClientCertificate string `json:"k8s_client_certificate"`
K8sClientKey string `json:"k8s_client_key"`
K8sCertificateAuthority string `json:"k8s_certificate_authority"`
}
Policy is a struct to hold policy config (which currently happens to also contain some K8s config)