Documentation ¶
Index ¶
- Constants
- Variables
- func AddManifest(mf, addmf string) string
- func CheckNodesReady(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst) (int, int, error)
- func CheckPodsStatus(ctx context.Context, client ssh.Client, ...) (bool, error)
- func CleanupClusterConfig(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst) error
- func CleanupHelmConfigs(ctx context.Context, client ssh.Client, appName string) error
- func ClearCluster(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst) error
- func ClearClusterConfig(ctx context.Context, client ssh.Client, configDir, namespace, kconfArg string) error
- func CreateAllNamespaces(ctx context.Context, client ssh.Client, names *KubeNames) error
- func CreateAppInst(ctx context.Context, accessApi platform.AccessApi, client ssh.Client, ...) error
- func CreateHelmAppInst(ctx context.Context, client ssh.Client, names *KubeNames, ...) error
- func CreateMultitenantNamespace(ctx context.Context, client ssh.Client, names *KubeNames) error
- func DeleteAppInst(ctx context.Context, client ssh.Client, names *KubeNames, app *edgeproto.App, ...) error
- func DeleteHelmAppInst(ctx context.Context, client ssh.Client, names *KubeNames, ...) error
- func DeleteNamespace(ctx context.Context, client ssh.Client, names *KubeNames) error
- func DeleteNodes(ctx context.Context, client ssh.Client, kconfArg string, nodes []string) error
- func FixImagePath(origImagePath string) string
- func GetAppEnvVars(ctx context.Context, app *edgeproto.App, authApi cloudcommon.RegistryAuthApi, ...) (*[]v1.EnvVar, error)
- func GetAppInstRuntime(ctx context.Context, client ssh.Client, names *KubeNames, app *edgeproto.App, ...) (*edgeproto.AppInstRuntime, error)
- func GetCloudletClusterName(cluster *edgeproto.ClusterInst) string
- func GetContainerCommand(ctx context.Context, clusterInst *edgeproto.ClusterInst, app *edgeproto.App, ...) (string, error)
- func GetK8sNodeNameSuffix(clusterInst *edgeproto.ClusterInst) string
- func GetKconfArg(clusterInst *edgeproto.ClusterInst) string
- func GetKconfName(clusterInst *edgeproto.ClusterInst) string
- func GetNamespace(appInst *edgeproto.AppInst) string
- func GetNetworkPolicy(ctx context.Context, app *edgeproto.App, appInst *edgeproto.AppInst, ...) (string, error)
- func GetNodeInfos(ctx context.Context, client ssh.Client, kconfArg string) ([]*edgeproto.NodeInfo, error)
- func GetNormalizedClusterName(clusterInst *edgeproto.ClusterInst) string
- func GetServices(ctx context.Context, client ssh.Client, names *KubeNames) ([]v1.Service, error)
- func LbServicePortToString(p *v1.ServicePort) string
- func MergeEnvVars(ctx context.Context, accessApi platform.AccessApi, app *edgeproto.App, ...) (string, error)
- func NormalizeName(name string) string
- func PopulateAppInstLoadBalancerIps(ctx context.Context, client ssh.Client, names *KubeNames, ...) error
- func QuantityToUdec64(q resource.Quantity) (*edgeproto.Udec64, error)
- func QuantityToUint64(q resource.Quantity) (uint64, error)
- func SetMasterNoscheduleTaint(ctx context.Context, client ssh.Client, masterName string, kubeconfig string, ...) error
- func UpdateAppInst(ctx context.Context, accessApi platform.AccessApi, client ssh.Client, ...) error
- func UpdateHelmAppInst(ctx context.Context, client ssh.Client, names *KubeNames, app *edgeproto.App, ...) error
- func UpdateLoadBalancerPortMap(ctx context.Context, client ssh.Client, names *KubeNames, ...) error
- func UpgradeConfig(ctx context.Context, caches *platform.Caches, sharedRootLBClient ssh.Client, ...) error
- func WaitForAppInst(ctx context.Context, client ssh.Client, names *KubeNames, app *edgeproto.App, ...) error
- func WaitNodesReady(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst, ...) error
- func WriteDeploymentManifestToFile(ctx context.Context, accessApi platform.AccessApi, client ssh.Client, ...) error
- type KubeNames
- type KubeNamesOp
- type NoScheduleMasterTaintAction
- type Nodes
Constants ¶
const ConfigLabel = "config"
const DefaultNamespace string = "default"
const MexAppLabel = "mex-app"
const NoScheduleMasterTaintAnnotaionNew = "node-role.kubernetes.io/control-plane"
const NoScheduleMasterTaintAnnotaionOld = "node-role.kubernetes.io/master"
const WaitDeleted string = "WaitDeleted"
const WaitRunning string = "WaitRunning"
Variables ¶
var TestReplacementVars = deployvars.DeploymentReplaceVars{ Deployment: deployvars.CrmReplaceVars{ ClusterIp: "99.99.99.99", CloudletName: "dummyCloudlet", ClusterName: "dummyCluster", CloudletOrg: "dummyCloudletOrg", AppOrg: "dummyAppOrg", DnsZone: "dummy.net", }, }
TestReplacementVars are used to syntax check app envvars
Functions ¶
func AddManifest ¶
func CheckNodesReady ¶
func CheckNodesReady(ctx context.Context, client ssh.Client, clusterInst *edgeproto.ClusterInst) (int, int, error)
CheckNodesReady returns the number of ready and not ready nodes.
func CheckPodsStatus ¶
func CleanupClusterConfig ¶
func CleanupHelmConfigs ¶
func ClearCluster ¶
func ClearClusterConfig ¶
func CreateAllNamespaces ¶
CreateAllNamespaces creates all the namespaces the app will use. It does not create a manifest for the namespaces, just allows the basic dependencies can be defined against them. Manifest definition can later be used to update the namespaces.
func CreateAppInst ¶
func CreateHelmAppInst ¶
func DeleteAppInst ¶
func DeleteHelmAppInst ¶
func DeleteNamespace ¶
func DeleteNodes ¶
func FixImagePath ¶
FixImagePath removes localhost and adds Docker Hub as needed. For example, networkstatic/iperf3 becomes docker.io/networkstatic/iperf3
func GetAppEnvVars ¶
func GetAppEnvVars(ctx context.Context, app *edgeproto.App, authApi cloudcommon.RegistryAuthApi, deploymentVars *deployvars.DeploymentReplaceVars) (*[]v1.EnvVar, error)
func GetAppInstRuntime ¶
func GetCloudletClusterName ¶
func GetCloudletClusterName(cluster *edgeproto.ClusterInst) string
GetCloudletClusterName return the name of the cluster including cloudlet
func GetContainerCommand ¶
func GetK8sNodeNameSuffix ¶
func GetK8sNodeNameSuffix(clusterInst *edgeproto.ClusterInst) string
func GetKconfArg ¶
func GetKconfArg(clusterInst *edgeproto.ClusterInst) string
func GetKconfName ¶
func GetKconfName(clusterInst *edgeproto.ClusterInst) string
func GetNamespace ¶
func GetNetworkPolicy ¶
func GetNodeInfos ¶
func GetNormalizedClusterName ¶
func GetNormalizedClusterName(clusterInst *edgeproto.ClusterInst) string
func GetServices ¶
func LbServicePortToString ¶
func LbServicePortToString(p *v1.ServicePort) string
func MergeEnvVars ¶
func MergeEnvVars(ctx context.Context, accessApi platform.AccessApi, app *edgeproto.App, appInst *edgeproto.AppInst, kubeManifest string, imagePullSecrets []string, names *KubeNames, appInstFlavor *edgeproto.Flavor) (string, error)
Merge in all the environment variables into
func NormalizeName ¶
func QuantityToUdec64 ¶
QuantityToUdec64 converts a kubernetes Quantity to a Udec64. This should only fail if the value is negative, or the Quantity does not conform to the range of values it's supposed to be limited to.
func QuantityToUint64 ¶
QuantityToUint64 converts a kubernetes Quantity to a uint64. This fails if the quantity is negative or has decimal precision.
func UpdateAppInst ¶
func UpdateHelmAppInst ¶
func UpgradeConfig ¶
func UpgradeConfig(ctx context.Context, caches *platform.Caches, sharedRootLBClient ssh.Client, getClient func(context.Context, *edgeproto.ClusterInst, string) (ssh.Client, error)) error
This function is called after CRM starts and has received all the cache data from the controller.
func WaitForAppInst ¶
func WaitForAppInst(ctx context.Context, client ssh.Client, names *KubeNames, app *edgeproto.App, waitFor string) error
WaitForAppInst waits for pods to either start or result in an error if WaitRunning specified, or if WaitDeleted is specified then wait for them to all disappear.
func WaitNodesReady ¶
Types ¶
type KubeNames ¶
type KubeNames struct { AppName string AppVersion string AppOrg string AppInstName string AppInstOrg string HelmAppName string AppURI string AppImage string AppRevision string AppInstRevision string ClusterName string K8sNodeNameSuffix string OperatorName string ServiceNames []string DeveloperDefinedNamespaces []string // namespaces included by developer in manifest KconfName string KconfArg string DeploymentType string ImagePullSecrets []string ImagePaths []string IsUriIPAddr bool MultitenantNamespace string // for apps launched in a multi-tenant cluster BaseKconfName string }
func GetKubeNames ¶
func GetKubeNames(clusterInst *edgeproto.ClusterInst, app *edgeproto.App, appInst *edgeproto.AppInst, opts ...KubeNamesOp) (*KubeNames, error)
GetKubeNames udpates kubeNames with normalized strings for the included clusterinst, app, and appisnt
func (*KubeNames) ContainsService ¶
type KubeNamesOp ¶
type NoScheduleMasterTaintAction ¶
type NoScheduleMasterTaintAction string
const NoScheduleMasterTaintAdd NoScheduleMasterTaintAction = "master-noschedule-taint-add"
const NoScheduleMasterTaintNone NoScheduleMasterTaintAction = "master-noschedule-taint-none"
const NoScheduleMasterTaintRemove NoScheduleMasterTaintAction = "master-noschedule-taint-remove"