Skip to content

Commit

Permalink
Feat: bump vela to v1.5.0-beta.1 (#70)
Browse files Browse the repository at this point in the history
* Feat: bump vela to v1.5.0-beta.1

Signed-off-by: qiaozp <[email protected]>

* go.sum

Signed-off-by: qiaozp <[email protected]>
  • Loading branch information
chivalryq authored Jul 26, 2022
1 parent c4231d5 commit 4ab6e5f
Show file tree
Hide file tree
Showing 13 changed files with 234 additions and 334 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include makefiles/dependency.mk

K3S_VERSION ?= v1.21.10+k3s1
STATIC_DIR := pkg/resources/static
VELA_VERSION ?= v1.5.0-alpha.3
VELAUX_VERSION ?= v1.5.0-alpha.3
VELA_VERSION ?= v1.5.0-beta.1
VELAUX_VERSION ?= v1.5.0-beta.1
LDFLAGS= "-X github.com/oam-dev/velad/version.VelaUXVersion=${VELAUX_VERSION} -X github.com/oam-dev/velad/version.VelaVersion=${VELA_VERSION}"
OS ?= linux
ARCH ?= amd64
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/fatih/color v1.13.0
github.com/k3d-io/k3d/v5 v5.4.1
github.com/kyokomi/emoji/v2 v2.2.9
github.com/oam-dev/kubevela v1.5.0-alpha.3
github.com/oam-dev/kubevela v1.5.0-beta.1
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.4.0
github.com/stretchr/testify v1.7.1
Expand Down Expand Up @@ -292,6 +292,7 @@ require (
sigs.k8s.io/apiserver-network-proxy v0.0.30 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30 // indirect
sigs.k8s.io/apiserver-runtime v1.1.1 // indirect
sigs.k8s.io/gateway-api v0.4.3 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/kind v0.9.0 // indirect
sigs.k8s.io/kustomize/api v0.10.1 // indirect
Expand Down
309 changes: 11 additions & 298 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/resources/static/vela/charts/vela-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: v1.5.0-alpha.3
version: v1.5.0-beta.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: v1.5.0-alpha.3
appVersion: v1.5.0-beta.1

home: https://kubevela.io
icon: https://kubevela.io/img/logo.svg
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/apply-once.cue
apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Configure the behaviour of preventing configuration drift.
name: apply-once
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
#ApplyOnceStrategy: {
// +usage=Specify the path of the resource that allow configuration drift
path: [...string]
}
#ApplyOncePolicyRule: {
// +usage=Specify how to select the targets of the rule
selector?: #ResourcePolicyRuleSelector
// +usage=Specify the strategy for configuring the resource level configuration drift behaviour
strategy: #ApplyOnceStrategy
}
#ResourcePolicyRuleSelector: {
// +usage=Select resources by component names
componentNames?: [...string]
// +usage=Select resources by component types
componentTypes?: [...string]
// +usage=Select resources by oamTypes (COMPONENT or TRAIT)
oamTypes?: [...string]
// +usage=Select resources by trait types
traitTypes?: [...string]
// +usage=Select resources by resource types (like Deployment)
resourceTypes?: [...string]
// +usage=Select resources by their names
resourceNames?: [...string]
}
parameter: {
// +usage=Whether to enable apply-once for the whole application
enable: *false | bool
// +usage=Specify the rules for configuring apply-once policy in resource level
rules?: [...#ApplyOncePolicyRule]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
annotations:
custom.definition.oam.dev/alias.config.oam.dev: Image Registry
alias.config.oam.dev: Image Registry
definition.oam.dev/description: Config information to authenticate image registry
labels:
custom.definition.oam.dev/catalog.config.oam.dev: velacore-config
custom.definition.oam.dev/multi-cluster.config.oam.dev: "true"
custom.definition.oam.dev/type.config.oam.dev: image-registry
catalog.config.oam.dev: velacore-config
custom.definition.oam.dev/ui-hidden: "true"
multi-cluster.config.oam.dev: "true"
type.config.oam.dev: image-registry
name: config-image-registry
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ spec:
schematic:
cue:
template: |
import (
"strconv"
)
outputs: service: {
apiVersion: "v1"
kind: "Service"
metadata: name: context.name
metadata: name: context.name
metadata: annotations: parameter.annotations
spec: {
selector: "app.oam.dev/component": context.name
ports: [
for p in parameter.port {
name: "port-" + strconv.FormatInt(p, 10)
port: p
targetPort: p
},
Expand All @@ -32,7 +38,33 @@ spec:
parameter: {
// +usage=Specify the exposion ports
port: [...int]
// +usage=Specify the annotaions of the exposed service
annotations: [string]: string
// +usage=Specify what kind of Service you want. options: "ClusterIP","NodePort","LoadBalancer","ExternalName"
type: *"ClusterIP" | "NodePort" | "LoadBalancer" | "ExternalName"
}
status:
customStatus: |-
message: *"" | string
service: context.outputs.service
if service.spec.type == "ClusterIP" {
message: "ClusterIP: \(service.spec.clusterIP)"
}
if service.spec.type == "LoadBalancer" {
status: service.status
isHealth: status != _|_ && status.loadBalancer != _|_ && status.loadBalancer.ingress != _|_ && len(status.loadBalancer.ingress) > 0
if !isHealth {
message: "ExternalIP: Pending"
}
if isHealth {
message: "ExternalIP: \(status.loadBalancer.ingress[0].ip)"
}
}
healthPolicy: |-
isHealth: *true | bool
service: context.outputs.service
if service.spec.type == "LoadBalancer" {
status: service.status
isHealth: status != _|_ && status.loadBalancer != _|_ && status.loadBalancer.ingress != _|_ && len(status.loadBalancer.ingress) > 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/garbage-collect.cue
apiVersion: core.oam.dev/v1beta1
kind: PolicyDefinition
metadata:
annotations:
definition.oam.dev/description: Configure the garbage collect behaviour for the application.
name: garbage-collect
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
schematic:
cue:
template: |
#GarbageCollectPolicyRule: {
// +usage=Specify how to select the targets of the rule
selector: [...#ResourcePolicyRuleSelector]
// +usage=Specify the strategy for target resource to recycle
strategy: *"onAppUpdate" | "onAppDelete" | "never"
}
#ResourcePolicyRuleSelector: {
// +usage=Select resources by component names
componentNames?: [...string]
// +usage=Select resources by component types
componentTypes?: [...string]
// +usage=Select resources by oamTypes (COMPONENT or TRAIT)
oamTypes?: [...string]
// +usage=Select resources by trait types
traitTypes?: [...string]
// +usage=Select resources by resource types (like Deployment)
resourceTypes?: [...string]
// +usage=Select resources by their names
resourceNames?: [...string]
}
parameter: {
// +usage=If is set, outdated versioned resourcetracker will not be recycled automatically, outdated resources will be kept until resourcetracker be deleted manually
keepLegacyResource: *false | bool
// +usage=Specify the list of rules to control gc strategy at resource level, if one resource is controlled by multiple rules, first rule will be used
rules?: [...#GarbageCollectPolicyRule]
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ spec:
if !parameter.classInSpec {
"kubernetes.io/ingress.class": parameter.class
}
if parameter.gatewayHost != _|_ {
"ingress.controller/host": parameter.gatewayHost
}
}
}
spec: {
Expand Down Expand Up @@ -84,6 +87,9 @@ spec:
// +usage=Specify the secret name you want to quote.
secretName?: string
// +usage=Specify the host of the ingress gateway, which is used to generate the endpoints when the host is empty.
gatewayHost?: string
}
status:
customStatus: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ spec:
cue:
template: |
#K8sObject: {
resource?: string
group?: string
name?: string
// +usage=The resource type for the Kubernetes objects
resource?: string
// +usage=The group name for the Kubernetes objects
group?: string
// +usage=If specified, fetch the Kubernetes objects with the name, exclusive to labelSelector
name?: string
// +usage=If specified, fetch the Kubernetes objects from the namespace. Otherwise, fetch from the application's namespace.
namespace?: string
cluster?: string
// +usage=If specified, fetch the Kubernetes objects from the cluster. Otherwise, fetch from the local cluster.
cluster?: string
// +usage=If specified, fetch the Kubernetes objects according to the label selector, exclusive to name
labelSelector?: [string]: string
...
}
Expand All @@ -35,7 +41,12 @@ spec:
}
}
}
parameter: objects: [...#K8sObject]
parameter: {
// +usage=If specified, application will fetch native Kubernetes objects according to the object description
objects?: [...#K8sObject]
// +usage=If specified, the objects in the urls will be loaded.
urls?: [...string]
}
status:
customStatus: |-
if context.output.apiVersion == "apps/v1" && context.output.kind == "Deployment" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ spec:
{
name: "pvc-" + v.name
mountPath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
}
}
},
Expand All @@ -73,6 +76,9 @@ spec:
{
name: "configmap-" + v.name
mountPath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
}
},
] | []
Expand Down Expand Up @@ -114,6 +120,9 @@ spec:
{
name: "secret-" + v.name
mountPath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
}
},
] | []
Expand Down Expand Up @@ -155,6 +164,9 @@ spec:
{
name: "emptydir-" + v.name
mountPath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
}
},
] | []
Expand All @@ -163,12 +175,28 @@ spec:
{
name: "pvc-" + v.name
devicePath: v.mountPath
if v.subPath != _|_ {
subPath: v.subPath
}
}
},
] | []
volumesList: pvcVolumesList + configMapVolumesList + secretVolumesList + emptyDirVolumesList
deDupVolumesArray: [
for val in [
for i, vi in volumesList {
for j, vj in volumesList if j < i && vi.name == vj.name {
_ignore: true
}
vi
},
] if val._ignore == _|_ {
val
},
]
patch: spec: template: spec: {
// +patchKey=name
volumes: pvcVolumesList + configMapVolumesList + secretVolumesList + emptyDirVolumesList
volumes: deDupVolumesArray
containers: [{
// +patchKey=name
Expand Down Expand Up @@ -256,6 +284,7 @@ spec:
name: string
mountOnly: *false | bool
mountPath: string
subPath?: string
volumeMode: *"Filesystem" | string
volumeName?: string
accessModes: *["ReadWriteOnce"] | [...string]
Expand Down Expand Up @@ -297,6 +326,7 @@ spec:
configMapKey: string
}]
mountPath?: string
subPath?: string
defaultMode: *420 | int
readOnly: *false | bool
data?: {...}
Expand All @@ -320,6 +350,7 @@ spec:
secretKey: string
}]
mountPath?: string
subPath?: string
defaultMode: *420 | int
readOnly: *false | bool
stringData?: {...}
Expand All @@ -335,6 +366,7 @@ spec:
emptyDir?: [...{
name: string
mountPath: string
subPath?: string
medium: *"" | "Memory"
}]
}
Expand Down
Loading

0 comments on commit 4ab6e5f

Please sign in to comment.