Documentation ¶
Index ¶
- func Contains(s []string, e string) bool
- func DropStringFromSlice(s string, ss []string) []string
- func ExtractHostnamesFromKubernetesIngresses(ingresses []networking.Ingress) (aliases []string)
- func ExtractUserDefinedAliasesFromNode(nodeCurrentAliases []string, clusterDefinedAliases []string) (userAliases []string)
- func FilterMasterNodes(nodesList []v1Type.Node) (filtered []v1Type.Node)
- func FilterNodesByConditionTypeValue(nodesList []v1Type.Node, key string, values []string) (filtered []v1Type.Node)
- func GenerateFQDNAliasString(aliases []string, postfix string) string
- func GetKubernetesClientset() (*kubernetes.Clientset, error)
- func RemoveDuplicatesFromSlice(s []string) []string
- func SetWebhookCABundle(webhookName string, clientset *kubernetes.Clientset, certPEM []byte) error
- func ShuffleSlice(sliceP []v1Type.Node)
- type BlockStorageOpts
- type Config
- type LandbSync
- func (d *LandbSync) AddLabelToNode(node v1Type.Node, key string, value string) (err error)
- func (d *LandbSync) DeleteLabelFromNode(node v1Type.Node, key string) (err error)
- func (d *LandbSync) DeleteOpenstackPropertyByNodeUUID(property string, nodeUUID string) (err error)
- func (d *LandbSync) DismissIngressNode(node v1Type.Node) (err error)
- func (d *LandbSync) DropUnhealthyNodesFromIngressRole(cluster *stateData)
- func (d *LandbSync) GetOpenstackPropertyByNodeUUID(property string, nodesUUID []string) (serversMetadatum []map[string]string, err error)
- func (d *LandbSync) Init()
- func (d *LandbSync) RegisterIngressWatcher(stop <-chan int)
- func (d *LandbSync) SetOpenstackPropertyByNodeUUID(cluster *stateData, property string, value string, nodeUUID string) (err error)
- func (d *LandbSync) UpdateIngressAlias(cluster *stateData) (err error)
- func (d *LandbSync) UpdateIngressAliasFromList(cluster *stateData, kubernetesAliases []string, ...) (err error)
- func (d *LandbSync) UpdateIngressNodes(cluster *stateData) (err error)
- func (d *LandbSync) UpdateNodesLandbSet(cluster *stateData, setAllNodes bool) (err error)
- func (d *LandbSync) UpdateStateMachine() (err error)
- type LoadBalancer
- type LoadBalancerOpts
- type MetadataOpts
- type MyDuration
- type NodesL
- type RouterOpts
- type WebhookServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropStringFromSlice ¶
DropStringFromSlice drops string (s) from a string slice (ss)
func ExtractHostnamesFromKubernetesIngresses ¶
func ExtractHostnamesFromKubernetesIngresses(ingresses []networking.Ingress) (aliases []string)
ExtractHostnamesFromKubernetesIngresses will get a []string list with all the aliases defined by the ingress input
func ExtractUserDefinedAliasesFromNode ¶
func ExtractUserDefinedAliasesFromNode(nodeCurrentAliases []string, clusterDefinedAliases []string) (userAliases []string)
ExtractUserDefinedAliasesFromNode will get all the user defined aliases from the node
func FilterMasterNodes ¶
FilterMasterNodes will filter out all the master nodes from the slice
func FilterNodesByConditionTypeValue ¶
func FilterNodesByConditionTypeValue(nodesList []v1Type.Node, key string, values []string) (filtered []v1Type.Node)
FilterNodesByConditionTypeValue will filter the specified []Node by the defined key:value Node.Condition. It will return a []Node with the corresponding Nodes filtered in this way
func GenerateFQDNAliasString ¶
GenerateFQDNAliasString will append and then concatenate the hostnames for landb commit
func GetKubernetesClientset ¶
func GetKubernetesClientset() (*kubernetes.Clientset, error)
GetKubernetesClientset get kubernetes configuration and generates client handle
func RemoveDuplicatesFromSlice ¶
RemoveDuplicatesFromSlice Deduplicates strings on a slice
func SetWebhookCABundle ¶
func SetWebhookCABundle(webhookName string, clientset *kubernetes.Clientset, certPEM []byte) error
SetWebhookCABundle updates a validating webhook configuration, setting the client config CABundle with the contents of certPEM.
func ShuffleSlice ¶
ShuffleSlice Shuffles the elements of the slice len(slice) number of times
Types ¶
type BlockStorageOpts ¶
type BlockStorageOpts struct { BSVersion string `gcfg:"bs-version"` // overrides autodetection. v1 or v2. Defaults to auto TrustDevicePath bool `gcfg:"trust-device-path"` // See Issue #33128 IgnoreVolumeAZ bool `gcfg:"ignore-volume-az"` NodeVolumeAttachLimit int `gcfg:"node-volume-attach-limit"` // override volume attach limit for Cinder. Default is : 256 }
BlockStorageOpts is used to talk to Cinder service
type Config ¶
type Config struct { Global struct { AuthURL string `gcfg:"auth-url"` Username string UserID string `gcfg:"user-id"` Password string TenantID string `gcfg:"tenant-id"` TenantName string `gcfg:"tenant-name"` TrustID string `gcfg:"trust-id"` DomainID string `gcfg:"domain-id"` DomainName string `gcfg:"domain-name"` Region string CAFile string `gcfg:"ca-file"` SecretName string `gcfg:"secret-name"` SecretNamespace string `gcfg:"secret-namespace"` KubeconfigPath string `gcfg:"kubeconfig-path"` } LoadBalancer LoadBalancerOpts BlockStorage BlockStorageOpts Route RouterOpts Metadata MetadataOpts }
Config is used to read and store information from the cloud configuration file
type LandbSync ¶
type LandbSync struct { // LandbAliasEnabled defines if landb-sync should manage registration of alias LandbAliasEnabled bool // LandbSetEnabled defines if landb-sync should manage registration of ingress nodes into the landb-set LandbSetEnabled bool // LandbSetName defines the name to be used for the landb-set when managing this property LandbSetName string // NumIngressNodes is the number of ingress instances to be kept active NumIngressNodes int // Allow ingress to be created if the existent landb-alias references self ServerBypassCernDNS bool // StateCheckPeriod is the interval between syncs StateCheckPeriod time.Duration // CloudConfig is the location of the openstack cloud config CloudConfig string // contains filtered or unexported fields }
LandbSync stores the OS and Kubernetes conn handles and options
func (*LandbSync) AddLabelToNode ¶
AddLabelToNode will add the specified key:value to the Node.metadata.Labels
func (*LandbSync) DeleteLabelFromNode ¶
DeleteLabelFromNode will delete the specified key from Node.metadata.Labels
func (*LandbSync) DeleteOpenstackPropertyByNodeUUID ¶
DeleteOpenstackPropertyByNodeUUID will delete the property from the node metadata using node uuid
func (*LandbSync) DismissIngressNode ¶
DismissIngressNode will delete label role=ingress and landb-alias property from node
func (*LandbSync) DropUnhealthyNodesFromIngressRole ¶
func (d *LandbSync) DropUnhealthyNodesFromIngressRole(cluster *stateData)
DropUnhealthyNodesFromIngressRole will remove all not healthy nodes from role ingress
func (*LandbSync) GetOpenstackPropertyByNodeUUID ¶
func (d *LandbSync) GetOpenstackPropertyByNodeUUID(property string, nodesUUID []string) (serversMetadatum []map[string]string, err error)
GetOpenstackPropertyByNodeUUID will get OS data from the nodesUUID list and return a Metadatum object list in the same order
func (*LandbSync) Init ¶
func (d *LandbSync) Init()
Init sets all the required clients to talk to openstack
func (*LandbSync) RegisterIngressWatcher ¶
RegisterIngressWatcher will create the Ingress Watcher and map the functions the triggers of the Create/Update/Delete operations
func (*LandbSync) SetOpenstackPropertyByNodeUUID ¶
func (d *LandbSync) SetOpenstackPropertyByNodeUUID(cluster *stateData, property string, value string, nodeUUID string) (err error)
SetOpenstackPropertyByNodeUUID sets the metadata property:value on the server uuid
func (*LandbSync) UpdateIngressAlias ¶
UpdateIngressAlias will manage the attribution of the kubernetes cluster defined ingresses to the available Ingress Nodes.
func (*LandbSync) UpdateIngressAliasFromList ¶
func (d *LandbSync) UpdateIngressAliasFromList(cluster *stateData, kubernetesAliases []string, kubernetesDeletedAliases []string) (err error)
UpdateIngressAliasFromList will manage the attribution of the kubernetes cluster defined ingresses to the available Ingress Nodes.
func (*LandbSync) UpdateIngressNodes ¶
UpdateIngressNodes will add or remove Ingress Nodes to meet the desired capacity
func (*LandbSync) UpdateNodesLandbSet ¶
UpdateNodesLandbSet will update the landb-set of all the cluster nodes
func (*LandbSync) UpdateStateMachine ¶
UpdateStateMachine refreshes the state machine
type LoadBalancer ¶
type LoadBalancer struct { }
LoadBalancer is used for creating and maintaining load balancers
type LoadBalancerOpts ¶
type LoadBalancerOpts struct { LBVersion string `gcfg:"lb-version"` // overrides autodetection. Only support v2. UseOctavia bool `gcfg:"use-octavia"` // uses Octavia V2 service catalog endpoint SubnetID string `gcfg:"subnet-id"` // overrides autodetection. FloatingNetworkID string `gcfg:"floating-network-id"` // If specified, will create floating ip for loadbalancer, or do not create floating ip. LBMethod string `gcfg:"lb-method"` // default to ROUND_ROBIN. LBProvider string `gcfg:"lb-provider"` CreateMonitor bool `gcfg:"create-monitor"` MonitorDelay MyDuration `gcfg:"monitor-delay"` MonitorTimeout MyDuration `gcfg:"monitor-timeout"` MonitorMaxRetries uint `gcfg:"monitor-max-retries"` ManageSecurityGroups bool `gcfg:"manage-security-groups"` NodeSecurityGroupIDs []string // Do not specify, get it automatically when enable manage-security-groups. TODO(FengyunPan): move it into cache }
LoadBalancerOpts have the options to talk to Neutron LBaaSV2 or Octavia
type MetadataOpts ¶
type MetadataOpts struct { SearchOrder string `gcfg:"search-order"` RequestTimeout MyDuration `gcfg:"request-timeout"` }
MetadataOpts is used for configuring how to talk to metadata service or config drive
type MyDuration ¶
MyDuration is the encoding.TextUnmarshaler interface for time.Duration
func (*MyDuration) UnmarshalText ¶
func (d *MyDuration) UnmarshalText(text []byte) error
UnmarshalText is used to convert from text to Duration
type RouterOpts ¶
type RouterOpts struct {
RouterID string `gcfg:"router-id"` // required
}
RouterOpts is used for Neutron routes
type WebhookServer ¶
WebhookServer is the server object where handles are registered into
func (*WebhookServer) Serve ¶
func (whsvr *WebhookServer) Serve(w http.ResponseWriter, r *http.Request)
Serve method for webhook server