Documentation
¶
Index ¶
- Constants
- Variables
- func CreateResource(ctx context.Context, client dynamic.Interface, ...) error
- func CreateYAMLFile(ctx context.Context, dynamicClient *dynamic.DynamicClient, ...) error
- func DeleteResource(ctx context.Context, client dynamic.Interface, ...) error
- func DescribeResource(ctx context.Context, client *kubernetes.Clientset, ...) (string, error)
- func EventsInfo(ctx context.Context, client *kubernetes.Clientset, ...) (string, error)
- func GetKubeClient(KubeConfigPaths ...string) (clientset *kubernetes.Clientset, err error)
- func GetKubeDynamicClient(KubeConfigPaths ...string) (*dynamic.DynamicClient, error)
- func GetObjResrouce(ctx context.Context, obj *unstructured.Unstructured, ...) (*unstructured.Unstructured, error)
- func GetResource(ctx context.Context, client dynamic.Interface, ...) (*unstructured.Unstructured, error)
- func GetSpec(obj *unstructured.Unstructured, out any) error
- func GetStatus(obj *unstructured.Unstructured) (status any, err error)
- func Logs(ctx context.Context, client *kubernetes.Clientset, namespace, podName string) (string, error)
- func NewAppRuntime(logger log.Logger) biz.AppRuntime
- func NewClusterRuntime(logger log.Logger) biz.ClusterRuntime
- func NewProjectRuntime(logger log.Logger) biz.ProjectRuntime
- func NewServiceRuntime(logger log.Logger) biz.ServiceRuntime
- func NewUnstructured(kindName string) *unstructured.Unstructured
- func NewUnstructuredWithGenerateName(kindName, namePrefix string) *unstructured.Unstructured
- func NewWorkflowRuntime(logger log.Logger) biz.WorkflowRuntime
- func NewWorkspaceRuntime(logger log.Logger) biz.WorkspaceRuntime
- func ParseYAML(filename string) (*unstructured.UnstructuredList, error)
- func PodInfo(ctx context.Context, client *kubernetes.Clientset, namespace, podName string) (string, error)
- func PodLogs(ctx context.Context, client *kubernetes.Clientset, ...) (string, error)
- func ResourceInfo(ctx context.Context, client dynamic.Interface, namespace, name string, ...) (string, error)
- func SetSpec(obj *unstructured.Unstructured, spec any)
- func SetSpecField(obj *unstructured.Unstructured, fieldPath string, value any) error
- func UpdateResource(ctx context.Context, client dynamic.Interface, ...) error
- func WaitForCRDStatus(ctx context.Context, dynamicClient *dynamic.DynamicClient, ...) error
- func WaitForPodReady(ctx context.Context, client *kubernetes.Clientset, namespace, podName string, ...) error
- type AppRuntime
- func (a *AppRuntime) AppRelease(ctx context.Context, appRelease *biz.AppRelease) error
- func (a *AppRuntime) DeleteApp(ctx context.Context, app *biz.App) error
- func (a *AppRuntime) DeleteAppRelease(ctx context.Context, appRelease *biz.AppRelease) error
- func (a *AppRuntime) DeleteAppVersion(ctx context.Context, app *biz.App, appVersion *biz.AppVersion) error
- func (a *AppRuntime) GetAppAndVersionInfo(ctx context.Context, app *biz.App) error
- func (a *AppRuntime) GetAppReleaseResources(ctx context.Context, appRelease *biz.AppRelease) error
- func (a *AppRuntime) ReloadAppRepo(ctx context.Context, appRepo *biz.AppRepo) error
- type AppStatus
- type CanaryDeployment
- type CloudServiceSpec
- type CloudServiceType
- type ClusterRuntime
- type NetworkPolicy
- type Port
- type ProjectRuntime
- type ServiceRuntime
- type Volume
- type WorkflowRuntime
- type WorkspaceRuntime
Constants ¶
View Source
const ( CloudAppKind = "CloudApp" CloudAppReleaseKind = "CloudAppRelease" AppRepoObjName = "app_repo" AppObjName = "app" )
View Source
const ( CloudGroup = "cloud-copilot.operator.io" CloudVersion = "v1alpha1" DefaultNamespace = "default" WaitTimeout = 10 * time.Minute )
View Source
const (
CloudClusterKind = "CloudCluster"
)
View Source
const (
CloudProjectKind = "CloudProject"
)
View Source
const (
CloudServiceKind = "CloudService"
)
View Source
const (
CloudWorkflowKind = "CloudWorkflow"
)
View Source
const (
CloudWorkspaceKind = "CloudWorkspace"
)
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewAppRuntime, NewClusterRuntime, NewProjectRuntime, NewServiceRuntime, NewWorkflowRuntime, NewWorkspaceRuntime)
Functions ¶
func CreateResource ¶
func CreateResource(ctx context.Context, client dynamic.Interface, resource *unstructured.Unstructured) error
func CreateYAMLFile ¶
func DeleteResource ¶
func DeleteResource(ctx context.Context, client dynamic.Interface, resource *unstructured.Unstructured) error
func DescribeResource ¶
func DescribeResource(ctx context.Context, client *kubernetes.Clientset, namespace, resourceName string) (string, error)
kubectl describe resource -n namespace
func EventsInfo ¶
func GetKubeClient ¶
func GetKubeClient(KubeConfigPaths ...string) (clientset *kubernetes.Clientset, err error)
func GetKubeDynamicClient ¶
func GetKubeDynamicClient(KubeConfigPaths ...string) (*dynamic.DynamicClient, error)
func GetObjResrouce ¶
func GetObjResrouce(ctx context.Context, obj *unstructured.Unstructured, successStatus, failedStatus int32) (*unstructured.Unstructured, error)
func GetResource ¶
func GetResource(ctx context.Context, client dynamic.Interface, resource *unstructured.Unstructured) (*unstructured.Unstructured, error)
func GetSpec ¶
func GetSpec(obj *unstructured.Unstructured, out any) error
Convert the spec of an unstructured object to a specified struct
func GetStatus ¶
func GetStatus(obj *unstructured.Unstructured) (status any, err error)
func Logs ¶
func Logs(ctx context.Context, client *kubernetes.Clientset, namespace, podName string) (string, error)
kubectl logs -n namespace podName
func NewAppRuntime ¶
func NewAppRuntime(logger log.Logger) biz.AppRuntime
func NewClusterRuntime ¶
func NewClusterRuntime(logger log.Logger) biz.ClusterRuntime
func NewProjectRuntime ¶
func NewProjectRuntime(logger log.Logger) biz.ProjectRuntime
func NewServiceRuntime ¶
func NewServiceRuntime(logger log.Logger) biz.ServiceRuntime
func NewUnstructured ¶
func NewUnstructured(kindName string) *unstructured.Unstructured
func NewUnstructuredWithGenerateName ¶
func NewUnstructuredWithGenerateName(kindName, namePrefix string) *unstructured.Unstructured
func NewWorkflowRuntime ¶
func NewWorkflowRuntime(logger log.Logger) biz.WorkflowRuntime
func NewWorkspaceRuntime ¶
func NewWorkspaceRuntime(logger log.Logger) biz.WorkspaceRuntime
func ParseYAML ¶
func ParseYAML(filename string) (*unstructured.UnstructuredList, error)
func PodInfo ¶
func PodInfo(ctx context.Context, client *kubernetes.Clientset, namespace, podName string) (string, error)
kubectl describe resource -n namespace
func PodLogs ¶
func PodLogs(ctx context.Context, client *kubernetes.Clientset, namespace, podName, containerName string) (string, error)
kubectl logs -n namespace podName
func ResourceInfo ¶
func ResourceInfo(ctx context.Context, client dynamic.Interface, namespace, name string, gvr schema.GroupVersionResource) (string, error)
ResourceInfo
func SetSpec ¶
func SetSpec(obj *unstructured.Unstructured, spec any)
func SetSpecField ¶
func SetSpecField(obj *unstructured.Unstructured, fieldPath string, value any) error
SetSpecField(obj, "template.metadata.labels.app", "myapp")
func UpdateResource ¶
func UpdateResource(ctx context.Context, client dynamic.Interface, resource *unstructured.Unstructured) error
func WaitForCRDStatus ¶
func WaitForCRDStatus(ctx context.Context, dynamicClient *dynamic.DynamicClient, res *unstructured.Unstructured, timeout time.Duration, condition func(obj *unstructured.Unstructured) (bool, error)) error
func WaitForPodReady ¶
Types ¶
type AppRuntime ¶
type AppRuntime struct {
// contains filtered or unexported fields
}
func (*AppRuntime) AppRelease ¶
func (a *AppRuntime) AppRelease(ctx context.Context, appRelease *biz.AppRelease) error
func (*AppRuntime) DeleteAppRelease ¶
func (a *AppRuntime) DeleteAppRelease(ctx context.Context, appRelease *biz.AppRelease) error
func (*AppRuntime) DeleteAppVersion ¶
func (a *AppRuntime) DeleteAppVersion(ctx context.Context, app *biz.App, appVersion *biz.AppVersion) error
func (*AppRuntime) GetAppAndVersionInfo ¶
func (*AppRuntime) GetAppReleaseResources ¶
func (a *AppRuntime) GetAppReleaseResources(ctx context.Context, appRelease *biz.AppRelease) error
func (*AppRuntime) ReloadAppRepo ¶
type CanaryDeployment ¶
type CloudServiceSpec ¶
type CloudServiceSpec struct {
CloudServiceType CloudServiceType `json:"cloud_service_type,omitempty"`
Gateway string `json:"gateway,omitempty"`
Image string `json:"image,omitempty"`
Replicas int32 `json:"replicas,omitempty"`
RequestCPU int32 `json:"request_cpu,omitempty"`
LimitCPU int32 `json:"limit_cpu,omitempty"`
RequestGPU int32 `json:"request_gpu,omitempty"`
LimitGPU int32 `json:"limit_gpu,omitempty"`
RequestMemory int32 `json:"request_memory,omitempty"`
LimitMemory int32 `json:"limit_memory,omitempty"`
Volumes []Volume `json:"volumes,omitempty"`
Ports []Port `json:"ports,omitempty"`
ConfigPath string `json:"config_path,omitempty"` // dir
Config map[string]string `json:"config,omitempty"` // key: filename, value: content
IngressNetworkPolicy []NetworkPolicy `json:"ingress_network_policy,omitempty"`
EgressNetworkPolicy []NetworkPolicy `json:"egress_network_policy,omitempty"`
CanaryDeployment CanaryDeployment `json:"canary_deployment,omitempty"`
}
CloudServiceSpec defines the desired state of CloudService.
type CloudServiceType ¶
type CloudServiceType string
const ( CloudServiceTypeHttpServer CloudServiceType = "HttpServer" CloudServiceTypeGrpcServer CloudServiceType = "GrpcServer" )
type ClusterRuntime ¶
type ClusterRuntime struct {
// contains filtered or unexported fields
}
func (*ClusterRuntime) CurrentCluster ¶
func (*ClusterRuntime) ReloadCluster ¶
type NetworkPolicy ¶
type ProjectRuntime ¶
type ProjectRuntime struct {
// contains filtered or unexported fields
}
type ServiceRuntime ¶
type ServiceRuntime struct {
// contains filtered or unexported fields
}
func (*ServiceRuntime) ApplyService ¶
func (s *ServiceRuntime) ApplyService(ctx context.Context, service *biz.Service, continuousDeployment *biz.ContinuousDeployment) error
func (*ServiceRuntime) GetServiceStatus ¶
type WorkflowRuntime ¶
type WorkflowRuntime struct {
// contains filtered or unexported fields
}
func (*WorkflowRuntime) CleanWorkflow ¶
func (*WorkflowRuntime) CommitWorkflow ¶
func (*WorkflowRuntime) GetWorkflowStatus ¶
type WorkspaceRuntime ¶
type WorkspaceRuntime struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.