Documentation ¶
Overview ¶
Package v1alpha1 Package v1alpha1 contains API Schema definitions for the kappital v1alpha1 API group
Index ¶
- Constants
- Variables
- func TranslateResourcesToBase64(resource ServiceResource) (string, error)
- type CapabilityPlugin
- type Permission
- type RawResource
- type ServiceDaemonSetSpec
- type ServiceDeploymentSpec
- type ServicePackage
- func (in *ServicePackage) DeepCopy() *ServicePackage
- func (in *ServicePackage) DeepCopyInto(out *ServicePackage)
- func (in *ServicePackage) DeepCopyObject() runtime.Object
- func (in ServicePackage) IsDeleted() bool
- func (in ServicePackage) IsDeleting() bool
- func (in ServicePackage) IsUpgrading() bool
- func (in ServicePackage) NeedCheckRuntime() bool
- func (in *ServicePackage) SetToDeleted()
- func (in *ServicePackage) SetToDeleting()
- func (in *ServicePackage) SetToFailed(reason string)
- func (in *ServicePackage) SetToPending()
- func (in *ServicePackage) SetToRunning()
- func (in *ServicePackage) SetToSucceeded()
- func (in *ServicePackage) SetToUnknown(reason string)
- func (in *ServicePackage) SetToUpgrading()
- func (in *ServicePackage) UpdateStatus(err error)
- func (in *ServicePackage) VerifyStatus()
- type ServicePackageList
- type ServicePackageSpec
- type ServicePackageStatus
- type ServiceResource
- type ServiceStatefulSetSpec
- type Workload
Constants ¶
const ( // PendingPhase pending status of the ServicePackage (SP), it means the SP is installing PendingPhase = "Pending" // RunningPhase running status of the ServicePackage (SP), it means the SP is running RunningPhase = "Running" // SucceededPhase succeeded status of the ServicePackage (SP), it means the SP has already deployed succeeded SucceededPhase = "Succeeded" // FailedPhase failed status of the ServicePackage (SP), it means the SP is deploying or upgrading failed FailedPhase = "Failed" // UnknownPhase unknown status of the ServicePackage (SP), it means the SP has unknown reasons to run with exception UnknownPhase = "Unknown" // UpgradingPhase upgrading status of the ServicePackage (SP), it means the SP is upgrading UpgradingPhase = "Upgrading" // DeletingPhase deleting status of the ServicePackage (SP), it means the SP is during deleting DeletingPhase = "Deleting" // DeletedPhase deleted status of the ServicePackage (SP), it means the SP has already deleted DeletedPhase = "Deleted" )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "core.kappital.io", Version: "v1alpha1"} // ServicePackageKind singular ServicePackageKind = "ServicePackage" // ServicePackagesKind plural ServicePackagesKind = "ServicePackages" // ServicePackageAPIVersion the service package api version ServicePackageAPIVersion = "core.kappital.io/v1alpha1" // ServicePackageGroupVersionResource is the group version resource used to register these objects for // client-go interface to create and update CRs ServicePackageGroupVersionResource = schema.GroupVersionResource{ Group: "core.kappital.io", Version: "v1alpha1", Resource: "servicepackages", } // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func TranslateResourcesToBase64 ¶
func TranslateResourcesToBase64(resource ServiceResource) (string, error)
TranslateResourcesToBase64 translate the ServiceResource object to the base64 code.
Types ¶
type CapabilityPlugin ¶
type CapabilityPlugin struct { }
CapabilityPlugin is the extra functions for operations TODO: Design the CapabilityPlugin structure and apply each functions
type Permission ¶
type Permission struct { ServiceAccountName string `json:"serviceAccountName"` Rules []rbac.PolicyRule `json:"rules"` }
Permission is the permission for user's operator(s), only support for cluster role and cluster role binding. In other words, engine consider the same Service Instance will only have exactly one operator in one cluster.
type RawResource ¶
RawResource is the resources for the service except Kappital’s package, such as helm, etc.
func (*RawResource) DeepCopy ¶
func (in *RawResource) DeepCopy() *RawResource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawResource.
func (*RawResource) DeepCopyInto ¶
func (in *RawResource) DeepCopyInto(out *RawResource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceDaemonSetSpec ¶
type ServiceDaemonSetSpec struct { Name string `json:"name"` Spec appsv1.DaemonSetSpec `json:"spec"` }
ServiceDaemonSetSpec the message of DaemonSet object information.
type ServiceDeploymentSpec ¶
type ServiceDeploymentSpec struct { Name string `json:"name"` Spec appsv1.DeploymentSpec `json:"spec"` }
ServiceDeploymentSpec the message of Deployment object information.
type ServicePackage ¶
type ServicePackage struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ServicePackageSpec `json:"spec,omitempty"` Status ServicePackageStatus `json:"status,omitempty"` }
ServicePackage is the Schema for the servicepackages API
func (*ServicePackage) DeepCopy ¶
func (in *ServicePackage) DeepCopy() *ServicePackage
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePackage.
func (*ServicePackage) DeepCopyInto ¶
func (in *ServicePackage) DeepCopyInto(out *ServicePackage)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServicePackage) DeepCopyObject ¶
func (in *ServicePackage) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (ServicePackage) IsDeleted ¶
func (in ServicePackage) IsDeleted() bool
IsDeleted does the service package is deleted.
func (ServicePackage) IsDeleting ¶
func (in ServicePackage) IsDeleting() bool
IsDeleting does the service package during the deleting relation status.
func (ServicePackage) IsUpgrading ¶
func (in ServicePackage) IsUpgrading() bool
IsUpgrading does the service package during the upgrading status.
func (ServicePackage) NeedCheckRuntime ¶
func (in ServicePackage) NeedCheckRuntime() bool
NeedCheckRuntime does the service package is need to check the application objects runtime status.
func (*ServicePackage) SetToDeleted ¶
func (in *ServicePackage) SetToDeleted()
SetToDeleted set the service package to deleted, which means the service package is already deleted. The service package will wait for manage do the garbage collection.
func (*ServicePackage) SetToDeleting ¶
func (in *ServicePackage) SetToDeleting()
SetToDeleting set the service package to deleting, which means the service package is during the deleting.
func (*ServicePackage) SetToFailed ¶
func (in *ServicePackage) SetToFailed(reason string)
SetToFailed set the service package to failed, which means the service package is deployed failed or upgraded failed.
func (*ServicePackage) SetToPending ¶
func (in *ServicePackage) SetToPending()
SetToPending set the service package to pending, which means the service engine is installing this service package.
func (*ServicePackage) SetToRunning ¶
func (in *ServicePackage) SetToRunning()
SetToRunning set the service package to running, which means the service package is running.
func (*ServicePackage) SetToSucceeded ¶
func (in *ServicePackage) SetToSucceeded()
SetToSucceeded set the service package to succeeded, which means the service package is deployed success or upgraded success.
func (*ServicePackage) SetToUnknown ¶
func (in *ServicePackage) SetToUnknown(reason string)
SetToUnknown set the service package to unknown, which means the service package has unknown reasons make it may not provide the all functions.
func (*ServicePackage) SetToUpgrading ¶
func (in *ServicePackage) SetToUpgrading()
SetToUpgrading set to the service package to upgrading, which means the service package is during the upgrading.
func (*ServicePackage) UpdateStatus ¶
func (in *ServicePackage) UpdateStatus(err error)
UpdateStatus update the service package with errors. This is the final step for reconciler. It will update the status to the correct status for pre-processes.
func (*ServicePackage) VerifyStatus ¶
func (in *ServicePackage) VerifyStatus()
VerifyStatus will verify the service package status
type ServicePackageList ¶
type ServicePackageList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []ServicePackage `json:"items"` }
ServicePackageList contains a list of ServicePackage
func (*ServicePackageList) DeepCopy ¶
func (in *ServicePackageList) DeepCopy() *ServicePackageList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePackageList.
func (*ServicePackageList) DeepCopyInto ¶
func (in *ServicePackageList) DeepCopyInto(out *ServicePackageList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ServicePackageList) DeepCopyObject ¶
func (in *ServicePackageList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ServicePackageSpec ¶
type ServicePackageSpec struct { // ServiceID is the unique id for the service which from service package ServiceID string `json:"serviceID"` // Name is the service name Name string `json:"name"` // Version is the version of this service Version string `json:"version,omitempty"` // Resources is a base64 binary code, it will be analysis by engine to the service instance resources, // such as custom resource, cluster role, cluster role binding, and workload etc. Resources string `json:"resources,omitempty"` // RawResources is a slice of non-kappital packages resources RawResources []RawResource `json:"rawResources,omitempty"` }
ServicePackageSpec defines the desired state of ServicePackage
func (*ServicePackageSpec) DeepCopy ¶
func (in *ServicePackageSpec) DeepCopy() *ServicePackageSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePackageSpec.
func (*ServicePackageSpec) DeepCopyInto ¶
func (in *ServicePackageSpec) DeepCopyInto(out *ServicePackageSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServicePackageStatus ¶
type ServicePackageStatus struct { CurrentVersion string `json:"currentVersion,omitempty"` Phase string `json:"phase,omitempty"` Reason string `json:"reason,omitempty"` LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"` }
ServicePackageStatus defines the observed state of ServicePackage
func (*ServicePackageStatus) DeepCopy ¶
func (in *ServicePackageStatus) DeepCopy() *ServicePackageStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePackageStatus.
func (*ServicePackageStatus) DeepCopyInto ¶
func (in *ServicePackageStatus) DeepCopyInto(out *ServicePackageStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceResource ¶
type ServiceResource struct { CustomResourceDefinitions []string `json:"customResourceDefinitions"` Permissions []Permission `json:"permissions"` CapabilityPlugin CapabilityPlugin `json:"capabilityPlugin,omitempty"` Workload Workload `json:"workload"` }
ServiceResource is the resource for the cloud native service instance
func TranslateBase64CodeToResource ¶
func TranslateBase64CodeToResource(binary string) (ServiceResource, error)
TranslateBase64CodeToResource translate the base64 code to the ServiceResource object.
type ServiceStatefulSetSpec ¶
type ServiceStatefulSetSpec struct { Name string `json:"name"` Spec appsv1.StatefulSetSpec `json:"spec"` }
ServiceStatefulSetSpec the message of StatefulSet object information.
type Workload ¶
type Workload struct { Deployments []ServiceDeploymentSpec `json:"deployments,omitempty"` DaemonSets []ServiceDaemonSetSpec `json:"daemonSets,omitempty"` StatefulSets []ServiceStatefulSetSpec `json:"statefulSets,omitempty"` }
Workload is the operator workloads, now only support for deployment, daemon set, and stateful set