Versions in this module Expand all Collapse all v1 v1.2.5 Sep 23, 2024 Changes in this version + const IP6TablesBin + const IP6TablesPersistCmd + const IP6TablesSaveBin + const IPTablesBin + const IPTablesPersistCmd + const IPTablesSaveBin + const IndexIPV4 + const IndexIPV6 + const ManifestTypeCommand + const NetplanFileNotFound + const NumIPTypes + const RemoteCidrAll + const RemoteCidrAllIPV6 + const RemoteCidrNone + const TrustPolicySecGrpNameLabel + var ClientVersion = "SSH-2.0-mobiledgex-ssh-client-1.0" + var CloudletPlatformActive = "CloudletPlatformActive" + var DefaultConnectTimeout time.Duration = 30 * time.Second + var DefaultMetalLbNamespace = "metallb-system" + var DestIPUnspecified = IPs + var InfraCommonProps = map[string]*edgeproto.PropertyInfo + var MetalLbAddressPool = ... + var NoDnsOverride = "" + var SSHOpts = []string + var SSHUser = "ubuntu" + func AddDefaultIptablesRules(ctx context.Context, client ssh.Client, ipversion IPVersion) error + func AddIngressIptablesRules(ctx context.Context, client ssh.Client, label string, cidrs, destIp IPs, ...) error + func AddIptablesRules(ctx context.Context, client ssh.Client, label string, rules *FirewallRules) error + func BackupKubeconfig(ctx context.Context, client ssh.Client) + func ConfigureMetalLb(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst, ...) error + func CopyFile(src string, dst string) error + func CopyKubeConfig(ctx context.Context, rootLBClient ssh.Client, ...) error + func CreateCloudletNode(ctx context.Context, config *confignode.ConfigureNodeVars, ...) error + func CreateClusterConfigMap(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst) error + func CreateDockerRegistrySecret(ctx context.Context, client ssh.Client, kconf string, imagePath string, ...) error + func DefaultKubeconfig() string + func DeleteDataFromVault(config *vault.Config, path string) error + func DeleteDockerRegistrySecret(ctx context.Context, client ssh.Client, kconf string, imagePath string, ...) error + func DeleteIptablesRules(ctx context.Context, client ssh.Client, label string, rules *FirewallRules) error + func DoIptablesCommand(ctx context.Context, client ssh.Client, rule string, ruleExists bool, ...) error + func ExecTemplate(templateName, templateString string, templateData interface{}) (*bytes.Buffer, error) + func FormatDuration(dur time.Duration, digIdx int) string + func GenerateNetworkFileDetailsForIP(ctx context.Context, portName string, ifName string, ipAddr string, ...) (string, string, string, error) + func GetAppWhitelistRulesLabel(app *edgeproto.App) string + func GetDockerCrtFile(crtFilePath string) (string, error) + func GetEnvVarsFromVault(ctx context.Context, config *vault.Config, path string) (map[string]string, error) + func GetHTTPFile(ctx context.Context, uri string) ([]byte, error) + func GetMacAddrToInterfaceNames(ctx context.Context, client ssh.Client) (map[string]string, map[string]string, error) + func GetNetplanFilename(portName string) string + func GetPlatformConfig(cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, ...) *pf.PlatformConfig + func GetReqErr(reqBody io.ReadCloser) error + func GetServerSecurityGroupName(serverName string) string + func GetSvcExternalIpOrHost(ctx context.Context, client ssh.Client, kubeNames *k8smgmt.KubeNames, ...) (string, string, error) + func GetUniqueLoopbackIp(ctx context.Context, ports []dme.AppPort) string + func GetUrlInfo(ctx context.Context, accessApi platform.AccessApi, fileUrlPath string) (time.Time, string, error) + func GetVaultCloudletCommonPath(filePath string) string + func GetVaultDataString(ctx context.Context, config *vault.Config, path string) ([]byte, error) + func GetVaultDataToFile(config *vault.Config, path, fileName string) error + func HandlePlatformSwitchToActive(ctx context.Context, cloudletKey *edgeproto.CloudletKey, caches *pf.Caches, ...) + func IPIndexOf(ipType IPVersion) int + func IncrIP(ip net.IP) + func InstallAndConfigMetalLbIfNotInstalled(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst, ...) error + func InstallMetalLb(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst) error + func InternEnv(envs map[string]string) error + func IsMetalLbInstalled(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst, ...) (bool, error) + func KubePatchServiceIP(ctx context.Context, client ssh.Client, kubeNames *k8smgmt.KubeNames, ...) error + func ParseIpRanges(ipranges string) ([]string, error) + func PersistIptablesRules(ctx context.Context, client ssh.Client, ipversion IPVersion) error + func PutDataToVault(config *vault.Config, path string, data map[string]interface{}) error + func RemoveIngressIptablesRules(ctx context.Context, client ssh.Client, label string, cidrs, destIP IPs, ...) error + func RemoveRulesForLabel(ctx context.Context, client ssh.Client, label string) error + func SCPFilePath(sshClient ssh.Client, srcPath, dstPath string) error + func ServerIsNetplanEnabled(ctx context.Context, client ssh.Client) bool + func SetEdgeboxMode(mode bool) + func SetTestMode(tMode bool) + func Sh(envVars map[string]string) *sh.Session + func VerifyMetalLbRunning(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst, ...) error + func WriteTemplateFile(filename string, buf *bytes.Buffer) error + type CloudletManifest struct + ManifestItems []CloudletManifestItem + func (m *CloudletManifest) AddItem(title string, contentType ManifestContentType, ...) + func (m *CloudletManifest) AddSubItem(title string, contentType ManifestContentType, ...) + func (m *CloudletManifest) ToString() (string, error) + type CloudletManifestItem struct + Content string + ContentSubType ManifestContentSubType + ContentType ManifestContentType + Id uint32 + SubManifests []CloudletManifestItem + Title string + type CommonEmbedded struct + func (c *CommonEmbedded) GetVersionProperties(ctx context.Context) map[string]string + type CommonPlatform struct + DeploymentTag string + MappedExternalIPs map[string]string + PlatformConfig *pf.PlatformConfig + Properties InfraProperties + func (c *CommonPlatform) ActivateFQDN(ctx context.Context, fqdn, addr string, ipversion IPVersion) error + func (c *CommonPlatform) AddProxySecurityRulesAndPatchDNS(ctx context.Context, client ssh.Client, kubeNames *k8smgmt.KubeNames, ...) error + func (c *CommonPlatform) CreateAppDNSAndPatchKubeSvc(ctx context.Context, client ssh.Client, kubeNames *k8smgmt.KubeNames, ...) error + func (c *CommonPlatform) DeleteAppDNS(ctx context.Context, client ssh.Client, kubeNames *k8smgmt.KubeNames, ...) error + func (c *CommonPlatform) DeleteCloudletFirewallRules(ctx context.Context, client ssh.Client) error + func (c *CommonPlatform) DeleteDNSRecords(ctx context.Context, fqdn string) error + func (c *CommonPlatform) DeleteIptableRulesForCloudletWideLabel(ctx context.Context, client ssh.Client) error + func (c *CommonPlatform) DeleteProxySecurityGroupRules(ctx context.Context, client ssh.Client, proxyName string, ...) error + func (c *CommonPlatform) GetCloudletDNSZone() string + func (c *CommonPlatform) GetMappedExternalIP(ip string) string + func (c *CommonPlatform) InitInfraCommon(ctx context.Context, platformConfig *pf.PlatformConfig, ...) error + func (c *CommonPlatform) ValidateExternalIPMapping(ctx context.Context, ip string) error + func (cp *CommonPlatform) GetSSHClientFromIPAddr(ctx context.Context, ipaddr string, ops ...pc.SSHClientOp) (ssh.Client, error) + type DnsSvcAction struct + AddDNS bool + ExternalIP string + ExternalIPV6 string + Hostname string + PatchIP string + PatchIPV6 string + PatchKube bool + type EnvData struct + Name string + Value string + type ErrorResp struct + Error string + Errors []string + type FirewallRule struct + Conntrack string + DestIP string + IPVersion IPVersion + InterfaceIn string + InterfaceOut string + PortEndpoint PortSourceOrDestChoice + PortRange string + Protocol string + RemoteCidr string + type FirewallRules struct + EgressRules []FirewallRule + IngressRules []FirewallRule + func GetFirewallRulesFromAppPorts(ctx context.Context, cidr string, destIp string, ports []dme.AppPort, ...) (*FirewallRules, error) + type GetDnsSvcActionFunc func(svc v1.Service) (*DnsSvcAction, error) + type IPVersion string + const IPV4 + const IPV6 + func GetAddrIPVersion(ctx context.Context, addr string) (IPVersion, error) + func GetCIDRIPVersion(ctx context.Context, cidr string) (IPVersion, error) + type IPs [NumIPTypes]string + func GetAllowedClientCIDR() IPs + func GetExternalPublicAddr(ctx context.Context, types ...IPVersion) (IPs, error) + func GetIPAddressFromNetplan(ctx context.Context, client ssh.Client, portName string) (IPs, error) + func (s IPs) IPV4() string + func (s IPs) IPV6() string + func (s IPs) IsSet() bool + func (s IPs) Matches(z IPs) bool + func (s IPs) NetIPs() (NetIPs, error) + func (s IPs) Sanitize(sanitizeFunc func(string) string) IPs + type ImageCategoryType string + const ImageCategoryPlatform + const ImageCategoryVmApp + type ImageInfo struct + Flavor string + ImageCategory ImageCategoryType + ImagePath string + ImageType edgeproto.ImageType + LocalImageName string + Md5sum string + OsType edgeproto.VmAppOsType + SourceImageTime time.Time + VmName string + type InfraProperties struct + Mux sync.Mutex + Properties map[string]*edgeproto.PropertyInfo + func (ip *InfraProperties) GetCloudletCRMGatewayIPAndPort() (string, int) + func (ip *InfraProperties) GetPlatformStatsMaxCacheTime() (uint64, error) + func (p *InfraProperties) GetValue(key string) (string, bool) + func (p *InfraProperties) Init() + func (p *InfraProperties) SetProperties(props map[string]*edgeproto.PropertyInfo) + func (p *InfraProperties) SetPropsFromVars(ctx context.Context, vars map[string]string) + func (p *InfraProperties) SetValue(key, value string) + func (p *InfraProperties) UpdatePropsFromVars(ctx context.Context, vars map[string]string) + type InitOp func(opts *InitOptions) + type InitOptions struct + type InterfaceActionsOp struct + AddInterface bool + CreateIptables bool + DeleteInterface bool + DeleteIptables bool + type IptablesChanges struct + func (s *IptablesChanges) PersistRules(ctx context.Context, client ssh.Client) error + type IptablesRules struct + type ManifestContentSubType string + const ManifestSubTypeBash + const ManifestSubTypeNone + const ManifestSubTypePython + const ManifestSubTypeYaml + type ManifestContentType string + const ManifestTypeCode + const ManifestTypeNone + const ManifestTypeURL + type MetalConfigmapParams struct + AddressRanges []string + type NetIPs [NumIPTypes]netip.Addr + type NetplanDevice struct + Addresses []string + DHCP4 bool + DHCP6 bool + IPV6MTU int + IPV6Privacy bool + LinkLocal []string + MTU int + Nameservers NetplanNameservers + Routes []*NetplanRoute + type NetplanDeviceMatch struct + Driver []string + MACAddress string + Name string + type NetplanEthernet struct + Match NetplanDeviceMatch + type NetplanFile struct + FileContents string + FileName string + Netplan NetplanInfo + type NetplanInfo struct + Network NetplanNetwork + type NetplanNameservers struct + Addresses []string + Search []string + type NetplanNetwork struct + Ethernets map[string]*NetplanEthernet + Version int + type NetplanRoute struct + From string + MTU int + Metric int + OnLink bool + Scope string + To string + Type string + Via string + func (s *NetplanRoute) ChangeDefaultToIPSpecific() error + type NetworkConfig struct + NetplanFiles []*NetplanFile + func GetNetworkConfig(ctx context.Context, client ssh.Client) (*NetworkConfig, error) + func (s *NetworkConfig) Apply(ctx context.Context, client ssh.Client) (bool, error) + func (s *NetworkConfig) GetInterface(ifaceName string, portName string) *NetplanEthernet + type PortSourceOrDestChoice string + const DestPort + const SourcePort + type ProxyDnsSecOpts struct + AddDnsAndPatchKubeSvc bool + AddProxy bool + AddSecurityRules bool + ProxyNamePrefix string + type VaultData struct + Data string + type VaultEnvData struct + Env []EnvData + type WhiteListFunc func(ctx context.Context, client ssh.Client, wlParams *WhiteListParams) error + type WhiteListParams struct + AllowedCIDR IPs + DestIP IPs + Label string + Ports []dme.AppPort + SecGrpName string + ServerName string