Documentation
¶
Index ¶
Constants ¶
const (
// OpenapiV3JSONSchema is the key to store OpenAPI v3 JSON schema in ConfigMap
OpenapiV3JSONSchema string = "openapi-v3-json-schema"
// UISchema is the key to store ui custom schema
UISchema string = "ui-schema"
// VelaQLConfigmapKey is the key to store velaql view
VelaQLConfigmapKey string = "template"
)
const (
ReasonParsed = "Parsed"
ReasonRendered = "Rendered"
ReasonPolicyGenerated = "PolicyGenerated"
ReasonRevisoned = "Revisioned"
ReasonApplied = "Applied"
ReasonDeployed = "Deployed"
ReasonFailedParse = "FailedParse"
ReasonFailedRevision = "FailedRevision"
ReasonFailedWorkflow = "FailedWorkflow"
ReasonFailedApply = "FailedApply"
ReasonFailedStateKeep = "FailedStateKeep"
ReasonFailedGC = "FailedGC"
)
reason for Application
const (
MessageParsed = "Parsed successfully"
MessageRendered = "Rendered successfully"
MessagePolicyGenerated = "Policy generated successfully"
MessageRevisioned = "Revisioned successfully"
MessageWorkflowFinished = "Workflow finished"
MessageDeployed = "Deployed successfully"
)
event message for Application
const (
// ClusterLocalName the name for the hub cluster
ClusterLocalName = "local"
// CredentialTypeInternal identifies the virtual cluster from internal kubevela system
CredentialTypeInternal v1alpha1.CredentialType = "Internal"
// CredentialTypeOCMManagedCluster identifies the virtual cluster from ocm
CredentialTypeOCMManagedCluster v1alpha1.CredentialType = "ManagedCluster"
// ClusterBlankEndpoint identifies the endpoint of a cluster as blank (not available)
ClusterBlankEndpoint = "-"
// ClustersArg indicates the argument for specific clusters to install addon
ClustersArg = "clusters"
)
const (
// KubeVelaName name of kubevela
KubeVelaName = "kubevela"
// VelaCoreName name of vela-core
VelaCoreName = "vela-core"
)
const (
// DefaultKubeVelaReleaseName defines the default name of KubeVela Release
DefaultKubeVelaReleaseName = "kubevela"
// DefaultKubeVelaChartName defines the default chart name of KubeVela, this variable MUST align to the chart name of this repo
DefaultKubeVelaChartName = "vela-core"
// DefaultKubeVelaVersion defines the default version needed for KubeVela chart
DefaultKubeVelaVersion = ">0.0.0-0"
// DefaultEnvName defines the default environment name for Apps created by KubeVela
DefaultEnvName = "default"
// DefaultAppNamespace defines the default K8s namespace for Apps created by KubeVela
DefaultAppNamespace = "default"
// AutoDetectWorkloadDefinition defines the default workload type for ComponentDefinition which doesn't specify a workload
AutoDetectWorkloadDefinition = "autodetects.core.oam.dev"
// KubeVelaControllerDeployment defines the KubeVela controller's deployment name
KubeVelaControllerDeployment = "kubevela-vela-core"
)
const (
// AnnoDefinitionDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
AnnoDefinitionDescription = "definition.oam.dev/description"
// AnnoDefinitionExampleURL is the annotation which describe url of usage examples of the capability, it will be loaded in documentation generate.
AnnoDefinitionExampleURL = "definition.oam.dev/example-url"
// AnnoDefinitionAlias is the annotation for definition alias
AnnoDefinitionAlias = "definition.oam.dev/alias"
// AnnoDefinitionIcon is the annotation which describe the icon url
AnnoDefinitionIcon = "definition.oam.dev/icon"
// AnnoDefinitionAppliedWorkloads is the annotation which describe what is the workloads used for in a TraitDefinition Object
AnnoDefinitionAppliedWorkloads = "definition.oam.dev/appliedWorkloads"
// LabelDefinition is the label for definition
LabelDefinition = "definition.oam.dev"
// LabelDefinitionName is the label for definition name
LabelDefinitionName = "definition.oam.dev/name"
// LabelDefinitionDeprecated is the label which describe whether the capability is deprecated
LabelDefinitionDeprecated = "custom.definition.oam.dev/deprecated"
// LabelDefinitionHidden is the label which describe whether the capability is hidden by UI
LabelDefinitionHidden = "custom.definition.oam.dev/ui-hidden"
// LabelNodeRoleGateway gateway role of node
LabelNodeRoleGateway = "node-role.kubernetes.io/gateway"
// LabelNodeRoleWorker worker role of node
LabelNodeRoleWorker = "node-role.kubernetes.io/worker"
// AnnoIngressControllerHTTPSPort define ingress controller listen port for https
AnnoIngressControllerHTTPSPort = "ingress.controller/https-port"
// AnnoIngressControllerHTTPPort define ingress controller listen port for http
AnnoIngressControllerHTTPPort = "ingress.controller/http-port"
// AnnoIngressControllerHost define ingress controller externally host
AnnoIngressControllerHost = "ingress.controller/host"
// LabelConfigType is the label marked as the template that generated the config.
LabelConfigType = "config.oam.dev/type"
// LabelConfigCatalog is the label marked as the secret generated from the config.
LabelConfigCatalog = "config.oam.dev/catalog"
// LabelConfigSubType is the sub-type for a config type
LabelConfigSubType = "config.oam.dev/sub-type"
// LabelConfigProject is the label for config project
LabelConfigProject = "config.oam.dev/project"
// LabelConfigSyncToMultiCluster is the label to decide whether a config will be synchronized to multi-cluster
LabelConfigSyncToMultiCluster = "config.oam.dev/multi-cluster"
// LabelConfigIdentifier is the label for config identifier
LabelConfigIdentifier = "config.oam.dev/identifier"
// LabelConfigScope is the label for config scope
LabelConfigScope = "config.oam.dev/scope"
// AnnotationConfigSensitive is the annotation for the sensitization
AnnotationConfigSensitive = "config.oam.dev/sensitive"
// AnnotationConfigTemplateNamespace is the annotation for the template namespace
AnnotationConfigTemplateNamespace = "config.oam.dev/template-namespace"
// AnnotationConfigDescription is the annotation for config description
AnnotationConfigDescription = "config.oam.dev/description"
// AnnotationConfigAlias is the annotation for config alias
AnnotationConfigAlias = "config.oam.dev/alias"
// AnnotationConfigDistributionSpec is the annotation key of the application that distributes the configs
AnnotationConfigDistributionSpec = "config.oam.dev/distribution-spec"
)
const (
// StatusDeployed represents the App was deployed
StatusDeployed = "Deployed"
// StatusStaging represents the App was changed locally and it's spec is diff from the deployed one, or not deployed at all
StatusStaging = "Staging"
)
const (
// TagCommandType used for tag cli category
TagCommandType = "commandType"
// TagCommandOrder defines the order
TagCommandOrder = "commandOrder"
// TypeStart defines one category
TypeStart = "Getting Started"
// TypeApp defines one category
TypeApp = "Managing Applications"
// TypeCD defines workflow Management operations
TypeCD = "Continuous Delivery"
// TypeExtension defines one category
TypeExtension = "Managing Extensions"
// TypeSystem defines one category
TypeSystem = "System Tools"
// TypeAuxiliary defines auxiliary commands
TypeAuxiliary = "Auxiliary Tools"
// TypePlatform defines platform management commands
TypePlatform = "Managing Platform"
// TypeLegacy defines legacy commands
TypeLegacy = "Legacy Commands"
)
const (
// TerraformProvider is the config type for terraform provider
TerraformProvider = "terraform-provider"
// DexConnector is the config type for dex connector
DexConnector = "dex-connector"
// ImageRegistry is the config type for image registry
ImageRegistry = "image-registry"
// HelmRepository is the config type for Helm chart repository
HelmRepository = "helm-repository"
// CatalogConfigDistribution is the catalog type
CatalogConfigDistribution = "config-distribution"
)
const (
// TerraformComponentPrefix is the prefix of component type of terraform-xxx
TerraformComponentPrefix = "terraform-"
// ProviderAppPrefix is the prefix of the application to create a Terraform Provider
ProviderAppPrefix = "config-terraform-provider"
// ProviderNamespace is the namespace of Terraform Cloud Provider
ProviderNamespace = "default"
// VelaCoreConfig is to mark application, config and its secret or Terraform provider lelong to a KubeVela config
VelaCoreConfig = "velacore-config"
)
const (
// LabelSourceOfTruth describes the source of this app
LabelSourceOfTruth = "app.oam.dev/source-of-truth"
// FromCR means the data source of truth is from k8s CR
FromCR = "from-k8s-resource"
// FromUX means the data source of truth is from velaux data store
FromUX = "from-velaux"
// FromInner means the data source of truth is from KubeVela inner usage
// the configuration that don't want to be synced
// the addon application should be synced, but set to readonly mode
FromInner = "from-inner-system"
)
const CapabilityConfigMapNamePrefix = "schema-"
CapabilityConfigMapNamePrefix is the prefix for capability ConfigMap name
const LabelArg = "label"
LabelArg is the argument `label` of a definition
Variables ¶
var (
// AnnotationClusterVersion the annotation key for cluster version
AnnotationClusterVersion = config.MetaApiGroupName + "/cluster-version"
)
var DefaultFilterAnnots = []string{
oam.AnnotationInplaceUpgrade,
oam.AnnotationFilterLabelKeys,
oam.AnnotationFilterAnnotationKeys,
oam.AnnotationLastAppliedConfiguration,
}
DefaultFilterAnnots are annotations that won't pass to workload or trait
var DefaultKubeVelaNS = "vela-system"
DefaultKubeVelaNS defines the default KubeVela namespace in Kubernetes
Functions ¶
This section is empty.
Types ¶
type CRDInfo ¶
type CRDInfo struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
}
CRDInfo record the CRD info of the Capability
type CapType ¶
type CapType string
CapType defines the type of capability
const (
// TypeComponentDefinition represents OAM ComponentDefinition
TypeComponentDefinition CapType = "componentDefinition"
// TypeWorkload represents OAM Workload
TypeWorkload CapType = "workload"
// TypeTrait represents OAM Trait
TypeTrait CapType = "trait"
// TypeWorkflowStep represent OAM Workflow
TypeWorkflowStep CapType = "workflowstep"
// TypePolicy represent OAM Policy
TypePolicy CapType = "policy"
)
type Capability ¶
type Capability struct {
Name string `json:"name"`
Type CapType `json:"type"`
CueTemplate string `json:"template,omitempty"`
CueTemplateURI string `json:"templateURI,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
CrdName string `json:"crdName,omitempty"`
Status string `json:"status,omitempty"`
Description string `json:"description,omitempty"`
Example string `json:"example,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Category CapabilityCategory `json:"category,omitempty"`
// trait only
AppliesTo []string `json:"appliesTo,omitempty"`
// Namespace represents it's a system-level or user-level capability.
Namespace string `json:"namespace,omitempty"`
// Plugin Source
Source *Source `json:"source,omitempty"`
// Terraform
TerraformConfiguration string `json:"terraformConfiguration,omitempty"`
ConfigurationType string `json:"configurationType,omitempty"`
Path string `json:"path,omitempty"`
}
Capability defines the content of a capability
type CapabilityCategory ¶ added in v0.3.1
type CapabilityCategory string
CapabilityCategory defines the category of a capability
const (
TerraformCategory CapabilityCategory = "terraform"
CUECategory CapabilityCategory = "cue"
)
categories of capability schematic
type ClusterVersion ¶ added in v1.6.0
type ClusterVersion struct {
Major string `json:"major"`
Minor string `json:"minor"`
GitVersion string `json:"gitVersion,omitempty"`
Platform string `json:"platform,omitempty"`
}
ClusterVersion defines the Version info of managed clusters.
var ControlPlaneClusterVersion ClusterVersion
ControlPlaneClusterVersion will be the default value of cluster info if managed cluster version get error, it will have value when vela-core started.
type ComponentManifest ¶ added in v1.1.0
type ComponentManifest struct {
Name string
Namespace string
RevisionName string
RevisionHash string
// ComponentOutput contains K8s resource generated from "output" block of ComponentDefinition
ComponentOutput *unstructured.Unstructured
// ComponentOutputsAndTraits contains both resources generated from "outputs" block of ComponentDefinition and resources generated from TraitDefinition
ComponentOutputsAndTraits []*unstructured.Unstructured
}
ComponentManifest contains resources rendered from an application component.
type EnvMeta ¶
type EnvMeta struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Labels string `json:"labels"`
Current string `json:"current"`
}
EnvMeta stores the namespace for app environment
type Parameter ¶
type Parameter struct {
Name string `json:"name"`
Short string `json:"short,omitempty"`
Required bool `json:"required,omitempty"`
Default interface{} `json:"default,omitempty"`
Usage string `json:"usage,omitempty"`
Ignore bool `json:"ignore,omitempty"`
Type cue.Kind `json:"type,omitempty"`
Alias string `json:"alias,omitempty"`
JSONType string `json:"jsonType,omitempty"`
}
Parameter defines a parameter for cli from capability template