Documentation
¶
Index ¶
- Constants
- func CreateNamespace(name string, client *kubernetes.Clientset) error
- func CreatePVC(tenantName, storageClass, size string, namespace string, ...) error
- func CreateResourceQuota(tenant *api.Tenant, namespace string, client *kubernetes.Clientset) error
- func IntegrationSecret(i string) string
- func LabelOwnerCyclone() string
- func NamespaceTenant(n string) string
- func NewClusterClient(c *api.ClusterCredential, inCluster bool) (*kubernetes.Clientset, error)
- func ParseResourceList(resources map[core_v1.ResourceName]string) (map[core_v1.ResourceName]resource.Quantity, error)
- func ProjectSelector(project string) string
- func SecretIntegration(s string) string
- func TenantNamespace(tenant string) string
- func TenantPVC(tenant string) string
- func TenantResourceQuota(tenant string) string
- func UpdatePVC(tenantName, storageClass, size string, namespace string, ...) error
- func UpdateResourceQuota(tenant *api.Tenant, namespace string, client *kubernetes.Clientset) error
- func WorkerClustersSelector() string
- func WorkflowSelector(workflow string) string
Constants ¶
const ( // AdminTenant is name of the system admin tenant, it's a default tenant created when Cyclone // start, and resources shared among all tenants would be placed in this tenant, such as stage // templates. AdminTenant = "admin" // TenantNamespacePrefix is the prefix of namespace which related to a specific tenant TenantNamespacePrefix = "cyclone--" // TenantPVCPrefix is the prefix of pvc which related to a specific tenant TenantPVCPrefix = "cyclone-pvc-" // DefaultPVCSize is the default size of pvc DefaultPVCSize = "5Gi" // AnnotationTenant is the annotation key used for namespace to relate tenant information AnnotationTenant = "cyclone.io/tenant-info" // LabelProjectName is the label key used to indicate the project which the resources belongs to LabelProjectName = "cyclone.io/project-name" // LabelWorkflowName is the label key used to indicate the workflow which the resources belongs to LabelWorkflowName = "cyclone.io/workflow-name" // LabelIntegrationType is the label key used to indicate type of integration LabelIntegrationType = "cyclone.io/integration-type" // LabelClusterOn is the label key used to indicate the cluster is a worker for the tenant LabelClusterOn = "cyclone.io/cluster-worker" // LabelTrueValue is the label value used to represent true LabelTrueValue = "true" // LabelFalseValue is the label value used to represent false LabelFalseValue = "false" // LabelOwner is the label key used to indicate namespaces created by cyclone LabelOwner = "cyclone.io/owner" // OwnerCyclone is the label value used to indicate namespaces created by cyclone OwnerCyclone = "cyclone" // LabelBuiltin is the label key used to represent cyclone built in resources LabelBuiltin = "cyclone.io/builtin" // LabelScene is the label key used to indicate cyclone scenario LabelScene = "cyclone.io/scene" // SceneCICD is the label value used to indicate cyclone CI/CD scenario SceneCICD = "cicd" // SceneAI is the label value used to indicate cyclone AI scenario SceneAI = "ai" // LabelStageTemplate is the label key used to represent a stage is a stage template LabelStageTemplate = "cyclone.io/stage-template" // AnnotationAlias is the annotation key used to indicate the alias of resources AnnotationAlias = "cyclone.io/alias" // AnnotationDescription is the annotation key used to describe resources AnnotationDescription = "cyclone.io/description" // QuotaCPULimit represents default value of 'limits.cpu' QuotaCPULimit = "2" // QuotaCPURequest represents default value of 'requests.cpu' QuotaCPURequest = "1" // QuotaMemoryLimit represents default value of 'limits.memory' QuotaMemoryLimit = "4Gi" // QuotaMemoryRequest represents default value of 'requests.memory' QuotaMemoryRequest = "2Gi" // SecretKeyIntegration is the key of the secret dada to indicate its value is about integration information. SecretKeyIntegration = "integration" // ControlClusterName is the name of control cluster ControlClusterName = "control-cluster" )
Variables ¶
This section is empty.
Functions ¶
func CreateNamespace ¶
func CreateNamespace(name string, client *kubernetes.Clientset) error
CreateNamespace creates a namespace
func CreatePVC ¶
func CreatePVC(tenantName, storageClass, size string, namespace string, client *kubernetes.Clientset) error
CreatePVC creates pvc for tenant
func CreateResourceQuota ¶
CreateResourceQuota creates resource quota for tenant
func IntegrationSecret ¶
IntegrationSecret returns secret name related to the integration
func LabelOwnerCyclone ¶
func LabelOwnerCyclone() string
LabelOwnerCyclone returns a label string describes resource belongs to cyclone
func NamespaceTenant ¶
NamespaceTenant retrieves tenant from given namespace name.
func NewClusterClient ¶
func NewClusterClient(c *api.ClusterCredential, inCluster bool) (*kubernetes.Clientset, error)
NewClusterClient creates a client for k8s cluster
func ParseResourceList ¶
func ParseResourceList(resources map[core_v1.ResourceName]string) (map[core_v1.ResourceName]resource.Quantity, error)
ParseResourceList parse resouces from 'map[string]string' to 'ResourceList'
func ProjectSelector ¶
ProjectSelector is a selector for cyclone CRD resources which have corresponding project label
func SecretIntegration ¶
SecretIntegration returns integration name related to the secret
func TenantNamespace ¶
TenantNamespace gets namespace from given tenant name.
func TenantResourceQuota ¶
TenantResourceQuota returns resource quota name related the tenant
func UpdatePVC ¶
func UpdatePVC(tenantName, storageClass, size string, namespace string, client *kubernetes.Clientset) error
UpdatePVC delete the old pvc and recreate another one, so the data of the pvc will lost.
func UpdateResourceQuota ¶
UpdateResourceQuota updates resource quota for tenant
func WorkerClustersSelector ¶
func WorkerClustersSelector() string
WorkerClustersSelector is a selector for clusters which are use to perform workload
func WorkflowSelector ¶
WorkflowSelector is a selector for cyclone CRD resources which have corresponding workflow label
Types ¶
This section is empty.