Documentation
¶
Overview ¶
Package catalog manages interpretation of the app catalog.
The virtual cluster creation process uses the exported functions from interrogate.go to help determine the configuration for various k8s objects. Once cluster members have been created, a function retrieved from ConfigmetaGenerator is used to created the "configmeta" files placed in each member's filesystem.
Index ¶
- func AgentRequired(cr *kdv1.KubeDirectorCluster) bool
- func AppCapabilities(cr *kdv1.KubeDirectorCluster) ([]v1.Capability, error)
- func AppPersistDirs(cr *kdv1.KubeDirectorCluster, role string) (*[]string, error)
- func AppSetupPackageInfo(cr *kdv1.KubeDirectorCluster, role string) (*kdv1.SetupPackageInfo, error)
- func ConfigmetaGenerator(cr *kdv1.KubeDirectorCluster, membersForRole map[string][]*kdv1.MemberStatus) (func(string) string, error)
- func FindApp(cr *kdv1.KubeDirectorCluster) (*kdv1.KubeDirectorApp, error)
- func GetAllRoleIDs(appCR *kdv1.KubeDirectorApp) []string
- func GetAllServiceIDs(appCR *kdv1.KubeDirectorApp) []string
- func GetApp(cr *kdv1.KubeDirectorCluster) (*kdv1.KubeDirectorApp, error)
- func GetRoleCardinality(appRole *kdv1.NodeRole) (int32, bool)
- func GetRoleFromID(appCR *kdv1.KubeDirectorApp, roleID string) *kdv1.NodeRole
- func GetRoleMinResources(appRole *kdv1.NodeRole) *v1.ResourceList
- func GetRoleMinStorage(appRole *kdv1.NodeRole) *kdv1.MinStorage
- func GetSelectedRoleIDs(appCR *kdv1.KubeDirectorApp) []string
- func GetServiceFromID(appCR *kdv1.KubeDirectorApp, serviceID string) *kdv1.Service
- func ImageForRole(cr *kdv1.KubeDirectorCluster, role string) (string, error)
- func RoleContainerSpecs(cr *kdv1.KubeDirectorCluster, role string) (*kdv1.ContainerSpec, error)
- func SystemdRequired(cr *kdv1.KubeDirectorCluster) (bool, error)
- type ServicePortInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentRequired ¶
func AgentRequired( cr *kdv1.KubeDirectorCluster, ) bool
AgentRequired checks whether agent installation is required for a given app.
func AppCapabilities ¶
func AppCapabilities( cr *kdv1.KubeDirectorCluster, ) ([]v1.Capability, error)
AppCapabilities fetches the required capabilities for a given app
func AppPersistDirs ¶
func AppPersistDirs( cr *kdv1.KubeDirectorCluster, role string, ) (*[]string, error)
AppPersistDirs fetches the required directories for a given role that has be persisted on a PVC.
func AppSetupPackageInfo ¶ added in v0.8.0
func AppSetupPackageInfo( cr *kdv1.KubeDirectorCluster, role string, ) (*kdv1.SetupPackageInfo, error)
AppSetupPackageInfo returns the app setup package info for a given role. The fact that this function is invoked means that setup package was specified either for the node role or the application as a whole.
func ConfigmetaGenerator ¶
func ConfigmetaGenerator( cr *kdv1.KubeDirectorCluster, membersForRole map[string][]*kdv1.MemberStatus, ) (func(string) string, error)
ConfigmetaGenerator returns a function that generates metadata which will be consumed by the app setup Python packages inside a specific cluster member. This metadata is prepared based on the app type definition that is referenced in the virtual cluster spec.
func FindApp ¶ added in v0.3.0
func FindApp( cr *kdv1.KubeDirectorCluster, ) (*kdv1.KubeDirectorApp, error)
FindApp returns the app type definition for the given virtual cluster. If the appCatalog property is set to "local", it looks in the same namespace as the cluster. If set to "system", it looks in the same namespace as KubeDirector. If unset, it checks the local namespace first and then the KD namespace. The returned values are the app CR (if found) and any error.
func GetAllRoleIDs ¶
func GetAllRoleIDs( appCR *kdv1.KubeDirectorApp, ) []string
GetAllRoleIDs is a utility function that returns the list of all node roles ID.
func GetAllServiceIDs ¶
func GetAllServiceIDs( appCR *kdv1.KubeDirectorApp, ) []string
GetAllServiceIDs is a utility function that returns the list of all service IDs.
func GetApp ¶
func GetApp( cr *kdv1.KubeDirectorCluster, ) (*kdv1.KubeDirectorApp, error)
GetApp is a wrapper for FindApp that caches a pointer to the resulting app CR (if found) in the cluster CR.
func GetRoleCardinality ¶
GetRoleCardinality is a utility function that fetches the cardinality value for a given app role along with whether it is a scale out cardinality
func GetRoleFromID ¶
func GetRoleFromID( appCR *kdv1.KubeDirectorApp, roleID string, ) *kdv1.NodeRole
GetRoleFromID is a utility function that returns the service definition for the given service ID, or nil if no such service is defined.
func GetRoleMinResources ¶ added in v0.3.0
func GetRoleMinResources( appRole *kdv1.NodeRole, ) *v1.ResourceList
GetRoleMinResources is a utility function that fetches the minimum resources for a given app role
func GetRoleMinStorage ¶ added in v0.8.0
func GetRoleMinStorage( appRole *kdv1.NodeRole, ) *kdv1.MinStorage
GetRoleMinStorage is a utility function that fetches the minimum persistent storage spec given app role
func GetSelectedRoleIDs ¶
func GetSelectedRoleIDs( appCR *kdv1.KubeDirectorApp, ) []string
GetSelectedRoleIDs returns the list of selected roles in the config.
func GetServiceFromID ¶
func GetServiceFromID( appCR *kdv1.KubeDirectorApp, serviceID string, ) *kdv1.Service
GetServiceFromID is a utility function that returns the service definition for the given service ID, or nil if no such service is defined.
func ImageForRole ¶
func ImageForRole( cr *kdv1.KubeDirectorCluster, role string, ) (string, error)
ImageForRole returns the image to be used for pods in a given role.
func RoleContainerSpecs ¶ added in v0.6.0
func RoleContainerSpecs( cr *kdv1.KubeDirectorCluster, role string, ) (*kdv1.ContainerSpec, error)
RoleContainerSpecs fetches container spec properties that needs to be overridden by KDApp author
func SystemdRequired ¶
func SystemdRequired( cr *kdv1.KubeDirectorCluster, ) (bool, error)
SystemdRequired checks whether systemctl mounts are required for a given app.
Types ¶
type ServicePortInfo ¶ added in v0.2.0
ServicePortInfo - A mapping between a Service Port ID and the port number
func PortsForRole ¶
func PortsForRole( cr *kdv1.KubeDirectorCluster, role string, ) ([]ServicePortInfo, error)
PortsForRole returns list of service port info (id and port num) for a given role. This will be used to export those ports as NodePort/LoadBalancer