Documentation ¶
Overview ¶
* Copyright (c) 2023 Baidu, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions * and limitations under the License. *
Index ¶
- Constants
- Variables
- func Execute()
- func NewDeleteENIHandler(d *Daemon) eniapi.DeleteEniHandler
- func NewDeleteIPAMIPHandler(d *Daemon) ipamapi.DeleteIpamIPHandler
- func NewGetEndpointExtpluginStatusHandler(d *Daemon) endpointapi.GetEndpointExtpluginStatusHandler
- func NewGetMetricsHandler(d *Daemon) restapi.GetMetricsHandler
- func NewPostEniHandler(d *Daemon) eniapi.PostEniHandler
- func NewPostIPAMHandler(d *Daemon) ipamapi.PostIpamHandler
- func NewPostIPAMIPHandler(d *Daemon) ipamapi.PostIpamIPHandler
- func NewPutEndpointProbeHandler(d *Daemon) endpointapi.PutEndpointProbeHandler
- type Daemon
Constants ¶
const ( // AutoCIDR indicates that a CIDR should be allocated AutoCIDR = "auto" // ConfigModifyQueueSize is the size of the event queue for serializing // configuration updates to the daemon ConfigModifyQueueSize = 10 )
Variables ¶
var ( // RootCmd represents the base command when called without any subcommands RootCmd = &cobra.Command{ Use: "agent", Short: "Run the cce ipam v2 agent", Run: func(cmd *cobra.Command, args []string) { cmdRefDir := viper.GetString(option.CMDRef) if cmdRefDir != "" { genMarkdown(cmd, cmdRefDir) os.Exit(0) } addr := fmt.Sprintf("127.0.0.1:%d", viper.GetInt(option.GopsPort)) addrField := logrus.Fields{"address": addr} if err := gops.Listen(gops.Options{ Addr: addr, ReuseSocketAddrAndPort: true, }); err != nil { log.WithError(err).WithFields(addrField).Fatal("Cannot start gops server") } log.WithFields(addrField).Info("Started gops server") bootstrapStats.earlyInit.Start() initEnv(cmd) bootstrapStats.earlyInit.End(true) runDaemon() }, } )
Functions ¶
func Execute ¶
func Execute()
Execute sets up gops, installs the cleanup signal handler and invokes the root command. This function only returns when an interrupt signal has been received. This is intended to be called by main.main().
func NewDeleteENIHandler ¶
func NewDeleteENIHandler(d *Daemon) eniapi.DeleteEniHandler
NewDeleteENIHandler handle incoming requests to delete addresses.
func NewDeleteIPAMIPHandler ¶
func NewDeleteIPAMIPHandler(d *Daemon) ipamapi.DeleteIpamIPHandler
NewDeleteIPAMIPHandler handle incoming requests to delete addresses.
func NewGetEndpointExtpluginStatusHandler ¶
func NewGetEndpointExtpluginStatusHandler(d *Daemon) endpointapi.GetEndpointExtpluginStatusHandler
NewGetEndpointExtpluginStatusHandler creates a new getEndpointExtpluginStatus from the daemon.
func NewGetMetricsHandler ¶
func NewGetMetricsHandler(d *Daemon) restapi.GetMetricsHandler
NewGetMetricsHandler returns the metrics handler
func NewPostEniHandler ¶
func NewPostEniHandler(d *Daemon) eniapi.PostEniHandler
NewPostEniHandler creates a new postENI from the daemon.
func NewPostIPAMHandler ¶
func NewPostIPAMHandler(d *Daemon) ipamapi.PostIpamHandler
NewPostIPAMHandler creates a new postIPAM from the daemon.
func NewPostIPAMIPHandler ¶
func NewPostIPAMIPHandler(d *Daemon) ipamapi.PostIpamIPHandler
NewPostIPAMIPHandler creates a new postIPAM from the daemon.
func NewPutEndpointProbeHandler ¶
func NewPutEndpointProbeHandler(d *Daemon) endpointapi.PutEndpointProbeHandler
NewGetEndpointExtpluginStatusHandler creates a new getEndpointExtpluginStatus from the daemon.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is the cce daemon that is in charge of perform all necessary plumbing, monitoring when a LXC starts.
func (*Daemon) DebugEnabled ¶
DebugEnabled returns if debug mode is enabled.
func (*Daemon) DumpIPAM ¶
func (d *Daemon) DumpIPAM() *models.IPAMStatus
DumpIPAM dumps in the form of a map, the list of reserved IPv4 and IPv6 addresses.
func (*Daemon) GetCompilationLock ¶
GetCompilationLock returns the mutex responsible for synchronizing compilation of BPF programs.
func (*Daemon) GetNodeSuffix ¶
GetNodeSuffix returns the suffix to be appended to kvstore keys of this agent
func (*Daemon) GetOptions ¶
func (d *Daemon) GetOptions() *option.IntOptions
GetOptions returns the datapath configuration options of the daemon.
func (*Daemon) K8sCacheIsSynced ¶
K8sCacheIsSynced returns true if the agent has fully synced its k8s cache with the API server