mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-28 00:33:56 +00:00
Compare commits
119 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00ee2bfad4 | ||
|
|
e6445f7458 | ||
|
|
debc0da3b6 | ||
|
|
ea823db8ea | ||
|
|
fb8c33af8d | ||
|
|
974027e233 | ||
|
|
cb946bff95 | ||
|
|
f22c8995f4 | ||
|
|
550d708637 | ||
|
|
1a592496a1 | ||
|
|
a5eb3161eb | ||
|
|
ffa965d637 | ||
|
|
ef16da72f5 | ||
|
|
19657d488f | ||
|
|
b9fc2180c5 | ||
|
|
daef0523fa | ||
|
|
3269c4f48f | ||
|
|
2526760080 | ||
|
|
5ec22917a1 | ||
|
|
efb76ee5ee | ||
|
|
47222606dd | ||
|
|
fe81ed1653 | ||
|
|
51fe5e7c7b | ||
|
|
3e6002cc95 | ||
|
|
6792d7ded1 | ||
|
|
2b2eb9701c | ||
|
|
93559a2f01 | ||
|
|
ecf3f5d664 | ||
|
|
54e30b1f8b | ||
|
|
de7bb9ba46 | ||
|
|
c1d6dedb5d | ||
|
|
9a89699691 | ||
|
|
34819f8d80 | ||
|
|
6486b7878f | ||
|
|
9fcfb7e1df | ||
|
|
8d4fe38cc3 | ||
|
|
48052e59ee | ||
|
|
b0c9e4b78a | ||
|
|
4e7af35e61 | ||
|
|
4264a63613 | ||
|
|
f90140ee5b | ||
|
|
57dc83976d | ||
|
|
2a88bf271a | ||
|
|
84a17764ed | ||
|
|
98a6d7a8cf | ||
|
|
dd5a74235d | ||
|
|
c10cbead76 | ||
|
|
28e417ef47 | ||
|
|
43a674b6f7 | ||
|
|
cfab53f97b | ||
|
|
df7dca81da | ||
|
|
22b6e87d58 | ||
|
|
4b768c49a6 | ||
|
|
cd4615405f | ||
|
|
ccc3576a4c | ||
|
|
3dd5e493c6 | ||
|
|
e120e141ee | ||
|
|
e794da5492 | ||
|
|
7031e04c75 | ||
|
|
e8de0e29df | ||
|
|
d67ce4d2a1 | ||
|
|
40ab610a8e | ||
|
|
78b1c5b32c | ||
|
|
7b957df709 | ||
|
|
3edc6ed317 | ||
|
|
c43dad4907 | ||
|
|
b4b9fcfaf0 | ||
|
|
3af42feb02 | ||
|
|
16ddba80b3 | ||
|
|
32bb102a86 | ||
|
|
0fcc6498cb | ||
|
|
ab72ddbea4 | ||
|
|
10d360c03c | ||
|
|
4b609e0fff | ||
|
|
49e8aca2bd | ||
|
|
c5ecd0aff3 | ||
|
|
adac554333 | ||
|
|
c6e15fae2d | ||
|
|
7f75d22ab6 | ||
|
|
e148a901a9 | ||
|
|
9c5e156e23 | ||
|
|
626eb5eb68 | ||
|
|
72f3d22942 | ||
|
|
07351d9dd7 | ||
|
|
6ac7e88a63 | ||
|
|
36d2b9e761 | ||
|
|
1681fe7de2 | ||
|
|
214a5ee4aa | ||
|
|
e69548a72a | ||
|
|
877b7b8cb6 | ||
|
|
2476f83b1b | ||
|
|
c9929cf7cf | ||
|
|
8b9c927572 | ||
|
|
b59fe17f4d | ||
|
|
645fd3f917 | ||
|
|
15e1564983 | ||
|
|
c24c039b15 | ||
|
|
8e2205ef07 | ||
|
|
cd3c91b537 | ||
|
|
f6e3fc31d1 | ||
|
|
1f5d3bde7b | ||
|
|
0fc1c3132e | ||
|
|
f18ee6586a | ||
|
|
da8457fbf0 | ||
|
|
29e97a6040 | ||
|
|
5c0f26c6f6 | ||
|
|
fd3f300901 | ||
|
|
025ce5d74d | ||
|
|
bbb2c527d9 | ||
|
|
65db8753de | ||
|
|
890aef14f3 | ||
|
|
7371496f27 | ||
|
|
f792bf2bbf | ||
|
|
9ca4f64030 | ||
|
|
d5909a13f3 | ||
|
|
9b5c72e5ad | ||
|
|
88d3042767 | ||
|
|
9f6e53269d | ||
|
|
66f157cca7 |
4
.github/workflows/dashboard.yml
vendored
4
.github/workflows/dashboard.yml
vendored
@@ -4,6 +4,10 @@ on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./dashboard
|
||||
|
||||
5
.github/workflows/e2e.yml
vendored
5
.github/workflows/e2e.yml
vendored
@@ -5,6 +5,9 @@ on:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -19,7 +22,7 @@ jobs:
|
||||
go get -v -t -d ./...
|
||||
|
||||
- name: Setup Kind Cluster
|
||||
uses: engineerd/setup-kind@v0.4.0
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
with:
|
||||
version: "v0.7.0"
|
||||
skipClusterCreation: true
|
||||
|
||||
7
.github/workflows/go.yml
vendored
7
.github/workflows/go.yml
vendored
@@ -5,6 +5,9 @@ on:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -25,12 +28,12 @@ jobs:
|
||||
sudo apt-get install -y golang-ginkgo-dev
|
||||
|
||||
- name: Setup Kind Cluster
|
||||
uses: engineerd/setup-kind@v0.4.0
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
with:
|
||||
version: "v0.7.0"
|
||||
|
||||
- name: install Kubebuilder
|
||||
uses: RyanSiu1995/kubebuilder-action@v1
|
||||
uses: wonderflow/kubebuilder-action@v1.1
|
||||
|
||||
- name: Run Make test
|
||||
run: make test
|
||||
|
||||
@@ -14,6 +14,8 @@ contributing to `kubevela` or build a PoC (Proof of Concept).
|
||||
3. ginkgo 1.14.0+ (just for [E2E test](https://github.com/oam-dev/kubevela/blob/master/DEVELOPMENT.md#e2e-test))
|
||||
4. golangci-lint 1.31.0+, it will install automatically if you run `make`, you can [install it manually](https://golangci-lint.run/usage/install/#local-installation) if the installation is too slow.
|
||||
|
||||
We also recommend you to learn about KubeVela's [design](docs/en/design.md) before dive into its code.
|
||||
|
||||
## Build
|
||||
|
||||
* Clone this project
|
||||
|
||||
36
Makefile
36
Makefile
@@ -1,14 +1,14 @@
|
||||
# Vela version
|
||||
VELA_VERSION ?= 0.1.0
|
||||
# Repo info
|
||||
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
|
||||
VELA_VERSION_VAR := github.com/oam-dev/kubevela/version.VelaVersion
|
||||
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
|
||||
VELA_VERSION_VAR := github.com/oam-dev/kubevela/version.VelaVersion
|
||||
VELA_GITVERSION_VAR := github.com/oam-dev/kubevela/version.GitRevision
|
||||
LDFLAGS ?= "-X $(VELA_VERSION_VAR)=$(VELA_VERSION) -X $(VELA_GITVERSION_VAR)=$(GIT_COMMIT)"
|
||||
LDFLAGS ?= "-X $(VELA_VERSION_VAR)=$(VELA_VERSION) -X $(VELA_GITVERSION_VAR)=$(GIT_COMMIT)"
|
||||
|
||||
GOX = go run github.com/mitchellh/gox
|
||||
TARGETS := darwin/amd64 linux/amd64 windows/amd64
|
||||
DIST_DIRS := find * -type d -exec
|
||||
GOX = go run github.com/mitchellh/gox
|
||||
TARGETS := darwin/amd64 linux/amd64 windows/amd64
|
||||
DIST_DIRS := find * -type d -exec
|
||||
|
||||
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
|
||||
ifeq (,$(shell go env GOBIN))
|
||||
@@ -38,8 +38,8 @@ npm-build:
|
||||
npm-install:
|
||||
cd dashboard && npm install && cd ./..
|
||||
|
||||
generate-doc:
|
||||
rm -r docs/cli/*
|
||||
doc-gen:
|
||||
rm -r docs/en/cli/*
|
||||
go run hack/docgen/gen.go
|
||||
|
||||
generate-source:
|
||||
@@ -64,8 +64,9 @@ run: fmt vet
|
||||
go run ./cmd/core/main.go
|
||||
|
||||
# Run go fmt against code
|
||||
fmt:
|
||||
fmt: goimports
|
||||
go fmt ./...
|
||||
$(GOIMPORTS) -local github.com/oam-dev/kubevela -w ./pkg ./cmd
|
||||
./hack/cue-fmt.sh
|
||||
|
||||
# Run go vet against code
|
||||
@@ -126,10 +127,12 @@ core-run: generate fmt vet manifests
|
||||
|
||||
# Install CRDs and Definitions of Vela Core into a cluster, this is for develop convenient.
|
||||
core-install: manifests
|
||||
kubectl apply -f hack/namespace.yaml
|
||||
kubectl apply -f charts/vela-core/crds/
|
||||
kubectl apply -f charts/vela-core/templates/defwithtemplate/
|
||||
kubectl apply -f charts/vela-core/templates/definitions/
|
||||
bin/vela system update
|
||||
kubectl apply -f charts/vela-core/templates/velaConfig.yaml
|
||||
bin/vela workloads
|
||||
|
||||
# Uninstall CRDs and Definitions of Vela Core from a cluster, this is for develop convenient.
|
||||
core-uninstall: manifests
|
||||
@@ -140,6 +143,7 @@ core-uninstall: manifests
|
||||
# Generate manifests e.g. CRD, RBAC etc.
|
||||
manifests: controller-gen
|
||||
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=charts/vela-core/crds
|
||||
go generate $(foreach t,pkg api,./$(t)/...)
|
||||
./hack/vela-templates/gen_definitions.sh
|
||||
|
||||
# Generate code
|
||||
@@ -182,3 +186,15 @@ GOLANGCILINT=$(GOBIN)/golangci-lint
|
||||
else
|
||||
GOLANGCILINT=$(shell which golangci-lint)
|
||||
endif
|
||||
|
||||
.PHONY: goimports
|
||||
goimports:
|
||||
ifeq (, $(shell which goimports))
|
||||
@{ \
|
||||
set -e ;\
|
||||
GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports ;\
|
||||
}
|
||||
GOIMPORTS=$(GOBIN)/goimports
|
||||
else
|
||||
GOIMPORTS=$(shell which goimports)
|
||||
endif
|
||||
19
README.md
19
README.md
@@ -1,4 +1,13 @@
|
||||

|
||||

|
||||
[](https://goreportcard.com/report/github.com/oam-dev/kubevela)
|
||||

|
||||
[](https://codecov.io/gh/oam-dev/kubevela)
|
||||
[](/LICENSE)
|
||||
[](https://github.com/oam-dev/kubevela/releases)
|
||||
[](https://www.tickgit.com/browse?repo=github.com/oam-dev/kubevela)
|
||||
[](https://twitter.com/oam_dev)
|
||||
|
||||

|
||||
|
||||
*Make shipping applications more enjoyable.*
|
||||
|
||||
@@ -11,18 +20,18 @@ For platform builders, KubeVela serves as a framework that empowers them to crea
|
||||
- Slack: [Discuss](https://cloud-native.slack.com/archives/C01BLQ3HTJA)
|
||||
- Gitter: [Community](https://gitter.im/oam-dev/community)
|
||||
|
||||
> NOTE: KubeVela is still in early stage and iterating quickly. It's currently under preview release.
|
||||
|
||||
## Quick Start
|
||||
|
||||
Quick start guides are available on [this section](docs/quick-start.md).
|
||||
Quick start guides are available on [this section](https://kubevela.io/#/en/quick-start).
|
||||
|
||||
## Documentation
|
||||
|
||||
Full documentation is available on the [documentation section](docs/README.md).
|
||||
For full documentation, please visit the KubeVela website: [https://kubevela.io](https://kubevela.io/).
|
||||
|
||||
## Contributing
|
||||
Check out [CONTRIBUTING](./CONTRIBUTING.md) to see how to develop with KubeVela.
|
||||
|
||||
## Code of Conduct
|
||||
This project has adopted the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). See [CODE OF CONDUCT](CODE_OF_CONDUCT.md) for details.
|
||||
|
||||
> NOTE: KubeVela is an early project and iterating quickly to continue to make it easier to ship applications and build platforms atop. It's still under preview release for now.
|
||||
2
api/api.go
Normal file
2
api/api.go
Normal file
@@ -0,0 +1,2 @@
|
||||
// package api contains all api types of KubeVela
|
||||
package api
|
||||
@@ -34,10 +34,10 @@ type ApplicationDeploymentStatus struct {
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
}
|
||||
|
||||
// ApplicationDeployment is the Schema for the ApplicationDeployment API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
// ApplicationDeployment is the Schema for the ApplicationDeployment API
|
||||
type ApplicationDeployment struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
@@ -46,8 +46,8 @@ type ApplicationDeployment struct {
|
||||
Status ApplicationDeploymentStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// ApplicationDeploymentList contains a list of ApplicationDeployment
|
||||
// +kubebuilder:object:root=true
|
||||
type ApplicationDeploymentList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
|
||||
8
api/generate.go
Normal file
8
api/generate.go
Normal file
@@ -0,0 +1,8 @@
|
||||
// +build generate
|
||||
|
||||
// See the below link for details on what is happening here.
|
||||
// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
|
||||
|
||||
//go:generate go run ../hack/crd/update.go ../charts/vela-core/crds/
|
||||
|
||||
package api
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// Args is args for controller-runtime client
|
||||
type Args struct {
|
||||
Config *rest.Config
|
||||
Schema *runtime.Scheme
|
||||
|
||||
@@ -26,12 +26,14 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// Source record the source of Capability
|
||||
type Source struct {
|
||||
RepoName string `json:"repoName"`
|
||||
ChartName string `json:"chartName,omitempty"`
|
||||
}
|
||||
|
||||
type CrdInfo struct {
|
||||
// CRDInfo record the CRD info of the Capability
|
||||
type CRDInfo struct {
|
||||
APIVersion string `json:"apiVersion"`
|
||||
Kind string `json:"kind"`
|
||||
}
|
||||
@@ -55,29 +57,38 @@ type Capability struct {
|
||||
// Plugin Source
|
||||
Source *Source `json:"source,omitempty"`
|
||||
Install *Installation `json:"install,omitempty"`
|
||||
CrdInfo *CrdInfo `json:"crdInfo,omitempty"`
|
||||
CrdInfo *CRDInfo `json:"crdInfo,omitempty"`
|
||||
}
|
||||
|
||||
// Chart defines all necessary information to install a whole chart
|
||||
type Chart struct {
|
||||
Repo string `json:"repo"`
|
||||
URL string `json:"url"`
|
||||
Name string `json:"name"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Version string `json:"version"`
|
||||
Repo string `json:"repo"`
|
||||
URL string `json:"url"`
|
||||
Name string `json:"name"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Version string `json:"version"`
|
||||
Values map[string]interface{} `json:"values"`
|
||||
}
|
||||
|
||||
// Installation defines the installation method for this Capability, currently only helm is supported
|
||||
type Installation struct {
|
||||
Helm Chart `json:"helm"`
|
||||
//TODO(wonderflow) add raw yaml file support for install capability
|
||||
}
|
||||
|
||||
// CapType defines the type of capability
|
||||
type CapType string
|
||||
|
||||
const (
|
||||
// TypeWorkload represents OAM Workload
|
||||
TypeWorkload CapType = "workload"
|
||||
TypeTrait CapType = "trait"
|
||||
TypeScope CapType = "scope"
|
||||
// TypeTrait represents OAM Trait
|
||||
TypeTrait CapType = "trait"
|
||||
// TypeScope represent OAM Scope
|
||||
TypeScope CapType = "scope"
|
||||
)
|
||||
|
||||
// Parameter defines a parameter for cli from capability template
|
||||
type Parameter struct {
|
||||
Name string `json:"name"`
|
||||
Short string `json:"short,omitempty"`
|
||||
@@ -92,11 +103,8 @@ type Parameter struct {
|
||||
func ConvertTemplateJSON2Object(in *runtime.RawExtension) (Capability, error) {
|
||||
var t Capability
|
||||
var extension Capability
|
||||
if in == nil {
|
||||
return t, fmt.Errorf("extension field is nil")
|
||||
}
|
||||
if in.Raw == nil {
|
||||
return t, fmt.Errorf("template object is nil")
|
||||
if in == nil || in.Raw == nil {
|
||||
return t, fmt.Errorf("no template found")
|
||||
}
|
||||
err := json.Unmarshal(in.Raw, &extension)
|
||||
if err == nil {
|
||||
@@ -105,6 +113,7 @@ func ConvertTemplateJSON2Object(in *runtime.RawExtension) (Capability, error) {
|
||||
return t, err
|
||||
}
|
||||
|
||||
// SetFlagBy set cli flag from Parameter
|
||||
func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
|
||||
name := v.Name
|
||||
if v.Alias != "" {
|
||||
@@ -144,6 +153,7 @@ func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
|
||||
}
|
||||
}
|
||||
|
||||
// CapabilityCmpOptions will set compare option
|
||||
var CapabilityCmpOptions = []cmp.Option{
|
||||
cmp.Comparer(func(a, b Parameter) bool {
|
||||
if a.Name != b.Name || a.Short != b.Short || a.Required != b.Required ||
|
||||
@@ -188,7 +198,7 @@ var CapabilityCmpOptions = []cmp.Option{
|
||||
case int:
|
||||
va = float64(vala)
|
||||
case float64:
|
||||
va = float64(vala)
|
||||
va = vala
|
||||
}
|
||||
switch valb := b.Default.(type) {
|
||||
case int64:
|
||||
@@ -205,6 +215,7 @@ var CapabilityCmpOptions = []cmp.Option{
|
||||
return true
|
||||
})}
|
||||
|
||||
// EqualCapability will check whether two capabilities is equal
|
||||
func EqualCapability(a, b Capability) bool {
|
||||
return cmp.Equal(a, b, CapabilityCmpOptions...)
|
||||
}
|
||||
|
||||
@@ -1,28 +1,33 @@
|
||||
package types
|
||||
|
||||
const (
|
||||
DefaultOAMNS = "vela-system"
|
||||
DefaultOAMReleaseName = "kubevela"
|
||||
DefaultOAMRuntimeChartName = "vela-core"
|
||||
DefaultOAMVersion = ">0.0.0-0"
|
||||
|
||||
DefaultEnvName = "default"
|
||||
// DefaultKubeVelaNS defines the default KubeVela namespace in Kubernetes
|
||||
DefaultKubeVelaNS = "vela-system"
|
||||
// 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"
|
||||
)
|
||||
|
||||
const (
|
||||
AnnAPIVersion = "definition.oam.dev/apiVersion"
|
||||
AnnKind = "definition.oam.dev/kind"
|
||||
// AnnDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
|
||||
AnnDescription = "definition.oam.dev/description"
|
||||
|
||||
LabelPodSpecable = "workload.oam.dev/podspecable"
|
||||
)
|
||||
|
||||
const (
|
||||
// StatusDeployed represents the App was deployed
|
||||
StatusDeployed = "Deployed"
|
||||
StatusStaging = "Staging"
|
||||
// StatusStaging represents the App was changed locally and it's spec is diff from the deployed one, or not deployed at all
|
||||
StatusStaging = "Staging"
|
||||
)
|
||||
|
||||
// EnvMeta stores the info for app environment
|
||||
type EnvMeta struct {
|
||||
Name string `json:"name"`
|
||||
Namespace string `json:"namespace"`
|
||||
@@ -35,12 +40,14 @@ type EnvMeta struct {
|
||||
}
|
||||
|
||||
const (
|
||||
// TagCommandType used for tag cli category
|
||||
TagCommandType = "commandType"
|
||||
|
||||
TypeStart = "Getting Started"
|
||||
TypeApp = "Applications"
|
||||
TypeTraits = "Traits"
|
||||
TypeRelease = "Release"
|
||||
TypeOthers = "Others"
|
||||
TypeSystem = "System"
|
||||
// TypeStart defines one category
|
||||
TypeStart = "Getting Started"
|
||||
// TypeApp defines one category
|
||||
TypeApp = "Managing Applications"
|
||||
// TypeCap defines one category
|
||||
TypeCap = "Managing Capabilities"
|
||||
// TypeSystem defines one category
|
||||
TypeSystem = "System"
|
||||
)
|
||||
|
||||
@@ -30,9 +30,9 @@ type Protocol string
|
||||
// TriggerType defines the type of trigger
|
||||
type TriggerType string
|
||||
|
||||
// Autoscaler is the Schema for the autoscalers API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// Autoscaler is the Schema for the autoscalers API
|
||||
type Autoscaler struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
@@ -41,18 +41,22 @@ type Autoscaler struct {
|
||||
Status AutoscalerStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// SetConditions set condition for CR status
|
||||
func (as *Autoscaler) SetConditions(c ...v1alpha1.Condition) {
|
||||
as.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition get condition from CR status
|
||||
func (as *Autoscaler) GetCondition(conditionType v1alpha1.ConditionType) v1alpha1.Condition {
|
||||
return as.Status.GetCondition(conditionType)
|
||||
}
|
||||
|
||||
// GetWorkloadReference get workload reference
|
||||
func (as *Autoscaler) GetWorkloadReference() v1alpha1.TypedReference {
|
||||
return as.Spec.WorkloadReference
|
||||
}
|
||||
|
||||
// SetWorkloadReference set workload reference
|
||||
func (as *Autoscaler) SetWorkloadReference(reference v1alpha1.TypedReference) {
|
||||
as.Spec.WorkloadReference = reference
|
||||
}
|
||||
|
||||
@@ -99,20 +99,22 @@ func init() {
|
||||
|
||||
var _ oam.Trait = &MetricsTrait{}
|
||||
|
||||
// SetConditions for set CR condition
|
||||
func (tr *MetricsTrait) SetConditions(c ...runtimev1alpha1.Condition) {
|
||||
tr.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition for get CR condition
|
||||
func (tr *MetricsTrait) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
|
||||
return tr.Status.GetCondition(c)
|
||||
}
|
||||
|
||||
// GetWorkloadReference of this ManualScalerTrait.
|
||||
// GetWorkloadReference of this MetricsTrait.
|
||||
func (tr *MetricsTrait) GetWorkloadReference() runtimev1alpha1.TypedReference {
|
||||
return tr.Spec.WorkloadReference
|
||||
}
|
||||
|
||||
// SetWorkloadReference of this ManualScalerTrait.
|
||||
// SetWorkloadReference of this MetricsTrait.
|
||||
func (tr *MetricsTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference) {
|
||||
tr.Spec.WorkloadReference = r
|
||||
}
|
||||
|
||||
@@ -73,10 +73,12 @@ func init() {
|
||||
|
||||
var _ oam.Workload = &PodSpecWorkload{}
|
||||
|
||||
// SetConditions set condition for this CR
|
||||
func (in *PodSpecWorkload) SetConditions(c ...cpv1alpha1.Condition) {
|
||||
in.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition set condition for this CR
|
||||
func (in *PodSpecWorkload) GetCondition(c cpv1alpha1.ConditionType) cpv1alpha1.Condition {
|
||||
return in.Status.GetCondition(c)
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ type Rule struct {
|
||||
Backend *Backend `json:"backend,omitempty"`
|
||||
}
|
||||
|
||||
// TLS defines certificate issuer and type for mTLS configuration
|
||||
type TLS struct {
|
||||
IssuerName string `json:"issuerName,omitempty"`
|
||||
|
||||
@@ -74,13 +75,17 @@ type TLS struct {
|
||||
Type IssuerType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// IssuerType defines the type of issuer
|
||||
type IssuerType string
|
||||
|
||||
const (
|
||||
ClusterIssuer IssuerType = "ClusterIssuer"
|
||||
// ClusterIssuer is a cluster level type of issuer
|
||||
ClusterIssuer IssuerType = "ClusterIssuer"
|
||||
// NamespaceIssuer is the default one
|
||||
NamespaceIssuer IssuerType = "Issuer"
|
||||
)
|
||||
|
||||
// Backend defines backend configure for route trait.
|
||||
// Route will automatically discover podSpec and label for BackendService.
|
||||
// If BackendService is already set, discovery won't work.
|
||||
// If BackendService is not set, the discovery mechanism will work.
|
||||
@@ -109,10 +114,10 @@ type RouteStatus struct {
|
||||
runtimev1alpha1.ConditionedStatus `json:",inline"`
|
||||
}
|
||||
|
||||
// Route is the Schema for the routes API
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:resource:categories={oam}
|
||||
// +kubebuilder:subresource:status
|
||||
// Route is the Schema for the routes API
|
||||
type Route struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
@@ -121,8 +126,8 @@ type Route struct {
|
||||
Status RouteStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// RouteList contains a list of Route
|
||||
// +kubebuilder:object:root=true
|
||||
type RouteList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
@@ -135,20 +140,22 @@ func init() {
|
||||
|
||||
var _ oam.Trait = &Route{}
|
||||
|
||||
// SetConditions set condition for CR status
|
||||
func (r *Route) SetConditions(c ...runtimev1alpha1.Condition) {
|
||||
r.Status.SetConditions(c...)
|
||||
}
|
||||
|
||||
// GetCondition get condition from CR status
|
||||
func (r *Route) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition {
|
||||
return r.Status.GetCondition(c)
|
||||
}
|
||||
|
||||
// GetWorkloadReference of this ManualScalerTrait.
|
||||
// GetWorkloadReference of this Route Trait.
|
||||
func (r *Route) GetWorkloadReference() runtimev1alpha1.TypedReference {
|
||||
return r.Spec.WorkloadReference
|
||||
}
|
||||
|
||||
// SetWorkloadReference of this ManualScalerTrait.
|
||||
// SetWorkloadReference of this Route Trait.
|
||||
func (r *Route) SetWorkloadReference(rt runtimev1alpha1.TypedReference) {
|
||||
r.Spec.WorkloadReference = rt
|
||||
}
|
||||
|
||||
@@ -1230,6 +1230,7 @@ spec:
|
||||
can be referred to by services.
|
||||
type: string
|
||||
protocol:
|
||||
default: TCP
|
||||
description: Protocol for port. Must be UDP, TCP,
|
||||
or SCTP. Defaults to "TCP".
|
||||
type: string
|
||||
@@ -2364,6 +2365,7 @@ spec:
|
||||
can be referred to by services.
|
||||
type: string
|
||||
protocol:
|
||||
default: TCP
|
||||
description: Protocol for port. Must be UDP, TCP,
|
||||
or SCTP. Defaults to "TCP".
|
||||
type: string
|
||||
@@ -3503,6 +3505,7 @@ spec:
|
||||
can be referred to by services.
|
||||
type: string
|
||||
protocol:
|
||||
default: TCP
|
||||
description: Protocol for port. Must be UDP, TCP,
|
||||
or SCTP. Defaults to "TCP".
|
||||
type: string
|
||||
|
||||
@@ -2,9 +2,6 @@ apiVersion: core.oam.dev/v1alpha2
|
||||
kind: ScopeDefinition
|
||||
metadata:
|
||||
name: healthscopes.core.oam.dev
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: core.oam.dev/v1alpha2
|
||||
definition.oam.dev/kind: HealthScope
|
||||
namespace: default
|
||||
spec:
|
||||
workloadRefsPath: spec.workloadRefs
|
||||
|
||||
@@ -3,33 +3,31 @@ kind: TraitDefinition
|
||||
metadata:
|
||||
name: autoscale
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: standard.oam.dev/v1alpha1
|
||||
definition.oam.dev/kind: Autoscaler
|
||||
definition.oam.dev/description: "Automatically scale workloads"
|
||||
definition.oam.dev/description: "Automatically scale the app following certain triggers or metrics"
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
- backend
|
||||
- deployments.apps
|
||||
- podspecworkload
|
||||
- worker
|
||||
workloadRefPath: spec.workloadRef
|
||||
definitionRef:
|
||||
name: autoscalers.standard.oam.dev
|
||||
extension:
|
||||
template: |
|
||||
import "strconv"
|
||||
|
||||
output: {
|
||||
apiVersion: "standard.oam.dev/v1alpha1"
|
||||
kind: "Autoscaler"
|
||||
spec: {
|
||||
minReplicas: parameter.min
|
||||
maxReplicas: parameter.max
|
||||
if parameter["cpu"] != _|_ && parameter["cron"] != _|_ {
|
||||
if parameter["cpuPercent"] != _|_ && parameter["cron"] != _|_ {
|
||||
triggers: [cpuScaler, cronScaler]
|
||||
}
|
||||
if parameter["cpu"] != _|_ && parameter["cron"] == _|_ {
|
||||
if parameter["cpuPercent"] != _|_ && parameter["cron"] == _|_ {
|
||||
triggers: [cpuScaler]
|
||||
}
|
||||
if parameter["cpu"] == _|_ && parameter["cron"] != _|_ {
|
||||
if parameter["cpuPercent"] == _|_ && parameter["cron"] != _|_ {
|
||||
triggers: [cronScaler]
|
||||
}
|
||||
}
|
||||
@@ -39,16 +37,23 @@ spec:
|
||||
type: "cpu"
|
||||
condition: {
|
||||
type: "Utilization"
|
||||
if parameter["cpu"] != _|_ {
|
||||
value: parameter.cpu
|
||||
if parameter["cpuPercent"] != _|_ {
|
||||
// Temporarily use `strconv` for type converting. This bug will be fixed in kubevela#585
|
||||
value: strconv.FormatInt(parameter.cpuPercent, 10)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cronScaler: {
|
||||
type: "cron"
|
||||
if parameter["cron"] != _|_ {
|
||||
condition: parameter.cron
|
||||
if parameter["cron"] != _|_ && parameter.cron["replicas"] != _|_ {
|
||||
condition: {
|
||||
startAt: parameter.cron.startAt
|
||||
duration: parameter.cron.duration
|
||||
days: parameter.cron.days
|
||||
replicas: strconv.FormatInt(parameter.cron.replicas, 10)
|
||||
timezone: parameter.cron.timezone
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,15 +63,19 @@ spec:
|
||||
// +usage=maximal replicas of the workload
|
||||
max: int
|
||||
// +usage=specify the value for CPU utilization, like 80, which means 80%
|
||||
cpu?: string
|
||||
// +alias=cpu-percent
|
||||
cpuPercent?: int
|
||||
// +usage=just for `appfile`, not available for Cli usage
|
||||
cron?: {
|
||||
startAt: string
|
||||
// +usage=the time to start scaling, like `08:00`
|
||||
startAt: string
|
||||
// +usage=for how long the scaling will last
|
||||
duration: string
|
||||
// +usage=several workdays or weekends, like "Monday, Tuesday"
|
||||
days: string
|
||||
replicas: string
|
||||
// +usage=timezone, like "America/Seattle"
|
||||
days: string
|
||||
// +usage=the target replicas to be scaled to
|
||||
replicas: int
|
||||
// +usage=timezone, like "America/Los_Angeles"
|
||||
timezone: string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,12 @@ apiVersion: core.oam.dev/v1alpha2
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: core.oam.dev/v1alpha2
|
||||
definition.oam.dev/kind: ManualScalerTrait
|
||||
definition.oam.dev/description: "Scale replica for workload"
|
||||
definition.oam.dev/description: "Manually scale the app"
|
||||
name: scaler
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
- containerizedworkloads.core.oam.dev
|
||||
- deployments.apps
|
||||
- worker
|
||||
definitionRef:
|
||||
name: manualscalertraits.core.oam.dev
|
||||
workloadRefPath: spec.workloadRef
|
||||
@@ -20,11 +17,11 @@ spec:
|
||||
apiVersion: "core.oam.dev/v1alpha2"
|
||||
kind: "ManualScalerTrait"
|
||||
spec: {
|
||||
replicaCount: parameter.replica
|
||||
replicaCount: parameter.replicas
|
||||
}
|
||||
}
|
||||
parameter: {
|
||||
//+short=r
|
||||
replica: *1 | int
|
||||
replicas: *1 | int
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
apiVersion: core.oam.dev/v1alpha2
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
name: metric
|
||||
name: metrics
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: standard.oam.dev/v1alpha1
|
||||
definition.oam.dev/kind: MetricsTrait
|
||||
definition.oam.dev/description: "Add metric monitoring for workload"
|
||||
definition.oam.dev/description: "Configure metrics targets to be monitored for the app"
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
- backend
|
||||
- task
|
||||
- containerizedworkloads.core.oam.dev
|
||||
- clonesetworkloads.apps.kruise.io
|
||||
- deployments.apps
|
||||
- statefulsets.apps
|
||||
definitionRef:
|
||||
name: metricstraits.standard.oam.dev
|
||||
workloadRefPath: spec.workloadRef
|
||||
@@ -31,7 +25,7 @@ spec:
|
||||
// +usage=format of the metrics, default as prometheus
|
||||
// +short=f
|
||||
format: *"prometheus" | string
|
||||
// +usage= the metric path of the service
|
||||
// +usage= the metrics path of the service
|
||||
path: *"/metrics" | string
|
||||
scheme: *"http" | string
|
||||
enabled: *true | bool
|
||||
|
||||
51
charts/vela-core/templates/defwithtemplate/rollout.yaml
Normal file
51
charts/vela-core/templates/defwithtemplate/rollout.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
apiVersion: core.oam.dev/v1alpha2
|
||||
kind: TraitDefinition
|
||||
metadata:
|
||||
name: rollout
|
||||
annotations:
|
||||
definition.oam.dev/description: "Configure canary deployment strategy to release the app"
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
definitionRef:
|
||||
name: canaries.flagger.app
|
||||
workloadRefPath: spec.targetRef
|
||||
revisionEnabled: true
|
||||
extension:
|
||||
template: |-
|
||||
output: {
|
||||
apiVersion: "flagger.app/v1beta1"
|
||||
kind: "Canary"
|
||||
spec: {
|
||||
provider: "smi"
|
||||
progressDeadlineSeconds: 60
|
||||
service: {
|
||||
// Currently Traffic route is not supported, but this is required field for flagger CRD
|
||||
port: 80
|
||||
// Currently Traffic route is not supported, but this is required field for flagger CRD
|
||||
targetPort: 8080
|
||||
}
|
||||
analysis: {
|
||||
interval: parameter.interval
|
||||
// max number of failed metric checks before rollback
|
||||
threshold: 10
|
||||
// max traffic percentage routed to canary
|
||||
// percentage (0-100)
|
||||
maxWeight: 50
|
||||
// canary increment step
|
||||
// percentage (0-100)
|
||||
stepWeight: parameter.stepWeight
|
||||
// max replicas scale up to canary
|
||||
maxReplicas: parameter.replicas
|
||||
}
|
||||
}
|
||||
}
|
||||
parameter: {
|
||||
// +usage=total replicas of the workload
|
||||
replicas: *2 | int
|
||||
// +alias=step-weight
|
||||
// +usage=weight percent of every step in rolling update
|
||||
stepWeight: *50 | int
|
||||
interval: *"30s" | string
|
||||
}
|
||||
|
||||
@@ -3,13 +3,10 @@ kind: TraitDefinition
|
||||
metadata:
|
||||
name: route
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: standard.oam.dev/v1alpha1
|
||||
definition.oam.dev/kind: Route
|
||||
definition.oam.dev/description: "Add a route for workload"
|
||||
definition.oam.dev/description: "Configure route policy to the app"
|
||||
spec:
|
||||
appliesToWorkloads:
|
||||
- webservice
|
||||
- deployments.apps
|
||||
workloadRefPath: spec.workloadRef
|
||||
definitionRef:
|
||||
name: routes.standard.oam.dev
|
||||
|
||||
@@ -3,9 +3,7 @@ kind: WorkloadDefinition
|
||||
metadata:
|
||||
name: task
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: "v1"
|
||||
definition.oam.dev/kind: "Job"
|
||||
definition.oam.dev/description: "One-time task/job"
|
||||
definition.oam.dev/description: "One-off task to run a piece of code or script to completion"
|
||||
spec:
|
||||
definitionRef:
|
||||
name: jobs
|
||||
@@ -34,7 +32,7 @@ spec:
|
||||
// +short=c
|
||||
count: *1 | int
|
||||
|
||||
// +usage=specify app image
|
||||
// +usage=Which image would you like to use for your service
|
||||
// +short=i
|
||||
image: string
|
||||
|
||||
|
||||
@@ -3,9 +3,7 @@ kind: WorkloadDefinition
|
||||
metadata:
|
||||
name: webservice
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: "apps/v1"
|
||||
definition.oam.dev/kind: "Deployment"
|
||||
definition.oam.dev/description: "Long running service with network routes"
|
||||
definition.oam.dev/description: "Long-running scalable service with stable endpoint to receive external traffic"
|
||||
spec:
|
||||
definitionRef:
|
||||
name: deployments.apps
|
||||
@@ -38,24 +36,19 @@ spec:
|
||||
}
|
||||
|
||||
if context["config"] != _|_ {
|
||||
env: [
|
||||
for k, v in context.config {
|
||||
name: k
|
||||
value: v
|
||||
},
|
||||
]
|
||||
env: context.config
|
||||
}
|
||||
|
||||
ports: [{
|
||||
containerPort: parameter.port
|
||||
}]
|
||||
|
||||
if parameter["cpuRequests"] != _|_ {
|
||||
if parameter["cpu"] != _|_ {
|
||||
resources: {
|
||||
limits:
|
||||
cpu: parameter.cpuRequests
|
||||
cpu: parameter.cpu
|
||||
requests:
|
||||
cpu: parameter.cpuRequests
|
||||
cpu: parameter.cpu
|
||||
}
|
||||
}
|
||||
}]
|
||||
@@ -64,15 +57,15 @@ spec:
|
||||
}
|
||||
}
|
||||
parameter: {
|
||||
// +usage=specify app image
|
||||
// +usage=Which image would you like to use for your service
|
||||
// +short=i
|
||||
image: string
|
||||
|
||||
cmd?: [...string]
|
||||
|
||||
// +usage=specify port for container
|
||||
// +usage=Which port do you want customer traffic sent to
|
||||
// +short=p
|
||||
port: *6379 | int
|
||||
port: *80 | int
|
||||
|
||||
env?: [...{
|
||||
name: string
|
||||
@@ -84,8 +77,7 @@ spec:
|
||||
}
|
||||
}
|
||||
}]
|
||||
// +usage=CPU core requests for the workload
|
||||
// +alias=cpu-requests
|
||||
cpuRequests?: string
|
||||
// +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)
|
||||
cpu?: string
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,7 @@ kind: WorkloadDefinition
|
||||
metadata:
|
||||
name: worker
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: "apps/v1"
|
||||
definition.oam.dev/kind: "Deployment"
|
||||
definition.oam.dev/description: "Backend worker without ports exposed"
|
||||
definition.oam.dev/description: "Long-running scalable backend worker without network endpoint"
|
||||
spec:
|
||||
definitionRef:
|
||||
name: deployments.apps
|
||||
@@ -43,7 +41,7 @@ spec:
|
||||
}
|
||||
|
||||
parameter: {
|
||||
// +usage=specify app image
|
||||
// +usage=Which image would you like to use for your service
|
||||
// +short=i
|
||||
image: string
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: vela-config
|
||||
namespace: {{ .Release.Namespace }}
|
||||
# TODO: Currently namespace MUST be vela-system
|
||||
namespace: vela-system
|
||||
data:
|
||||
servicemonitors.monitoring.coreos.com: |
|
||||
{
|
||||
@@ -14,11 +15,11 @@ data:
|
||||
}
|
||||
flagger.app: |
|
||||
{
|
||||
"repo": "flagger",
|
||||
"urL": "https://flagger.app",
|
||||
"repo": "oam-flagger",
|
||||
"urL": "https://oam.dev/flagger/archives/",
|
||||
"name": "flagger",
|
||||
"namespace": "vela-system",
|
||||
"version": "1.2.0"
|
||||
"version": "1.1.0"
|
||||
}
|
||||
keda: |
|
||||
{
|
||||
@@ -27,4 +28,4 @@ data:
|
||||
"name": "keda",
|
||||
"namespace": "keda",
|
||||
"version": "2.0.0-rc3"
|
||||
}
|
||||
}
|
||||
@@ -426,7 +426,7 @@ Please also specify `traits` values if need to attach a trait to several traits
|
||||
"workload_name": "poc5",
|
||||
"flags": [
|
||||
{
|
||||
"name": "replica",
|
||||
"name": "replicas",
|
||||
"value": "4"
|
||||
}
|
||||
]
|
||||
@@ -444,7 +444,7 @@ sample response
|
||||
"data": {
|
||||
"name": "podspecworkload",
|
||||
"type": "workload",
|
||||
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"PodSpecWorkload\"\n\tmetadata: name: podspecworkload.name\n\tspec: {\n\t\tcontainers: [{\n\t\t\timage: containerized.image\n\t\t\tname: containerized.name\n\t\t\tports: [{\n\t\t\t\tcontainerPort: containerized.port\n\t\t\t\tprotocol: \"TCP\"\n\t\t\t\tname: \"default\"\n\t\t\t}]\n\t\t}]\n\t}\n}\ncontainerized: {\n\tname: string\n\t// +usage=specify app image\n\t// +short=i\n\timage: string\n\t// +usage=specify port for container\n\t// +short=p\n\tport: *6379 | int\n}\n",
|
||||
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"PodSpecWorkload\"\n\tmetadata: name: podspecworkload.name\n\tspec: {\n\t\tcontainers: [{\n\t\t\timage: containerized.image\n\t\t\tname: containerized.name\n\t\t\tports: [{\n\t\t\t\tcontainerPort: containerized.port\n\t\t\t\tprotocol: \"TCP\"\n\t\t\t\tname: \"default\"\n\t\t\t}]\n\t\t}]\n\t}\n}\ncontainerized: {\n\tname: string\n\t// +usage=Which image would you like to use for your service\n\t// +short=i\n\timage: string\n\t// +usage=Which port do you want customer traffic sent to\n\t// +short=p\n\tport: *6379 | int\n}\n",
|
||||
"parameters": [{
|
||||
"name": "name",
|
||||
"required": true,
|
||||
@@ -455,13 +455,13 @@ sample response
|
||||
"short": "i",
|
||||
"required": true,
|
||||
"default": "",
|
||||
"usage": "specify app image",
|
||||
"usage": "Which image would you like to use for your service",
|
||||
"type": 16
|
||||
}, {
|
||||
"name": "port",
|
||||
"short": "p",
|
||||
"default": 6379,
|
||||
"usage": "specify port for container",
|
||||
"usage": "Which port do you want customer traffic sent to",
|
||||
"type": 4
|
||||
}],
|
||||
"definition": "/Users/zhouzhengxi/.vela/capabilities/containerizedworkloads.core.oam.dev.cue",
|
||||
@@ -492,13 +492,13 @@ sample response
|
||||
"short": "i",
|
||||
"required": true,
|
||||
"default": "",
|
||||
"usage": "specify app image",
|
||||
"usage": "Which image would you like to use for your service",
|
||||
"type": 16
|
||||
}, {
|
||||
"name": "port",
|
||||
"short": "p",
|
||||
"default": 6379,
|
||||
"usage": "specify port for container",
|
||||
"usage": "Which port do you want customer traffic sent to",
|
||||
"type": 4
|
||||
}]
|
||||
}, {
|
||||
@@ -534,7 +534,7 @@ sample request
|
||||
"name": "scale",
|
||||
"flags": [
|
||||
{
|
||||
"name": "replica",
|
||||
"name": "replicas",
|
||||
"value": "4"
|
||||
}
|
||||
]
|
||||
@@ -556,9 +556,9 @@ sample response
|
||||
"data": {
|
||||
"name": "manualscaler",
|
||||
"type": "trait",
|
||||
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ManualScalerTrait\"\n\tspec: {\n\t\treplicaCount: manualscaler.replica\n\t}\n}\nmanualscaler: {\n\t//+short=r\n\treplica: *2 | int\n}\n",
|
||||
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ManualScalerTrait\"\n\tspec: {\n\t\treplicaCount: manualscaler.replicas\n\t}\n}\nmanualscaler: {\n\t//+short=r\n\treplicas: *2 | int\n}\n",
|
||||
"parameters": [{
|
||||
"name": "replica",
|
||||
"name": "replicas",
|
||||
"short": "r",
|
||||
"default": 2,
|
||||
"type": 4
|
||||
@@ -675,7 +675,7 @@ sample response
|
||||
"data": [{
|
||||
"name": "podspecworkload",
|
||||
"type": "workload",
|
||||
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ContainerizedWorkload\"\n\tmetadata: name: podspecworkload.name\n\tspec: {\n\t\tcontainers: [{\n\t\t\timage: containerized.image\n\t\t\tname: containerized.name\n\t\t\tports: [{\n\t\t\t\tcontainerPort: containerized.port\n\t\t\t\tprotocol: \"TCP\"\n\t\t\t\tname: \"default\"\n\t\t\t}]\n\t\t}]\n\t}\n}\ncontainerized: {\n\tname: string\n\t// +usage=specify app image\n\t// +short=i\n\timage: string\n\t// +usage=specify port for container\n\t// +short=p\n\tport: *6379 | int\n}\n",
|
||||
"template": "#Template: {\n\tapiVersion: \"core.oam.dev/v1alpha2\"\n\tkind: \"ContainerizedWorkload\"\n\tmetadata: name: podspecworkload.name\n\tspec: {\n\t\tcontainers: [{\n\t\t\timage: containerized.image\n\t\t\tname: containerized.name\n\t\t\tports: [{\n\t\t\t\tcontainerPort: containerized.port\n\t\t\t\tprotocol: \"TCP\"\n\t\t\t\tname: \"default\"\n\t\t\t}]\n\t\t}]\n\t}\n}\ncontainerized: {\n\tname: string\n\t// +usage=Which image would you like to use for your service\n\t// +short=i\n\timage: string\n\t// +usage=Which port do you want customer traffic sent to\n\t// +short=p\n\tport: *6379 | int\n}\n",
|
||||
"parameters": [{
|
||||
"name": "name",
|
||||
"required": true,
|
||||
@@ -686,13 +686,13 @@ sample response
|
||||
"short": "i",
|
||||
"required": true,
|
||||
"default": "",
|
||||
"usage": "specify app image",
|
||||
"usage": "Which image would you like to use for your service",
|
||||
"type": 16
|
||||
}, {
|
||||
"name": "port",
|
||||
"short": "p",
|
||||
"default": 6379,
|
||||
"usage": "specify port for container",
|
||||
"usage": "Which port do you want customer traffic sent to",
|
||||
"type": 4
|
||||
}],
|
||||
"definition": "/Users/zhouzhengxi/.vela/centers/c1/.tmp/containerizedworkloads.core.oam.dev.cue",
|
||||
@@ -702,9 +702,9 @@ sample response
|
||||
},{
|
||||
"name": "rollout",
|
||||
"type": "trait",
|
||||
"template": "#Template: {\n\tapiVersion: \"extend.oam.dev/v1alpha2\"\n\tkind: \"SimpleRolloutTrait\"\n\tspec: {\n\t\treplica: rollout.replica\n\t\tmaxUnavailable: rollout.maxUnavailable\n\t\tbatch: rollout.batch\n\t}\n}\nrollout: {\n\treplica: *3 | int\n\tmaxUnavailable: *1 | int\n\tbatch: *2 | int\n}\n",
|
||||
"template": "#Template: {\n\tapiVersion: \"extend.oam.dev/v1alpha2\"\n\tkind: \"SimpleRolloutTrait\"\n\tspec: {\n\t\treplicas: rollout.replicas\n\t\tmaxUnavailable: rollout.maxUnavailable\n\t\tbatch: rollout.batch\n\t}\n}\nrollout: {\n\treplicas: *3 | int\n\tmaxUnavailable: *1 | int\n\tbatch: *2 | int\n}\n",
|
||||
"parameters": [{
|
||||
"name": "replica",
|
||||
"name": "replicas",
|
||||
"default": 3,
|
||||
"type": 4
|
||||
}, {
|
||||
@@ -50,14 +50,14 @@ services:
|
||||
- /mnt/path=sec:my-secret
|
||||
|
||||
scale:
|
||||
replica: 2
|
||||
replicas: 2
|
||||
auto: # automatic scale up and down based on given metrics
|
||||
range: "1-10"
|
||||
cpu: 80 # if cpu utilization is above 80%, scale up
|
||||
qps: 1000 # if qps is higher than 1k, scale up
|
||||
|
||||
canary: # Auto-create canary deployment. Only upgrade after verify successfully.
|
||||
replica: 1 # canary deployment size
|
||||
replicas: 1 # canary deployment size
|
||||
headers:
|
||||
- "foo:bar.*"
|
||||
```
|
||||
@@ -72,7 +72,7 @@ It will build container image, render deployment manifests in yaml, and apply th
|
||||
|
||||
### Extensible Design
|
||||
|
||||
The Appfile could be extended with more configurations by adding more capabilities to the OAM system. The config fields in Appfile are strongly correlated to the [capabilities system of OAM](https://github.com/oam-dev/kubevela/blob/master/DESIGN.md#capability-register-and-discovery) – Config fields are registered in the capabilities system and exposed via a [CUE template](https://cuelang.org/).
|
||||
The Appfile could be extended with more configurations by adding more capabilities to the OAM system. The config fields in Appfile are strongly correlated to the [capabilities system of OAM](https://github.com/oam-dev/kubevela/blob/master/docs/design.md#2-capability-oriented-architecture) – Config fields are registered in the capabilities system and exposed via a [CUE template](https://cuelang.org/).
|
||||
|
||||
Here is an example of a capability definition that platform builders register:
|
||||
|
||||
@@ -140,7 +140,7 @@ In the following, we will discuss technical details of the proposed design.
|
||||
|
||||
### Registration via Definition/Capability
|
||||
|
||||
Vela allows platform builders to extend Appfile config fields by registering them via [capabilities system of OAM](https://github.com/oam-dev/kubevela/blob/master/DESIGN.md#capability-register-and-discovery).
|
||||
Vela allows platform builders to extend Appfile config fields by registering them via [capabilities system of OAM](https://github.com/oam-dev/kubevela/blob/master/docs/design.md#2-capability-oriented-architecture).
|
||||
|
||||
The entire template should be put under `spec.extension.template` as raw string:
|
||||
|
||||
@@ -356,4 +356,4 @@ spec:
|
||||
}]
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
0
docs/.nojekyll
Normal file
0
docs/.nojekyll
Normal file
1
docs/CNAME
Normal file
1
docs/CNAME
Normal file
@@ -0,0 +1 @@
|
||||
kubevela.io
|
||||
@@ -1,34 +1,31 @@
|
||||
# KubeVela Documentation
|
||||
# KubeVela Website
|
||||
[kubevela.io](https://kubevela.io)
|
||||
|
||||
Learn and use KubeVela with tutorials and user stories.
|
||||
## Contributing
|
||||
|
||||
**Overview**
|
||||
- [Introduction](introduction.md)
|
||||
- [Installation](./install.md)
|
||||
- [Quick Start](quick-start.md)
|
||||
- [Concepts](concepts.md)
|
||||
- Fork and clone
|
||||
|
||||
**For Developers**
|
||||
- [Setting Up Deployment Environment](developers/config-enviroments.md)
|
||||
- [Initializing Application](developers/app-init.md)
|
||||
- [Setting Routes](developers/set-route.md)
|
||||
- [Setting Auto-scaling Policy](developers/set-autoscale.md)
|
||||
- [Setting Rollout Strategy](developers/set-rollout.md)
|
||||
- [Monitoring Application](developers/set-metrics.md)
|
||||
- [Using Appfile](developers/devex/appfile.md)
|
||||
- [Check Application Logs](developers/check-logs.md)
|
||||
- [Execute Commands in Container](developers/exec-cmd.md)
|
||||
- [Port Forward to Container](developers/port-forward.md)
|
||||
- [Configuring data/env in Application](developers/config-app.md)
|
||||
- [Consuming Cloud Services](developers/cloud-service.md)
|
||||
- [Managing Capabilities](developers/cap-center.md)
|
||||
- [Capability References](developers/references/README.md)
|
||||
```
|
||||
$ git clone git@github.com:oam-dev/kubevela.git
|
||||
$ cd kubevela/docs
|
||||
```
|
||||
|
||||
**For Platform Engineers**
|
||||
- [Extending KubeVela](platform-engineers/extending-kubevela.md)
|
||||
- Install docsify-cli
|
||||
```
|
||||
$ npm i docsify-cli -g
|
||||
```
|
||||
|
||||
**Internals**
|
||||
- [Design and Architecture](design.md)
|
||||
- Make your changes
|
||||
|
||||
**Roadmap**
|
||||
- [Roadmap of KubeVela](roadmap.md)
|
||||
- Local preview
|
||||
```
|
||||
$ docsify serve
|
||||
Serving /xxx/kubevela.io now.
|
||||
Listening at http://localhost:3000
|
||||
```
|
||||
|
||||
Preview your changes at [http://127.0.0.1:3000/](http://127.0.0.1:3000/).
|
||||
|
||||
- Push your commit
|
||||
|
||||
Thanks for your contribution!
|
||||
|
||||
9
docs/_coverpage.md
Normal file
9
docs/_coverpage.md
Normal file
@@ -0,0 +1,9 @@
|
||||
<p align="center">
|
||||
<img src="static/logo.svg" alt="kubevela logo" width=300 height=300 />
|
||||
</p>
|
||||
|
||||
> Make shipping applications more enjoyable.
|
||||
|
||||
|
||||
[GitHub](https://github.com/oam-dev/kubevela)
|
||||
[Get Started](en/quick-start)
|
||||
5
docs/_navbar.md
Normal file
5
docs/_navbar.md
Normal file
@@ -0,0 +1,5 @@
|
||||
- [Home](/)
|
||||
<!-- - [Blog](/en/blog/README.md) -->
|
||||
<!-- - Language
|
||||
- [中文](/zh-cn/)
|
||||
- [English](/en/) -->
|
||||
76
docs/_sidebar.md
Normal file
76
docs/_sidebar.md
Normal file
@@ -0,0 +1,76 @@
|
||||
- Overview
|
||||
- [Introduction](/en/introduction.md)
|
||||
- [Getting Started](/en/quick-start.md)
|
||||
|
||||
- Using KubeVela
|
||||
- Appfile
|
||||
- [Learning Appfile](/en/developers/learn-appfile.md)
|
||||
- Operating
|
||||
- [Setting Routes](/en/developers/set-route.md)
|
||||
- [Setting Auto-scaling Policy](/en/developers/set-autoscale.md)
|
||||
- [Setting Rollout Strategy](/en/developers/set-rollout.md)
|
||||
- [Setting Monitoring Policy](/en/developers/set-metrics.md)
|
||||
- Debugging
|
||||
- [Port Forwarding](/en/developers/port-forward.md)
|
||||
- [Check Application Logs](/en/developers/check-logs.md)
|
||||
- [Execute Commands in Container](/en/developers/exec-cmd.md)
|
||||
- Extensibility
|
||||
- [Managing Capabilities](/en/developers/cap-center.md)
|
||||
- Configuring
|
||||
- [Setting Up Deployment Environment](/en/developers/config-enviroments.md)
|
||||
- [Configuring data/env in Application](/en/developers/config-app.md)
|
||||
- [Alternative Commands](/en/developers/alternative-cmd.md)
|
||||
- Extending KubeVela
|
||||
- [Add Workload Type](/en/platform-engineers/workload-type.md)
|
||||
- [Add Trait](/en/platform-engineers/trait.md)
|
||||
- [Add Cloud Services](/en/platform-engineers/cloud-services.md)
|
||||
|
||||
- Roadmap
|
||||
- [KubeVela Roadmap](/en/roadmap.md)
|
||||
|
||||
- References
|
||||
- [Concepts and Glossaries](/en/concepts.md)
|
||||
- [Appfile](/en/developers/references/devex/appfile.md)
|
||||
- Capabilities
|
||||
- Workload Types
|
||||
- [Web Service](/en/developers/references/workload-types/web-service.md)
|
||||
- [Task](/en/developers/references/workload-types/task.md)
|
||||
- [Worker](/en/developers/references/workload-types/backend-worker.md)
|
||||
- Traits
|
||||
- [Route](/en/developers/references/traits/route.md)
|
||||
- [Autoscale](/en/developers/references/traits/autoscale.md)
|
||||
- [Rollout](/en/developers/references/traits/rollout.md)
|
||||
- [Metrics](/en/developers/references/traits/metrics.md)
|
||||
- CLI
|
||||
- General
|
||||
- [vela config](/en/cli/vela_config.md)
|
||||
- [vela env](/en/cli/vela_env.md)
|
||||
- [vela init](/en/cli/vela_init.md)
|
||||
- [vela install](/en/cli/vela_install.md)
|
||||
- [vela up](/en/cli/vela_up.md)
|
||||
- [vela version](/en/cli/vela_version.md)
|
||||
- Applications
|
||||
- [vela delete](/en/cli/vela_delete.md)
|
||||
- [vela exec](/en/cli/vela_exec.md)
|
||||
- [vela logs](/en/cli/vela_logs.md)
|
||||
- [vela ls](/en/cli/vela_ls.md)
|
||||
- [vela port-forward](/en/cli/vela_port-forward.md)
|
||||
- [vela show](/en/cli/vela_show.md)
|
||||
- [vela status](/en/cli/vela_status.md)
|
||||
- [vela svc](/en/cli/vela_svc.md)
|
||||
- Workload Types
|
||||
- [vela workloads](/en/cli/vela_workloads.md)
|
||||
- Traits
|
||||
- [vela traits](/en/cli/vela_traits.md)
|
||||
- [vela scaler](/en/cli/vela_scaler.md)
|
||||
- [vela route](/en/cli/vela_route.md)
|
||||
- [vela autoscale](/en/cli/vela_autoscale.md)
|
||||
- [vela rollout](/en/cli/vela_rollout.md)
|
||||
- [vela metrics](/en/cli/vela_metric.md)
|
||||
- System
|
||||
- [vela completion](/en/cli/vela_completion.md)
|
||||
- [vela dashboard](/en/cli/vela_dashboard.md)
|
||||
- [vela system](/en/cli/vela_system.md)
|
||||
- [vela template](/en/cli/vela_template.md)
|
||||
- Extensibility
|
||||
- [vela cap](/en/cli/vela_cap.md)
|
||||
@@ -1,35 +0,0 @@
|
||||
## vela system update
|
||||
|
||||
Sync definition from cluster
|
||||
|
||||
### Synopsis
|
||||
|
||||
Refresh and sync definition files from cluster
|
||||
|
||||
```
|
||||
vela system update
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
vela system update
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for update
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
-e, --env string specify environment name for application
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela system](vela_system.md) - System management utilities
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
159
docs/design.md
159
docs/design.md
@@ -1,159 +0,0 @@
|
||||
# KubeVela Design
|
||||
|
||||
This document is the detailed design and architecture of the KubeVela being built in this repository.
|
||||
|
||||
> All the diagram in this documentation could be found in [this slides](https://docs.google.com/presentation/d/1Y3gnKrd7fUZGgee7Ia9vBsRIYhcZLQwMUCDkk1RJvQc/edit?usp=sharing).
|
||||
|
||||
## Overview
|
||||
|
||||
KubeVela is a simple, complete, but highly extensible cloud native application platform based on Kubernetes. KubeVela intends to bring application-centric experience to end users and democratize building cloud native application platforms for platform engineers.
|
||||
|
||||
## User Stories
|
||||
|
||||
As a end user (e.g. application developers, operators etc) of the platform, I only want to focus on coding my business logic and ship them to various environments at ease. Let's say:
|
||||
- Here's my source code.
|
||||
- Here's my application configuration (described in end user PoV).
|
||||
- Deploy it in test environment.
|
||||
- Deploy it in production environment.
|
||||
- Monitoring, debugging, rollout/rollback the application.
|
||||
- Dockerfile is fine, but please keep it simple.
|
||||
|
||||
As a platform engineer, I want to build a easy-to-use platform for end users. In detail, the platform should be:
|
||||
- Heroku-like (_in terms of both user experience and functionality_).
|
||||
- and I prefer to build my own version with OSS tools, particularly, with Kubernetes (for obvious reason).
|
||||
- Easy to build.
|
||||
- I am too busy to reinvent any wheel, I want to reuse every capability in Kubernetes community as possible, with minimal effort. Writing some simple CRD and controllers is fine, but please, just the simple ones like copy-paste.
|
||||
- Powerful and highly extensible.
|
||||
- I don't want to lock users with restricted abstractions and capabilities like traditional PaaS or FaaS/Serverless. I love Kubernetes and what it has enabled. So in terms of capability, I hope my platform is fully open and has unlimited possibilities like Kubernetes itself, rather than another opinionated close system like traditional PaaS.
|
||||
|
||||
|
||||
## Core Principles
|
||||
|
||||
In nutshell, the principles for KubeVela project are:
|
||||
|
||||
- For end users, it out-of-the-box provides a fully featured PaaS-like experience, nothing special.
|
||||
- For platform builders, it works like a special Kubernetes "distro" or extensible PaaS core that could be used to build something more complex on top of. It allows platform builders to integrate any existing capabilities in Kubernetes ecosystem to end users with minimal effort, or develop a new capability at ease in a standardized and Kubernetes-native approach.
|
||||
|
||||
## Design Details
|
||||
|
||||
### 1. Application Centric
|
||||
|
||||
The API and interfaces of KubeVela intends to make users think in terms of application, not containers or infrastructure.
|
||||
|
||||
Lacking application context impacts the user experience and significantly raised the bar to adopt cloud native stack. We believe "application" is the natural mindset of developers and it's the core concept an application platform should expose.
|
||||
|
||||

|
||||
|
||||
KubeVela intends to let developers push code, define application in developer facing primitives, and make daily operations as configurations of the application.
|
||||
|
||||
Thus, KubeVela choose to:
|
||||
1. Introduce "application" as first class citizen and main API.
|
||||
2. Build the whole system around "application", i.e. model capabilities of Kubernetes as application configuration, with clarity and manageability.
|
||||
|
||||
#### Solution
|
||||
|
||||
Instead of creating a in-house "application CRD", KubeVela adopts [Open Application Model (OAM)](https://github.com/oam-dev/spec) as its application definition, since OAM:
|
||||
1. defines micro-services application by default.
|
||||
2. models day 2 operations as part of the application (i.e. `Application Traits`).
|
||||
2. is highly extensible: every workload and trait in OAM is a independent definition, no abstraction or capability lock-in.
|
||||
|
||||
### 2. Capability Oriented Architecture
|
||||
|
||||
To enable platform builders use KubeVela to create their own application platforms in an easy and Kubernetes native approach, KubeVela intends to make its every capability a standalone "plug-in".
|
||||
|
||||

|
||||
|
||||
For example, there are several "built-in" workload types in KubeVela such as `Web Service` or `Task`. It is by design that they are all independent CRD controllers that abstract Kubernetes built-in workloads and create Service automatically if needed. KubeVela itself is **NOT** aware of the specification or implementation of these workload types.
|
||||
|
||||
This means platform builders are free to bring their own workload types by simply install a CRD controller, or even just reference a k8s built-in resource like StatefulSet as new workload type.
|
||||
|
||||
Similarly, all the "built-in" operations such as `scaling` or `rollout` (i.e. "traits" in KubeVela) are also independent CRD controllers which are **NOT** bound with specific workload types. Platform builders are free to bring their own traits implementations by simply providing a CRD controller, reference a k8s built-in resource like `HPA` or `NetworkPolicy` as trait is also possible.
|
||||
|
||||
This loosely coupled design of KubeVela adopts the idea of Capability Oriented Architecture (COA), i.e. instead of creating a close system like traditional PaaS, KubeVela intends to become an application-centric framework to connect end users with underlying infrastructure capabilities.
|
||||
|
||||
#### Solution
|
||||
|
||||
KubeVela core is built with [OAM Kubernetes Runtime](https://github.com/crossplane/oam-kubernetes-runtime) which met the requirements of KubeVela such as supporting bring in standalone controllers as workload type and trait, it also defined a clear interface between how a trait could operate a workload instance in a generic approach. Overall, this library defined a set of abstraction and interfaces for platform builder to assemble various Kubernetes capabilities into a PaaS without coupling them together or introducing any glue code.
|
||||
|
||||
##### Capability Register and Discovery
|
||||
|
||||
KubeVela leverages [OAM definition objects](https://github.com/oam-dev/spec/blob/master/4.workload_definitions.md) to register and discover workloads and traits:
|
||||
|
||||
|
||||
```console
|
||||
$ kubectl apply -f workload-definition.yaml # register a new workload type
|
||||
$ kubectl apply -f trait-definition.yaml # register a new trait
|
||||
```
|
||||
|
||||
Note that OAM definition objects only care about API resource, not including the controllers. Thus KubeVela intends to include a **CRD registry** so whenever a new API resource is installed as workload or trait, KubeVela could install its controller automatically from the registry. That of course means we envision the CRD registry could register a CRD and Helm chart (which contains the manifest of the controller). In practice, we are currently evaluating RedHat's Operator Lifecycle Manager (OLM) but no the final conclusion yet.
|
||||
|
||||
##### Cloud Services Integration
|
||||
|
||||
For capabilities like cloud services, KubeVela intends to leverage Kubernetes as the universal control plane so [Crossplane](https://github.com/crossplane/crossplane) core will be used to register cloud services as workload types.
|
||||
|
||||
|
||||
### 3. Extensible User Interface
|
||||
|
||||
KubeVela is built with Kubernetes and OAM (which adopts Kubernetes API model). So in nutshell, **ALL** functionalities of KubeVela core can be handled by simple `kubectl`, for example:
|
||||
|
||||
```yaml
|
||||
$ kubectl apply -f frontend-component.yaml # create frontend component
|
||||
$ kubectl apply -f backend-component.yaml # create backend component
|
||||
$ kubectl apply -f application-config.yaml # assign operational traits to components and deploy the whole application
|
||||
```
|
||||
|
||||
We call these server side objects "the application model of KubeVela", they are essentially the Kubernetes API objects KubeVela exposes.
|
||||
|
||||
However, we also agree that Kubernetes API model is great to build platforms like KubeVela with but when directly exposed to end users, it creates heavy mental burden and high learning curve. Hence, as any other user facing platforms, KubeVela intend to introduce a lightweight user facing layer with following goals in mind:
|
||||
|
||||
- Shorten the learning curve of new developers. Most capabilities in KubeVela are developed by big
|
||||
companies that run very complex workloads. However, for the bigger developer community, the new user facing layer will provide a much simpler path to on-board KubeVela.
|
||||
- Developers can describe their applications and behavior of their components without making assumptions on availability of specific Kubernetes API. For instance, a developer will be able to model auto-scaling needs without referring to the CRD of auto-scaling trait.
|
||||
- Provides a single source of truth of the application description. The user facing layer allows developers to work with a single artifact to capture the application definition. This artifact is the definitive truth of how the application is supposed to look like. It simplifies administrative tasks such as change management. It also serves as an anchor for application truth to avoid configuration drifts during operation.
|
||||
- Highly extensible. For example, when a new workload type or trait is installed, the end users could access this new capability directly from user interface layer, no re-compile or re-deploy of KubeVela is required.
|
||||
|
||||
#### Solution
|
||||
|
||||
We concluded such "highly extensible user interface layer" as a need for a dynamic "modeling language" on top of the KubeVela's application model objects. After evaluation, we decided to adopt [CUElang](https://github.com/cuelang/cue) since it's perfect as a pure data configuration language that allow us to build developer facing tools, nothing more, nothing less.
|
||||
|
||||
In detail, we integrated CUE based abstraction as part of OAM implementation since the *abstraction* and *model* are closely related. For platform builders, every workload or trait definition in KubeVela references a CUE template as its abstraction between human and the underlying Kubernetes capability, platform builders are free to modify those templates at any time
|
||||
|
||||
On the other hand, it's by intention that the end users of KubeVela don't need to learn or write CUE. Instead, we created following tools for them by leveraging above OAM + CUE user interface layer:
|
||||
|
||||
1. A command line tool.
|
||||
2. A GUI dashboard.
|
||||
3. A Docker Compose style `appfile`.
|
||||
|
||||
For example, the `vela cli`:
|
||||
|
||||
```console
|
||||
$ vela svc deploy frontend -t webservice --image oamdev/testapp:v1 --port 80 --app helloworld
|
||||
```
|
||||
|
||||
The `-t webservice --image oamdev/testapp:v1 --port 80` arguments are not hard coded, they are schema defined by in-line CUE template of `WebService` workload definition.
|
||||
|
||||
The `appfile` is essentially a YAML version of command line tool but it can support more complex structures with a single command like `$ vela up`:
|
||||
|
||||

|
||||
|
||||
The schema of above `appfile` is not hard coded as well, they are organized following OAM and enforced by CUE templates of `WebService` workload definition, `Scaling` trait definition and `Canary` trait definition.
|
||||
|
||||
> Appfile has its [independent design doc](./design/appfile-design.md) which includes more details. There's also [an example](./design/appfile-design.md#multiple-outputs-in-traitdefinition) showing how platform builder could use CUE to define a `route` capability in KubeVela.
|
||||
|
||||
We will skip the example of dashboard, but similarly, the schema of GUI forms are defined by in-lined CUE template of definition objects.
|
||||
|
||||
## Architecture
|
||||
|
||||

|
||||
|
||||
From highest level, KubeVela is composed by only two components:
|
||||
|
||||
### 1. User interface layer
|
||||
Including: `cli`, `dashboard`, `appfile`, they are all client side tools based on the CUE based abstractions mentioned above.
|
||||
### 2. KubeVela core
|
||||
Including:
|
||||
- [OAM Kubernetes runtime](https://github.com/crossplane/oam-kubernetes-runtime) to provide application-centric building blocks such as `Component` and `Application` etc.
|
||||
- [Built-in workload and trait controllers](https://github.com/oam-dev/kubevela/tree/master/pkg/controller/v1alpha1) to provide core capabilities such as `webservice`, `route` and `rollout` etc.
|
||||
- Capability Management: manage features of KubeVela following Capability Oriented Architecture.
|
||||
- Every feature of KubeVela is a "addon", and it is registered by Kubernetes API resource (including CRD) leveraging OAM definition objects.
|
||||
- CRD Registry: register controllers of Kubernetes add-ons and discover them by CRD. This will enable automatically install controllers/operators when CRD is missing in the cluster.
|
||||
@@ -1,94 +0,0 @@
|
||||
# Initializating Application
|
||||
|
||||
## `vela init`
|
||||
|
||||
To initialize and deploy an application with one service, run:
|
||||
|
||||
> If you only want to initialize without deploying the app, add `--render-only` flag
|
||||
|
||||
```console
|
||||
$ vela init
|
||||
Welcome to use KubeVela CLI! We're going to help you run applications through a couple of questions.
|
||||
|
||||
Environment: default, namespace: default
|
||||
|
||||
? What is the domain of your application service (optional): example.com
|
||||
? What is your email (optional, used to generate certification):
|
||||
? What would you like to name your application (required): testapp
|
||||
? Choose the workload type for your application (required, e.g., webservice): webservice
|
||||
? What would you like to name this webservice (required): testsvc
|
||||
? specify app image crccheck/hello-world
|
||||
? specify port for container 8000
|
||||
|
||||
...
|
||||
✅ Application Deployed Successfully!
|
||||
- Name: testsvc
|
||||
Type: webservice
|
||||
HEALTHY Ready: 1/1
|
||||
Routes:
|
||||
|
||||
Last Deployment:
|
||||
Created at: ...
|
||||
Updated at: ...
|
||||
```
|
||||
|
||||
Check the application:
|
||||
|
||||
```console
|
||||
$ vela show testapp
|
||||
About:
|
||||
|
||||
Name: testapp
|
||||
Created at: ...
|
||||
Updated at: ...
|
||||
|
||||
|
||||
Environment:
|
||||
|
||||
Namespace: default
|
||||
|
||||
Services:
|
||||
|
||||
- Name: testsvc
|
||||
WorkloadType: webservice
|
||||
Arguments:
|
||||
image: crccheck/hello-world
|
||||
port: 8000
|
||||
Traits:
|
||||
```
|
||||
|
||||
## Deploy Multiple Services
|
||||
|
||||
You can also use KubeVela CLI to deploy multiple services for an application.
|
||||
|
||||
Check the available workload types.
|
||||
|
||||
```console
|
||||
$ vela workloads
|
||||
NAME DESCRIPTION
|
||||
worker Backend worker without ports exposed
|
||||
webservice Long running service with network routes
|
||||
```
|
||||
|
||||
Deploy the first service named `frontend` with `Web Service` type:
|
||||
|
||||
```console
|
||||
$ vela svc deploy frontend --app testapp -t webservice --image crccheck/hello-world
|
||||
App testapp deployed
|
||||
```
|
||||
|
||||
> TODO auto generate a random application name, so --app testapp becomes optional
|
||||
|
||||
Deploy the second service named `backend` with "Backend Worker" type:
|
||||
|
||||
```console
|
||||
$ vela svc deploy backend --app testapp2 -t worker --image crccheck/hello-world
|
||||
App testapp2 deployed
|
||||
```
|
||||
|
||||
```console
|
||||
$ vela ls
|
||||
SERVICE APP TYPE TRAITS STATUS CREATED-TIME
|
||||
frontend testapp ...
|
||||
backend testapp ...
|
||||
```
|
||||
@@ -1,71 +0,0 @@
|
||||
# Managing Capabilities
|
||||
|
||||
This tutorial talks about how to install capabilities (caps) from remote centers.
|
||||
|
||||
## Add Cap Center
|
||||
|
||||
Add and sync a remote center:
|
||||
|
||||
```console
|
||||
$ vela cap center config my-center https://github.com/oam-dev/catalog/tree/master/registry
|
||||
successfully sync 1/1 from my-center remote center
|
||||
Successfully configured capability center my-center and sync from remote
|
||||
|
||||
$ vela cap center sync my-center
|
||||
successfully sync 1/1 from my-center remote center
|
||||
sync finished
|
||||
```
|
||||
|
||||
## List Cap Centers
|
||||
|
||||
```console
|
||||
$ vela cap center ls
|
||||
NAME ADDRESS
|
||||
my-center https://github.com/oam-dev/catalog/tree/master/registry
|
||||
```
|
||||
|
||||
## [Optional] Remove Cap Center
|
||||
|
||||
```console
|
||||
$ vela cap center remove my-center
|
||||
```
|
||||
|
||||
## List Caps
|
||||
|
||||
```console
|
||||
$ vela cap ls my-center
|
||||
NAME CENTER TYPE DEFINITION STATUS APPLIES-TO
|
||||
kubewatch my-center trait kubewatches.labs.bitnami.com uninstalled []
|
||||
```
|
||||
|
||||
## Install Cap
|
||||
|
||||
```console
|
||||
$ vela cap install my-center/kubewatch
|
||||
Installing trait capability kubewatch
|
||||
"my-repo" has been added to your repositories
|
||||
2020/11/06 16:19:30 [debug] creating 1 resource(s)
|
||||
2020/11/06 16:19:30 [debug] CRD kubewatches.labs.bitnami.com is already present. Skipping.
|
||||
2020/11/06 16:19:37 [debug] creating 3 resource(s)
|
||||
Successfully installed chart (kubewatch) with release name (kubewatch)
|
||||
Successfully installed capability kubewatch from my-center
|
||||
```
|
||||
|
||||
Check traits installed:
|
||||
```console
|
||||
$ vela traits
|
||||
Synchronizing capabilities from cluster⌛ ...
|
||||
Sync capabilities successfully ✅ (no changes)
|
||||
TYPE CATEGORY DESCRIPTION
|
||||
kubewatch trait Add a watch for resource
|
||||
...
|
||||
```
|
||||
|
||||
## Uninstall Cap
|
||||
|
||||
> Note: make sure no apps are using the capability before uninstalling.
|
||||
|
||||
```console
|
||||
$ vela cap uninstall my-center/kubewatch
|
||||
Successfully removed chart (kubewatch) with release name (kubewatch)
|
||||
```
|
||||
@@ -1,68 +0,0 @@
|
||||
# Cloud service
|
||||
|
||||
In this demo, we will add an RDS database from Alibaba Cloud to our application.
|
||||
|
||||
## What is cloud service
|
||||
|
||||
Cloud service refers to the managed cloud resources. For example, you can buy a PostgreSql database from a cloud vendor instead of setting up your own. Cloud service are normally outside of your Kubernetes cluster, but logically they are still part of your application. KubeVela provides application centric view of your applications. It will treat every service the same.
|
||||
|
||||
## Crossplane
|
||||
|
||||
Crossplane is an open source Kubernetes add-on that extends any cluster with the ability to provision and manage cloud infrastructure, services, and applications using kubectl, GitOps, or any tool that works with the Kubernetes API. The benefit of using Crossplane is it will provide centralized control plane disregard where your cluster is.
|
||||
|
||||
KubeVela will delegate the lifecycle management of cloud service to Crossplane.
|
||||
|
||||
## Install Crossplane (This demo uses crossplane version 0.13)
|
||||
|
||||
You will need a Kubernetes cluster ver> 1.16 (Minikube and Kind clusters are fine).
|
||||
Also you will need to have KubeVela installed on the cluster.
|
||||
The folder that containes all the demo scripts are under `../../examples/kubecondemo/`. For your convience, cd to that folder first:
|
||||
`cd ../../examples/kubecondemo/`
|
||||
To provision a cloud resource, you need to have the Access Key and Secret to your Alibaba cloud account.
|
||||
|
||||
* Create crossplane namespace: `kubectl create ns crossplane-system`
|
||||
* Install crossplane helm chart: `helm install crossplane charts/crossplane/ --namespace crossplane-system`
|
||||
* Install crossplane cli: `curl -sL https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/install.sh | sh`
|
||||
* Add crossplane to `PATH`: `sudo mv kubectl-crossplane /usr/local/bin`
|
||||
* Configure cloud provider(Alibaba Cloud)
|
||||
* Add cloud provider: `kubectl crossplane install provider crossplane/provider-alibaba:v0.3.0`
|
||||
* Create provider secret: `kubectl create secret generic alibaba-creds --from-literal=accessKeyId=<change here> --from-literal=accessKeySecret=<change here> -n crossplane-system`
|
||||
* Configure the provider: `kubectl apply -f script/provider.yaml`
|
||||
* Configure infrastructure: `kubectl crossplane install configuration crossplane/getting-started-with-alibaba:v0.13`
|
||||
|
||||
So far we have configured Crossplane on the cluster.
|
||||
|
||||
## Import the database workload definition
|
||||
|
||||
First, register the db workload definition:
|
||||
`kubectl apply -f script/def_db.yaml`
|
||||
The webservice workload is different from the default version so we have to overwrite it.
|
||||
`kubectl apply -f cript/webservice.yaml`
|
||||
Don't forget to update vela:
|
||||
`vela system update`
|
||||
|
||||
## Apply the appfile
|
||||
|
||||
In the Appfile, we claim an RDS instance just like other services:
|
||||
|
||||
``` yaml
|
||||
database:
|
||||
type: rds
|
||||
name: alibabaRds
|
||||
...
|
||||
```
|
||||
|
||||
Next, we start the application:
|
||||
`vela up`
|
||||
|
||||
## Verify the database status
|
||||
|
||||
Under the hood, we can verify the status of database(usually takes >6 min to be ready):
|
||||
`kubectl get postgresqlinstance`
|
||||
|
||||
When the database is ready, you can see the `READY: True` output.
|
||||
|
||||
## Access the web-ui
|
||||
|
||||
In the Appfile we added a route trait. To access the web-ui, please check out the [route](set-route.md) documentation.
|
||||
|
||||
@@ -1,242 +0,0 @@
|
||||
# Using Appfile for More Flexible Configuration
|
||||
|
||||
Appfile supports more flexible options than CLI/UI to configure appliation deployment on Vela.
|
||||
A detailed design doc could be found [here](../../design/appfile-design.md).
|
||||
|
||||
In this tutorial, we will build and deploy an example NodeJS app under [examples/testapp/](https://github.com/oam-dev/kubevela/tree/master/examples/testapp).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [docker](https://docs.docker.com/get-docker/) installed on the host
|
||||
- [vela](../../install.md) installed and configured
|
||||
|
||||
## 1. Download test app code
|
||||
|
||||
git clone and go to the testapp directory:
|
||||
|
||||
```console
|
||||
$ git clone https://github.com/oam-dev/kubevela.git
|
||||
$ cd kubevela/examples/testapp
|
||||
```
|
||||
|
||||
The example contains NodeJS app code, Dockerfile to build the app.
|
||||
|
||||
## 2. Deploy app in one command
|
||||
|
||||
In the directory there is a [vela.yaml](../../../examples/testapp/vela.yaml) which follows Appfile format supported by Vela.
|
||||
We are going to use it to build and deploy the app.
|
||||
|
||||
ATTENTION: change the image field in vela.yaml to something you can push to on your host:
|
||||
|
||||
> Or you may try the local testing option introduced in the following section.
|
||||
|
||||
```yaml
|
||||
image: oamdev/testapp:v1
|
||||
```
|
||||
|
||||
Run the following command:
|
||||
|
||||
```console
|
||||
$ vela up
|
||||
Parsing vela.yaml ...
|
||||
Loading templates ...
|
||||
|
||||
Building service (express-server)...
|
||||
Sending build context to Docker daemon 71.68kB
|
||||
Step 1/10 : FROM mhart/alpine-node:12
|
||||
---> 9d88359808c3
|
||||
...
|
||||
|
||||
pushing image (oamdev/testapp:v1)...
|
||||
...
|
||||
|
||||
Rendering configs for service (express-server)...
|
||||
Writing deploy config to (.vela/deploy.yaml)
|
||||
|
||||
Applying deploy configs ...
|
||||
Checking if app has been deployed...
|
||||
App has not been deployed, creating a new deployment...
|
||||
✅ App has been deployed 🚀🚀🚀
|
||||
Port forward: vela port-forward testapp
|
||||
SSH: vela exec testapp
|
||||
Logging: vela logs testapp
|
||||
App status: vela status testapp
|
||||
Service status: vela status testapp --svc express-server
|
||||
```
|
||||
|
||||
|
||||
Check the status of the service:
|
||||
|
||||
```console
|
||||
$ vela status testapp
|
||||
About:
|
||||
|
||||
Name: testapp
|
||||
Namespace: default
|
||||
Created at: 2020-11-02 11:08:32.138484 +0800 CST
|
||||
Updated at: 2020-11-02 11:08:32.138485 +0800 CST
|
||||
|
||||
Services:
|
||||
|
||||
- Name: express-server
|
||||
Type: webservice
|
||||
HEALTHY Ready: 1/1
|
||||
Last Deployment:
|
||||
Created at: 2020-11-02 11:08:33 +0800 CST
|
||||
Updated at: 2020-11-02T11:08:32+08:00
|
||||
Routes:
|
||||
|
||||
```
|
||||
|
||||
### Alternative: Local testing without pushing image remotely
|
||||
|
||||
If you have local [kind](../../install.md#kind) cluster running, you may try the local push option without pushing image remotely.
|
||||
|
||||
Add local option to `build`:
|
||||
|
||||
```yaml
|
||||
build:
|
||||
# push image into local kind cluster without remote transfer
|
||||
push:
|
||||
local: kind
|
||||
|
||||
docker:
|
||||
file: Dockerfile
|
||||
context: .
|
||||
```
|
||||
|
||||
Then deploy the app to kind:
|
||||
|
||||
```console
|
||||
$ vela up
|
||||
```
|
||||
|
||||
### [Optional] Check rendered manifests
|
||||
|
||||
By default, Vela renders the final manifests in `.vela/deploy.yaml`:
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1alpha2
|
||||
kind: ApplicationConfiguration
|
||||
metadata:
|
||||
name: testapp
|
||||
namespace: default
|
||||
spec:
|
||||
components:
|
||||
- componentName: express-server
|
||||
---
|
||||
apiVersion: core.oam.dev/v1alpha2
|
||||
kind: Component
|
||||
metadata:
|
||||
name: express-server
|
||||
namespace: default
|
||||
spec:
|
||||
workload:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: express-server
|
||||
...
|
||||
---
|
||||
apiVersion: core.oam.dev/v1alpha2
|
||||
kind: HealthScope
|
||||
metadata:
|
||||
name: testapp-default-health
|
||||
namespace: default
|
||||
spec:
|
||||
...
|
||||
```
|
||||
|
||||
## 3. Add routing
|
||||
|
||||
Add routing config under `express-server`:
|
||||
|
||||
```yaml
|
||||
servcies:
|
||||
express-server:
|
||||
...
|
||||
|
||||
route:
|
||||
domain: example.com
|
||||
rules:
|
||||
- path: /testapp
|
||||
rewriteTarget: /
|
||||
```
|
||||
|
||||
Apply again:
|
||||
|
||||
```console
|
||||
$ vela up
|
||||
```
|
||||
|
||||
Check the status until we see route trait ready:
|
||||
```console
|
||||
$ vela status testapp
|
||||
About:
|
||||
|
||||
Name: testapp
|
||||
Namespace: default
|
||||
Created at: ...
|
||||
Updated at: ...
|
||||
|
||||
Services:
|
||||
|
||||
- Name: express-server
|
||||
Type: webservice
|
||||
HEALTHY Ready: 1/1
|
||||
Last Deployment:
|
||||
Created at: ...
|
||||
Updated at: ...
|
||||
Routes:
|
||||
- route: Visiting URL: http://example.com IP: localhost
|
||||
```
|
||||
|
||||
**In [kind cluster setup](../../install.md#kind)**, you can visit the service via localhost:
|
||||
|
||||
> If not in kind cluster, replace localhost with ingress address
|
||||
|
||||
```
|
||||
$ curl -H "Host:example.com" http://localhost/testapp
|
||||
Hello World
|
||||
```
|
||||
|
||||
## 4. Add monitoring metrics
|
||||
|
||||
TODO
|
||||
|
||||
## [Optional] Configure "task" workload type
|
||||
|
||||
By now we have deployed a *webservice* workload. We can also add a *task* workload in appfile:
|
||||
|
||||
> Below is a simplified [k8s job example](https://kubernetes.io/docs/concepts/workloads/controllers/job/#running-an-example-job) using Vela:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
pi:
|
||||
image: perl
|
||||
cmd: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
|
||||
|
||||
express-server:
|
||||
...
|
||||
```
|
||||
|
||||
Then deploy appfile again:
|
||||
|
||||
```console
|
||||
$ vela up
|
||||
```
|
||||
|
||||
## What's Next?
|
||||
|
||||
Congratulations! You have just deployed an app using Vela.
|
||||
|
||||
Here are some next steps that you can have more play with your app:
|
||||
|
||||
- [Check Application Logs](../check-logs.md)
|
||||
- [Execute Commands in Container](../exec-cmd.md)
|
||||
- [Port Forward to Container](../port-forward.md)
|
||||
|
||||
|
||||
## References
|
||||
|
||||
For more configuration options of built-in capabilities, check [references](../references/README.md)
|
||||
@@ -1,12 +0,0 @@
|
||||
# Port Forward to Container
|
||||
|
||||
Run:
|
||||
|
||||
```
|
||||
$ vela port-forward testapp
|
||||
Forwarding from 127.0.0.1:8080 -> 8080
|
||||
Forwarding from [::1]:8080 -> 8080
|
||||
|
||||
Forward successfully! Opening browser ...
|
||||
Handling connection for 8080
|
||||
```
|
||||
@@ -1,9 +0,0 @@
|
||||
# KubeVela Capability References
|
||||
|
||||
- [workload types](https://github.com/oam-dev/kubevela/tree/master/docs/developers/references/workload-types)
|
||||
- [trait](https://github.com/oam-dev/kubevela/tree/master/docs/developers/references/traits)
|
||||
|
||||
|
||||
Note: All the contents under this directory are designed to be referenced by other documentations as the full schema or usage of specific workload types or traits.
|
||||
|
||||
In the upcoming releases, we plan to auto-generate all these reference documentations from the CUE templates in KubeVela's definition objects.
|
||||
@@ -1,17 +0,0 @@
|
||||
# Route
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Domain** | **string** | | [default to ]
|
||||
**Issuer** | **string** | | [default to ]
|
||||
**Rules** | [**[]RouteRules**](#routerules) | | [optional]
|
||||
|
||||
|
||||
### RouteRules
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Path** | **string** | |
|
||||
**RewriteTarget** | **string** | | [default to ]
|
||||
@@ -1,7 +0,0 @@
|
||||
# Scaler
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Replica** | **int32** | | [default to 1]
|
||||
@@ -1,8 +0,0 @@
|
||||
# Worker
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Cmd** | **[]string** | | [optional]
|
||||
**Image** | **string** | pecify app image |
|
||||
@@ -1,9 +0,0 @@
|
||||
# Task
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Cmd** | **[]string** | | [optional]
|
||||
**Count** | **int32** | specify number of tasks to run in parallel | [default to 1]
|
||||
**Image** | **string** | specify app image |
|
||||
@@ -1,33 +0,0 @@
|
||||
# Webservice
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Cmd** | **[]string** | | [optional]
|
||||
**Env** | [**[]WebserviceEnv**](#webserviceenv) | | [optional]
|
||||
**Image** | **string** | specify app image |
|
||||
**Port** | **int32** | specify port for container | [default to 6379]
|
||||
|
||||
|
||||
### WebserviceEnv
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Name** | **string** | |
|
||||
**Value** | **string** | | [optional]
|
||||
**ValueFrom** | [**WebserviceValueFrom**](#webservicevaluefrom) | | [optional]
|
||||
|
||||
|
||||
### WebserviceValueFrom
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**SecretKeyRef** | [**WebserviceValueFromSecretKeyRef**](#webservicevaluefromsecretkeyref) | |
|
||||
|
||||
### WebserviceValueFromSecretKeyRef
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Name** | **string** | |
|
||||
**Key** | **string** | |
|
||||
@@ -1,235 +0,0 @@
|
||||
# Automatically scale workloads by resource utilization metrics and cron
|
||||
|
||||
Contents:
|
||||
- [Scale by CPU resource utilization metrics](#Scale by CPU resource utilization metrics)
|
||||
- [Scale workload by cron](#Scale workload by cron)
|
||||
|
||||
## Scale by CPU resource utilization metrics
|
||||
Introduce how to automatically scale workloads by resource utilization metrics in Cli. Currently, only cpu utilization
|
||||
is supported.
|
||||
|
||||
- Deploy an application
|
||||
|
||||
Run the following command to deploy application `helloworld`.
|
||||
|
||||
```
|
||||
$ vela svc deploy frontend -t webservice -a helloworld --image nginx:1.9.2 --port 80 --cpu-requests=0.05
|
||||
App helloworld deployed
|
||||
```
|
||||
|
||||
By default, the replicas of the workload webservice `helloworld` is.
|
||||
|
||||
- Scale the application by CPU utilization metrics
|
||||
```
|
||||
$ vela autoscale helloworld --svc frontend --min 1 --max 5 --cpu 5
|
||||
Adding autoscale for app frontend
|
||||
⠋ Checking Status ...
|
||||
✅ Application Deployed Successfully!
|
||||
- Name: frontend
|
||||
Type: webservice
|
||||
HEALTHY Ready: 1/1
|
||||
Traits:
|
||||
- ✅ autoscale: type: cpu minReplicas: 1 maxReplicas: 5 CPUUtilization(target/current): 5%/0% replicas: 0
|
||||
Last Deployment:
|
||||
Created at: 2020-11-06 16:10:54 +0800 CST
|
||||
Updated at: 2020-11-06T16:19:04+08:0
|
||||
```
|
||||
|
||||
- Access the application with heavy requests
|
||||
|
||||
```
|
||||
$ vela port-forward helloworld 80
|
||||
Forwarding from 127.0.0.1:80 -> 80
|
||||
Forwarding from [::1]:80 -> 80
|
||||
|
||||
Forward successfully! Opening browser ...
|
||||
Handling connection for 80
|
||||
Handling connection for 80
|
||||
Handling connection for 80
|
||||
Handling connection for 80
|
||||
```
|
||||
|
||||
On your macOS, you might need to add `sudo` ahead of the command.
|
||||
|
||||
- Use Apache HTTP server benchmarking tool `ab` to access the application.
|
||||
|
||||
```
|
||||
$ ab -n 10000 -c 200 http://127.0.0.1/
|
||||
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
|
||||
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
|
||||
Licensed to The Apache Software Foundation, http://www.apache.org/
|
||||
|
||||
Benchmarking 127.0.0.1 (be patient)
|
||||
Completed 1000 requests
|
||||
```
|
||||
|
||||
Monitor the replicas of the workload, and its replicas gradually increase from one to four.
|
||||
```
|
||||
$ vela status helloworld --svc frontend
|
||||
About:
|
||||
|
||||
Name: helloworld
|
||||
Namespace: default
|
||||
Created at: 2020-11-05 20:07:21.830118 +0800 CST
|
||||
Updated at: 2020-11-05 20:50:42.664725 +0800 CST
|
||||
|
||||
Services:
|
||||
|
||||
- Name: frontend
|
||||
Type: webservice
|
||||
HEALTHY Ready: 1/1
|
||||
Traits:
|
||||
- ✅ autoscale: type: cpu minReplicas: 1 maxReplicas: 5 CPUUtilization(target/current): 5%/10% replicas: 2
|
||||
Last Deployment:
|
||||
Created at: 2020-11-05 20:07:23 +0800 CST
|
||||
Updated at: 2020-11-05T20:50:42+08:00
|
||||
```
|
||||
|
||||
```
|
||||
$ vela status helloworld --svc frontend
|
||||
About:
|
||||
|
||||
Name: helloworld
|
||||
Namespace: default
|
||||
Created at: 2020-11-05 20:07:21.830118 +0800 CST
|
||||
Updated at: 2020-11-05 20:50:42.664725 +0800 CST
|
||||
|
||||
Services:
|
||||
|
||||
- Name: frontend
|
||||
Type: webservice
|
||||
HEALTHY Ready: 1/1
|
||||
Traits:
|
||||
- ✅ autoscale: type: cpu minReplicas: 1 maxReplicas: 5 CPUUtilization(target/current): 5%/14% replicas: 4
|
||||
Last Deployment:
|
||||
Created at: 2020-11-05 20:07:23 +0800 CST
|
||||
Updated at: 2020-11-05T20:50:42+08:00
|
||||
```
|
||||
|
||||
Stop `ab` tool, and the replicas will decrease to one eventually.
|
||||
|
||||
|
||||
## Scale workload by cron
|
||||
Introduce how to automatically scale workloads by cron in Appfile.
|
||||
|
||||
- Prepare Appfile
|
||||
Follow the instructions of [appfile](./devex/appfile.md) to prepare the `vela.yaml` as below.
|
||||
```
|
||||
name: testapp
|
||||
|
||||
services:
|
||||
express-server:
|
||||
# this image will be used in both build and deploy steps
|
||||
image: zzxwill/kubevela-appfile-demo:v1
|
||||
|
||||
build:
|
||||
# Here more runtime specific build templates will be supported, like NodeJS, Go, Python, Ruby.
|
||||
docker:
|
||||
file: Dockerfile
|
||||
context: .
|
||||
|
||||
cmd: ["node", "server.js"]
|
||||
port: 8080
|
||||
|
||||
autoscale:
|
||||
minReplicas: 1
|
||||
maxReplicas: 4
|
||||
cron:
|
||||
startAt: "14:00"
|
||||
duration: "2h"
|
||||
days: "Monday, Thursday"
|
||||
replicas: "2"
|
||||
timezone: "America/Seattle"
|
||||
```
|
||||
|
||||
- Deploy an application
|
||||
Run the following command to deploy the application defined in `vela.yaml`.
|
||||
|
||||
```
|
||||
$ vela up
|
||||
Parsing vela.yaml ...
|
||||
Loading templates ...
|
||||
|
||||
Building service (express-server)...
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 sha256:c25a03ff9861be1da16a316055d11b83778efa23c655d0e69a902487bbf3c303
|
||||
#2 transferring dockerfile: 37B 0.0s done
|
||||
#2 DONE 0.1s
|
||||
|
||||
...
|
||||
|
||||
pushing image (zzxwill/kubevela-appfile-demo:v1)...
|
||||
The push refers to repository [docker.io/zzxwill/kubevela-appfile-demo]
|
||||
1893e9ad9204: Preparing
|
||||
b60a6f0fd043: Preparing
|
||||
...
|
||||
89ae5c4ee501: Layer already exists
|
||||
b60a6f0fd043: Layer already exists
|
||||
1893e9ad9204: Pushed
|
||||
v1: digest: sha256:11e48ce2205a1d92c1c920b3a3f41d3ee357fa2794261dc0d0e8010068e68da6 size: 1365
|
||||
|
||||
|
||||
Rendering configs for service (express-server)...
|
||||
Writing deploy config to (.vela/deploy.yaml)
|
||||
|
||||
Applying deploy configs ...
|
||||
Checking if app has been deployed...
|
||||
App has not been deployed, creating a new deployment...
|
||||
✅ App has been deployed 🚀🚀🚀
|
||||
Port forward: vela port-forward testapp
|
||||
SSH: vela exec testapp
|
||||
Logging: vela logs testapp
|
||||
App status: vela status testapp
|
||||
Service status: vela status testapp --svc express-server
|
||||
```
|
||||
|
||||
- Check the replicas and wait for the scaling to take effect
|
||||
|
||||
Check the replicas of the application, there is one replica.
|
||||
|
||||
```
|
||||
$ vela status testapp
|
||||
About:
|
||||
|
||||
Name: testapp
|
||||
Namespace: default
|
||||
Created at: 2020-11-05 17:09:02.426632 +0800 CST
|
||||
Updated at: 2020-11-05 17:09:02.426632 +0800 CST
|
||||
|
||||
Services:
|
||||
|
||||
- Name: express-server
|
||||
Type: webservice
|
||||
HEALTHY Ready: 1/1
|
||||
Traits:
|
||||
- ✅ autoscale: type: cron minReplicas: 1 maxReplicas: 4 replicas: 1
|
||||
Last Deployment:
|
||||
Created at: 2020-11-05 17:09:03 +0800 CST
|
||||
Updated at: 2020-11-05T17:09:02+08:00
|
||||
```
|
||||
|
||||
Wait till the time clocks `startAt`, and check again. The replicas become to two, which is specified as
|
||||
`replicas` in `vela.yaml`.
|
||||
|
||||
```
|
||||
$ vela status testapp
|
||||
About:
|
||||
|
||||
Name: testapp
|
||||
Namespace: default
|
||||
Created at: 2020-11-05 17:09:02.426632 +0800 CST
|
||||
Updated at: 2020-11-05 17:09:02.426632 +0800 CST
|
||||
|
||||
Services:
|
||||
|
||||
- Name: express-server
|
||||
Type: webservice
|
||||
HEALTHY Ready: 1/1
|
||||
Traits:
|
||||
- ✅ autoscale: type: cron minReplicas: 1 maxReplicas: 4 replicas: 2
|
||||
Last Deployment:
|
||||
Created at: 2020-11-05 17:09:03 +0800 CST
|
||||
Updated at: 2020-11-05T17:09:02+08:00
|
||||
```
|
||||
|
||||
Wait after the period ends, the replicas will be one eventually.
|
||||
@@ -1,40 +0,0 @@
|
||||
# Monitoring Application
|
||||
|
||||
If your application has exposed metrics, you can easily setup monitoring system
|
||||
with the help of `metric` capability.
|
||||
|
||||
Let's run [`christianhxc/gorandom:1.0`](https://github.com/christianhxc/prometheus-tutorial) as an example app.
|
||||
The app will emit random latencies as metrics.
|
||||
|
||||
```console
|
||||
$ vela svc deploy metricapp -t webservice --image christianhxc/gorandom:1.0 --port 8080
|
||||
```
|
||||
|
||||
Then add metric by:
|
||||
|
||||
```console
|
||||
$ vela metric metricapp
|
||||
Adding metric for app metricapp
|
||||
⠋ Deploying ...
|
||||
✅ Application Deployed Successfully!
|
||||
- Name: metricapp
|
||||
Type: webservice
|
||||
HEALTHY Ready: 1/1
|
||||
Routes:
|
||||
- ✅ metric: Monitoring port: 8080, path: /metrics, format: prometheus, schema: http.
|
||||
Last Deployment:
|
||||
Created at: 2020-11-02 14:31:56 +0800 CST
|
||||
Updated at: 2020-11-02T14:32:00+08:00
|
||||
```
|
||||
|
||||
The metrics trait will automatically discover port and label to monitor if no parameters specified.
|
||||
If more than one ports found, it will choose the first one by default.
|
||||
|
||||
|
||||
## Verify that the metrics are collected on prometheus
|
||||
|
||||
```shell script
|
||||
kubectl --namespace monitoring port-forward `k -n monitoring get pods -l prometheus=oam -o name` 9090
|
||||
```
|
||||
|
||||
Then access the prometheus dashboard via http://localhost:9090/targets
|
||||
@@ -1,3 +0,0 @@
|
||||
# Setting Rollout Strategy
|
||||
|
||||
> TODO
|
||||
@@ -1,72 +0,0 @@
|
||||
# Setting Routes
|
||||
|
||||
Once your web services of the application deployed, you can visit it locally via `port-forward` or
|
||||
from outside world via `route` feature.
|
||||
|
||||
```console
|
||||
$ vela svc ls
|
||||
NAME APP WORKLOAD TRAITS STATUS CREATED-TIME
|
||||
frontend testapp webservice Deployed 2020-09-18 22:42:04 +0800 CST
|
||||
```
|
||||
|
||||
## `port-forward`
|
||||
|
||||
It will directly open browser for you.
|
||||
|
||||
```console
|
||||
$ vela port-forward testapp
|
||||
Forwarding from 127.0.0.1:8080 -> 80
|
||||
Forwarding from [::1]:8080 -> 80
|
||||
|
||||
Forward successfully! Opening browser ...
|
||||
Handling connection for 8080
|
||||
Handling connection for 8080
|
||||
```
|
||||
|
||||
## `route`
|
||||
|
||||
`route` is mainly used for public visiting your app.
|
||||
|
||||
### If you have didn't configure domain in environment
|
||||
|
||||
You can manually configure it by setting domain parameter.
|
||||
|
||||
```console
|
||||
$ vela route testapp --domain frontend.mycustom.domain
|
||||
Adding route for app frontend
|
||||
|
||||
Rendering configs for service (frontend)...
|
||||
⠋ Deploying ...
|
||||
✅ Application Deployed Successfully!
|
||||
Showing status of service(type: webservice) frontend deployed in Environment myenv
|
||||
Service frontend Status: HEALTHY Ready: 1/1
|
||||
route: Visiting URL: http://frontend.mycustom.domain IP: 123.57.10.233
|
||||
|
||||
Last Deployment:
|
||||
Created at: 2020-10-29 15:45:13 +0800 CST
|
||||
Updated at: 2020-10-29T16:12:45+08:00
|
||||
```
|
||||
|
||||
Then you will be able to visit by:
|
||||
|
||||
```shell script
|
||||
$ curl -H "Host:frontend.mycustom.domain" 123.57.10.233
|
||||
```
|
||||
|
||||
### If you have domain set in environment
|
||||
|
||||
```console
|
||||
$ vela route testapp
|
||||
Adding route for app frontend
|
||||
|
||||
Rendering configs for service (frontend)...
|
||||
⠋ Deploying ...
|
||||
✅ Application Deployed Successfully!
|
||||
Showing status of service(type: webservice) frontend deployed in Environment default
|
||||
Service frontend Status: HEALTHY Ready: 1/1
|
||||
route: Visiting URL: https://frontend.123.57.10.233.xip.io IP: 123.57.10.233
|
||||
|
||||
Last Deployment:
|
||||
Created at: 2020-10-29 11:26:46 +0800 CST
|
||||
Updated at: 2020-10-29T11:28:01+08:00
|
||||
```
|
||||
25
docs/en/README.md
Normal file
25
docs/en/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||

|
||||
|
||||
*Make shipping applications more enjoyable.*
|
||||
|
||||
# KubeVela
|
||||
|
||||
For developers, KubeVela is an easy-to-use tool that enables them to describe and ship their applications to Kubernetes with minimal effort.
|
||||
|
||||
For platform builders, KubeVela serves as a framework that empowers them to create developer facing yet highly extensible platforms at ease.
|
||||
|
||||
- Slack: [Discuss](https://cloud-native.slack.com/archives/C01BLQ3HTJA)
|
||||
- Gitter: [Community](https://gitter.im/oam-dev/community)
|
||||
|
||||
> NOTE: KubeVela is still in early stage and iterating quickly. It's currently under preview release.
|
||||
|
||||
## Quick Start
|
||||
|
||||
Quick start guides are available on [this section](/en/quick-start).
|
||||
|
||||
|
||||
## Contributing
|
||||
Check out [CONTRIBUTING](https://github.com/oam-dev/kubevela/blob/master/CONTRIBUTING.md) to see how to develop with KubeVela.
|
||||
|
||||
## Code of Conduct
|
||||
This project has adopted the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). See [CODE OF CONDUCT](CODE_OF_CONDUCT.md) for details.
|
||||
1
docs/en/blog/README.md
Normal file
1
docs/en/blog/README.md
Normal file
@@ -0,0 +1 @@
|
||||
## Some blog
|
||||
1
docs/en/blog/_sidebar.md
Normal file
1
docs/en/blog/_sidebar.md
Normal file
@@ -0,0 +1 @@
|
||||
- [Blog](/en/blog/README.md)
|
||||
@@ -20,23 +20,24 @@ vela [flags]
|
||||
### SEE ALSO
|
||||
|
||||
* [vela autoscale](vela_autoscale.md) - Attach autoscale trait to an app
|
||||
* [vela cap](vela_cap.md) - Capability Management
|
||||
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
|
||||
* [vela completion](vela_completion.md) - Output shell completion code for the specified shell (bash or zsh)
|
||||
* [vela config](vela_config.md) - Manage application configurations
|
||||
* [vela config](vela_config.md) - Manage configurations
|
||||
* [vela dashboard](vela_dashboard.md) - Setup API Server and launch Dashboard
|
||||
* [vela delete](vela_delete.md) - Delete Applications
|
||||
* [vela env](vela_env.md) - Manage application environments
|
||||
* [vela exec](vela_exec.md) - Execute a command in a container
|
||||
* [vela init](vela_init.md) - Init an OAM Application
|
||||
* [vela install](vela_install.md) - Initialize vela on both client and server
|
||||
* [vela delete](vela_delete.md) - Delete an application
|
||||
* [vela env](vela_env.md) - Manage environments
|
||||
* [vela exec](vela_exec.md) - Execute command in a container
|
||||
* [vela init](vela_init.md) - Create scaffold for an application
|
||||
* [vela install](vela_install.md) - Install Vela Core with built-in capabilities
|
||||
* [vela logs](vela_logs.md) - Tail logs for application
|
||||
* [vela ls](vela_ls.md) - List services
|
||||
* [vela metric](vela_metric.md) - Attach metric trait to an app
|
||||
* [vela port-forward](vela_port-forward.md) - Forward one or more local ports to a Pod of a service in an application
|
||||
* [vela metrics](vela_metrics.md) - Attach metrics trait to an app
|
||||
* [vela port-forward](vela_port-forward.md) - Forward local ports to services in an application
|
||||
* [vela rollout](vela_rollout.md) - Attach rollout trait to an app
|
||||
* [vela route](vela_route.md) - Attach route trait to an app
|
||||
* [vela scaler](vela_scaler.md) - Attach scaler trait to an app
|
||||
* [vela show](vela_show.md) - Get details of an application
|
||||
* [vela status](vela_status.md) - get status of an application
|
||||
* [vela show](vela_show.md) - Show details of an application
|
||||
* [vela status](vela_status.md) - Show status of an application
|
||||
* [vela svc](vela_svc.md) - Manage services
|
||||
* [vela system](vela_system.md) - System management utilities
|
||||
* [vela template](vela_template.md) - Manage templates
|
||||
@@ -45,4 +46,4 @@ vela [flags]
|
||||
* [vela version](vela_version.md) - Prints out build version information
|
||||
* [vela workloads](vela_workloads.md) - List workloads
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -19,19 +19,13 @@ vela autoscale frontend
|
||||
### Options
|
||||
|
||||
```
|
||||
--days string
|
||||
--cpu-percent int specify the value for CPU utilization, like 80, which means 80%
|
||||
--detach detach trait from service
|
||||
--duration string
|
||||
-h, --help help for autoscale
|
||||
--maxReplicas int (default 4)
|
||||
--minReplicas int (default 1)
|
||||
--name string
|
||||
--replicas string (default "2")
|
||||
--max int maximal replicas of the workload
|
||||
--min int minimal replicas of the workload
|
||||
-s, --staging only save changes locally without real update application
|
||||
--startAt string
|
||||
--svc string specify one service belonging to the application
|
||||
--timezone string (default "Asia/Shanghai")
|
||||
--type string (default "cron")
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
@@ -44,4 +38,4 @@ vela autoscale frontend
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,10 +1,10 @@
|
||||
## vela cap
|
||||
|
||||
Capability Management
|
||||
Manage capability centers and installing/uninstalling capabilities
|
||||
|
||||
### Synopsis
|
||||
|
||||
Capability Management with config, list, add, remove capabilities
|
||||
Manage capability centers and installing/uninstalling capabilities
|
||||
|
||||
### Options
|
||||
|
||||
@@ -26,4 +26,4 @@ Capability Management with config, list, add, remove capabilities
|
||||
* [vela cap ls](vela_cap_ls.md) - List capabilities from cap-center
|
||||
* [vela cap uninstall](vela_cap_uninstall.md) - Uninstall capability from cluster
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -20,10 +20,10 @@ Manage Capability Center with config, sync, list
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela cap](vela_cap.md) - Capability Management
|
||||
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
|
||||
* [vela cap center config](vela_cap_center_config.md) - Configure (add if not exist) a capability center, default is local (built-in capabilities)
|
||||
* [vela cap center ls](vela_cap_center_ls.md) - List all capability centers
|
||||
* [vela cap center remove](vela_cap_center_remove.md) - Remove specified capability center
|
||||
* [vela cap center sync](vela_cap_center_sync.md) - Sync capabilities from remote center, default to sync all centers
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -33,4 +33,4 @@ vela cap center config mycenter https://github.com/oam-dev/catalog/cap-center
|
||||
|
||||
* [vela cap center](vela_cap_center.md) - Manage Capability Center
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -32,4 +32,4 @@ vela cap center ls
|
||||
|
||||
* [vela cap center](vela_cap_center.md) - Manage Capability Center
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -32,4 +32,4 @@ vela cap center remove mycenter
|
||||
|
||||
* [vela cap center](vela_cap_center.md) - Manage Capability Center
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -32,4 +32,4 @@ vela cap center sync mycenter
|
||||
|
||||
* [vela cap center](vela_cap_center.md) - Manage Capability Center
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -31,6 +31,6 @@ vela cap install mycenter/route
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela cap](vela_cap.md) - Capability Management
|
||||
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -30,6 +30,6 @@ vela cap ls
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela cap](vela_cap.md) - Capability Management
|
||||
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -31,6 +31,6 @@ vela cap uninstall route
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela cap](vela_cap.md) - Capability Management
|
||||
* [vela cap](vela_cap.md) - Manage capability centers and installing/uninstalling capabilities
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -27,4 +27,4 @@ of vela commands.
|
||||
* [vela completion bash](vela_completion_bash.md) - generate autocompletions script for bash
|
||||
* [vela completion zsh](vela_completion_zsh.md) - generate autocompletions script for zsh
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -36,4 +36,4 @@ vela completion bash
|
||||
|
||||
* [vela completion](vela_completion.md) - Output shell completion code for the specified shell (bash or zsh)
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -33,4 +33,4 @@ vela completion zsh
|
||||
|
||||
* [vela completion](vela_completion.md) - Output shell completion code for the specified shell (bash or zsh)
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,10 +1,10 @@
|
||||
## vela config
|
||||
|
||||
Manage application configurations
|
||||
Manage configurations
|
||||
|
||||
### Synopsis
|
||||
|
||||
Manage application configurations under given env
|
||||
Manage configurations
|
||||
|
||||
### Options
|
||||
|
||||
@@ -26,4 +26,4 @@ Manage application configurations under given env
|
||||
* [vela config ls](vela_config_ls.md) - List configs
|
||||
* [vela config set](vela_config_set.md) - Set data for a config
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -30,6 +30,6 @@ vela config del <config-name>
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela config](vela_config.md) - Manage application configurations
|
||||
* [vela config](vela_config.md) - Manage configurations
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -30,6 +30,6 @@ vela config get <config-name>
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela config](vela_config.md) - Manage application configurations
|
||||
* [vela config](vela_config.md) - Manage configurations
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -30,6 +30,6 @@ vela config ls
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela config](vela_config.md) - Manage application configurations
|
||||
* [vela config](vela_config.md) - Manage configurations
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -30,6 +30,6 @@ vela config set <config-name> KEY=VALUE K2=V2
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela config](vela_config.md) - Manage application configurations
|
||||
* [vela config](vela_config.md) - Manage configurations
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -38,4 +38,4 @@ dashboard
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,13 +1,13 @@
|
||||
## vela delete
|
||||
|
||||
Delete Applications
|
||||
Delete an application
|
||||
|
||||
### Synopsis
|
||||
|
||||
Delete Applications
|
||||
Delete an application
|
||||
|
||||
```
|
||||
vela delete <APPLICATION_NAME>
|
||||
vela delete APP_NAME
|
||||
```
|
||||
|
||||
### Examples
|
||||
@@ -33,4 +33,4 @@ vela delete frontend
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,10 +1,10 @@
|
||||
## vela env
|
||||
|
||||
Manage application environments
|
||||
Manage environments
|
||||
|
||||
### Synopsis
|
||||
|
||||
Manage application environments
|
||||
Manage environments
|
||||
|
||||
### Options
|
||||
|
||||
@@ -26,4 +26,4 @@ Manage application environments
|
||||
* [vela env ls](vela_env_ls.md) - List environments
|
||||
* [vela env set](vela_env_set.md) - Set an environment
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -30,6 +30,6 @@ vela env delete test
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela env](vela_env.md) - Manage application environments
|
||||
* [vela env](vela_env.md) - Manage environments
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -23,6 +23,7 @@ vela env init test --namespace test --email my@email.com
|
||||
--email string specify email for production TLS Certificate notification
|
||||
-h, --help help for init
|
||||
--namespace string specify K8s namespace for env
|
||||
-s, --sync synchronize capabilities from cluster into local (default true)
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
@@ -33,6 +34,6 @@ vela env init test --namespace test --email my@email.com
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela env](vela_env.md) - Manage application environments
|
||||
* [vela env](vela_env.md) - Manage environments
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -30,6 +30,6 @@ vela env ls [env-name]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela env](vela_env.md) - Manage application environments
|
||||
* [vela env](vela_env.md) - Manage environments
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -30,6 +30,6 @@ vela env set test
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela env](vela_env.md) - Manage application environments
|
||||
* [vela env](vela_env.md) - Manage environments
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,13 +1,13 @@
|
||||
## vela exec
|
||||
|
||||
Execute a command in a container
|
||||
Execute command in a container
|
||||
|
||||
### Synopsis
|
||||
|
||||
Execute a command in the 1st container of specific Application => Service => (1st)Pod
|
||||
Execute command in a container
|
||||
|
||||
```
|
||||
vela exec [flags] AppName -- COMMAND [args...]
|
||||
vela exec [flags] APP_NAME -- COMMAND [args...]
|
||||
```
|
||||
|
||||
### Options
|
||||
@@ -29,4 +29,4 @@ vela exec [flags] AppName -- COMMAND [args...]
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,10 +1,10 @@
|
||||
## vela init
|
||||
|
||||
Init an OAM Application
|
||||
Create scaffold for an application
|
||||
|
||||
### Synopsis
|
||||
|
||||
Init an OAM Application by one command
|
||||
Create scaffold for an application
|
||||
|
||||
```
|
||||
vela init
|
||||
@@ -33,4 +33,4 @@ vela init
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,10 +1,10 @@
|
||||
## vela install
|
||||
|
||||
Initialize vela on both client and server
|
||||
Install Vela Core with built-in capabilities
|
||||
|
||||
### Synopsis
|
||||
|
||||
Install OAM runtime and vela builtin capabilities.
|
||||
Install Vela Core with built-in capabilities
|
||||
|
||||
```
|
||||
vela install [flags]
|
||||
@@ -18,7 +18,7 @@ vela install [flags]
|
||||
--image-repo string vela core image repo, this will align to chart value image.repo (default "oamdev/vela-core")
|
||||
--image-tag string vela core image repo, this will align to chart value image.tag (default "latest")
|
||||
-p, --vela-chart-path string path to vela core chart to override default chart
|
||||
-w, --wait wait until vela-core is ready to serve
|
||||
-w, --wait string wait until vela-core is ready to serve, default will not wait (default "0s")
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
@@ -31,4 +31,4 @@ vela install [flags]
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -27,4 +27,4 @@ vela logs [flags]
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -4,7 +4,7 @@ List services
|
||||
|
||||
### Synopsis
|
||||
|
||||
List services with their application, type, traits, status and created time, etc.
|
||||
List services of all applications
|
||||
|
||||
```
|
||||
vela ls
|
||||
@@ -33,4 +33,4 @@ vela ls
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,19 +1,19 @@
|
||||
## vela metric
|
||||
## vela metrics
|
||||
|
||||
Attach metric trait to an app
|
||||
Attach metrics trait to an app
|
||||
|
||||
### Synopsis
|
||||
|
||||
Attach metric trait to an app
|
||||
Attach metrics trait to an app
|
||||
|
||||
```
|
||||
vela metric <appname> [args]
|
||||
vela metrics <appname> [args]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
vela metric frontend
|
||||
vela metrics frontend
|
||||
```
|
||||
|
||||
### Options
|
||||
@@ -22,8 +22,8 @@ vela metric frontend
|
||||
--detach detach trait from service
|
||||
--enabled (default true)
|
||||
-f, --format string format of the metrics, default as prometheus (default "prometheus")
|
||||
-h, --help help for metric
|
||||
--path string the metric path of the service (default "/metrics")
|
||||
-h, --help help for metrics
|
||||
--path string the metrics path of the service (default "/metrics")
|
||||
--port int the port for metrics, will discovery automatically by default
|
||||
--scheme string (default "http")
|
||||
-s, --staging only save changes locally without real update application
|
||||
@@ -40,4 +40,4 @@ vela metric frontend
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,10 +1,10 @@
|
||||
## vela port-forward
|
||||
|
||||
Forward one or more local ports to a Pod of a service in an application
|
||||
Forward local ports to services in an application
|
||||
|
||||
### Synopsis
|
||||
|
||||
Forward one or more local ports to a Pod of a service in an application
|
||||
Forward local ports to services in an application
|
||||
|
||||
```
|
||||
vela port-forward APP_NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N] [flags]
|
||||
@@ -16,6 +16,7 @@ vela port-forward APP_NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:
|
||||
--address strings Addresses to listen on (comma separated). Only accepts IP addresses or localhost as a value. When localhost is supplied, vela will try to bind on both 127.0.0.1 and ::1 and will fail if neither of these addresses are available to bind. (default [localhost])
|
||||
-h, --help help for port-forward
|
||||
--pod-running-timeout duration The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running (default 1m0s)
|
||||
--route forward ports from route trait service
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
@@ -28,4 +29,4 @@ vela port-forward APP_NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
41
docs/en/cli/vela_rollout.md
Normal file
41
docs/en/cli/vela_rollout.md
Normal file
@@ -0,0 +1,41 @@
|
||||
## vela rollout
|
||||
|
||||
Attach rollout trait to an app
|
||||
|
||||
### Synopsis
|
||||
|
||||
Attach rollout trait to an app
|
||||
|
||||
```
|
||||
vela rollout <appname> [args]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
vela rollout frontend
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--detach detach trait from service
|
||||
-h, --help help for rollout
|
||||
--interval string (default "30s")
|
||||
--replicas int total replicas of the workload (default 2)
|
||||
-s, --staging only save changes locally without real update application
|
||||
--step-weight int weight percent of every step in rolling update (default 50)
|
||||
--svc string specify one service belonging to the application
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
-e, --env string specify environment name for application
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -37,4 +37,4 @@ vela route frontend
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -19,11 +19,11 @@ vela scaler frontend
|
||||
### Options
|
||||
|
||||
```
|
||||
--detach detach trait from service
|
||||
-h, --help help for scaler
|
||||
-r, --replica int (default 1)
|
||||
-s, --staging only save changes locally without real update application
|
||||
--svc string specify one service belonging to the application
|
||||
--detach detach trait from service
|
||||
-h, --help help for scaler
|
||||
-r, --replicas int (default 1)
|
||||
-s, --staging only save changes locally without real update application
|
||||
--svc string specify one service belonging to the application
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
@@ -36,4 +36,4 @@ vela scaler frontend
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,19 +1,19 @@
|
||||
## vela show
|
||||
|
||||
Get details of an application
|
||||
Show details of an application
|
||||
|
||||
### Synopsis
|
||||
|
||||
Get details of an application
|
||||
Show details of an application
|
||||
|
||||
```
|
||||
vela show <APPLICATION-NAME> [flags]
|
||||
vela show APP_NAME [flags]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
vela show <APPLICATION-NAME>
|
||||
vela show APP_NAME
|
||||
```
|
||||
|
||||
### Options
|
||||
@@ -33,4 +33,4 @@ vela show <APPLICATION-NAME>
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -1,19 +1,19 @@
|
||||
## vela status
|
||||
|
||||
get status of an application
|
||||
Show status of an application
|
||||
|
||||
### Synopsis
|
||||
|
||||
get status of an application, including workloads and traits of each service.
|
||||
Show status of an application, including workloads and traits of each service.
|
||||
|
||||
```
|
||||
vela status <APPLICATION-NAME> [flags]
|
||||
vela status APP_NAME [flags]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
vela status <APPLICATION-NAME>
|
||||
vela status APP_NAME
|
||||
```
|
||||
|
||||
### Options
|
||||
@@ -33,4 +33,4 @@ vela status <APPLICATION-NAME>
|
||||
|
||||
* [vela](vela.md) -
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -24,4 +24,4 @@ Manage services
|
||||
* [vela](vela.md) -
|
||||
* [vela svc deploy](vela_svc_deploy.md) - Initialize and run a service
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -35,4 +35,4 @@ vela svc deploy -t <SERVICE_TYPE>
|
||||
|
||||
* [vela svc](vela_svc.md) - Manage services
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -22,6 +22,5 @@ System management utilities
|
||||
|
||||
* [vela](vela.md) -
|
||||
* [vela system info](vela_system_info.md) - Show vela client and cluster chartPath
|
||||
* [vela system update](vela_system_update.md) - Sync definition from cluster
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -26,4 +26,4 @@ vela system info [flags]
|
||||
|
||||
* [vela system](vela_system.md) - System management utilities
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
@@ -23,4 +23,4 @@ Manage templates
|
||||
* [vela](vela.md) -
|
||||
* [vela template context](vela_template_context.md) - Show context parameters
|
||||
|
||||
###### Auto generated by spf13/cobra on 6-Nov-2020
|
||||
###### Auto generated by spf13/cobra on 16-Nov-2020
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user