NAME COMPLETIONS DURATION AGE job.batch/test-task 0/10 17s 17s
NAME CLASS HOSTS ADDRESS PORTS AGE ingress.extensions/test-web-service-route-5897fbd549-0 <none> kubevela.lishuai.fun 80 16s [root@master-01 testapp]# curl kubevela.lishuai.fun/metrics # HELP go_build_info Build information about the main Go module. # TYPE go_build_info gauge go_build_info{checksum="unknown",path="unknown",version="unknown"} 1 # HELP go_gc_duration_seconds A summary of the GC invocation durations. # TYPE go_gc_duration_seconds summary go_gc_duration_seconds{quantile="0"} 2.8372e-05 go_gc_duration_seconds{quantile="0.25"} 2.8372e-05 go_gc_duration_seconds{quantile="0.5"} 6.7686e-05 go_gc_duration_seconds{quantile="0.75"} 7.9579e-05 go_gc_duration_seconds{quantile="1"} 7.9579e-05 go_gc_duration_seconds_sum 0.000175637
services: _service-name_:#_service # If `build` section exists, this field will be used as the name to build image. Otherwise, KubeVela will try to pull the image with given name directly. image:oamdev/testapp:v1
build: docker: file:_Dockerfile_path_# relative path is supported, e.g. "./Dockerfile" context:_build_context_path_# relative path is supported, e.g. "."
push: local:kind# optionally push to local KinD cluster instead of remote registry
type:webservice(default)|worker|task
# detailed configurations of workload ...propertiesofthespecifiedworkload...
_trait_1_: # properties of trait 1
_trait_2_: # properties of trait 2
...moretraitsandtheirproperties...
_another_service_name_:# more services can be defined ...
appfile文件主要分为两个部分
段
描述
name
定义了我们要定义的app的名称
services
定义了我们要创建的application的具体,services段下可以定义多个服务。
Workload type
services可以配置多个服务,每个服务根据workload type不同会被创建为不同的k8s中的资源对象,vela暂时具有以下三种workload type
web service
Web Service 是一种工作负载类型,用于描述长期运行的,可伸缩的,容器化的服务,这些服务具有稳定的网络终结点,可以接收来自客户的外部网络流量。