Chore: remove outdated apis(v1alppha2 ApplicationConfiguration Component, and HealthScope, Rollout) (#6041)

* remove outdated api

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix rt test: no component rt

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* recover context.revision to component hash

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
This commit is contained in:
Somefive
2023-06-01 09:32:49 +08:00
committed by GitHub
parent d6788f12dd
commit dd899c2b39
284 changed files with 517 additions and 66926 deletions
-51
View File
@@ -1,51 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: app-healthscope
spec:
components:
- name: my-server-1
type: webservice
properties:
cmd:
- node
- server.js
image: oamdev/testapp:v1
port: 8080
traits:
- type: gateway
properties:
class: traefik
domain: test.my.domain
http:
"/": 8080
- name: my-server-2
type: webservice
properties:
cmd:
- node
- server.js
image: oamdev/testapp:v1
port: 8080
traits:
- type: gateway
properties:
class: traefik
domain: test.my.domain
http:
"/": 8080
policies:
- name: app-healthscope
type: health
properties:
probeInterval: 5
workflow:
steps:
- name: apply-my-server-1
type: apply-component
properties:
component: my-server-1
- name: apply-my-server-2
type: apply-component
properties:
component: my-server-2
@@ -1,34 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: app-healthscope-unhealthy
spec:
components:
- name: my-server-unhealthy
type: webservice
properties:
cmd:
- node
- server.js
image: oamdev/testapp:boom # make it unhealthy
port: 8080
- name: my-server
type: webservice
properties:
cmd:
- node
- server.js
image: oamdev/testapp:v1
port: 8080
traits:
- type: gateway
properties:
class: traefik
domain: test.my.domain
http:
"/": 8080
policies:
- name: app-healthscope-unhealthy
type: health
properties:
probeInterval: 5
-14
View File
@@ -1,14 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
metadata:
name: example-appconfig
namespace: component-versioning-test
spec:
components:
- componentName: example-component
traits:
- trait:
apiVersion: example.com/v1
kind: Bar
spec:
foo: bar
-11
View File
@@ -1,11 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
name: example-component
namespace: component-versioning-test
spec:
workload:
apiVersion: example.com/v1
kind: Bar
spec:
key: v1
-11
View File
@@ -1,11 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
name: example-component
namespace: component-versioning-test
spec:
workload:
apiVersion: example.com/v1
kind: Bar
spec:
key: v2
@@ -1,8 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: bars.example.com
namespace: oam-runtime-system
spec:
definitionRef:
name: bars.example.com
-9
View File
@@ -1,9 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: TraitDefinition
metadata:
name: bars.example.com
namespace: oam-runtime-system
spec:
revisionEnabled: true
definitionRef:
name: bars.example.com
-8
View File
@@ -1,8 +0,0 @@
apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
name: bars.example.com
namespace: vela-system
spec:
definitionRef:
name: bars.example.com
@@ -1,17 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: test-e2e-rolling
annotations:
"app.oam.dev/rollout-template": "true"
spec:
components:
- name: metrics-provider
type: clonesetservice
properties:
cmd:
- ./podinfo
- stress-cpu=1
image: stefanprodan/podinfo:4.0.3
port: 8080
updateStrategyType: InPlaceOnly
@@ -1,17 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: test-e2e-rolling
annotations:
"app.oam.dev/rollout-template": "true"
spec:
components:
- name: metrics-provider
type: clonesetservice
properties:
cmd:
- ./podinfo
- stress-cpu=1
image: stefanprodan/podinfo:5.0.2
port: 8080
updateStrategyType: InPlaceOnly
@@ -1,23 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: test-e2e-rolling
annotations:
"app.oam.dev/rollout-template": "true"
spec:
components:
- name: metrics-provider
type: clonesetservice
properties:
cmd:
- ./podinfo
- stress-cpu=1
image: stefanprodan/podinfo:4.0.3
port: 8080
updateStrategyType: InPlaceOnly
traits:
- type: ingress
properties:
domain: test.example.com
http:
"/": 8080
@@ -1,23 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: test-e2e-rolling
annotations:
"app.oam.dev/rollout-template": "true"
spec:
components:
- name: metrics-provider
type: clonesetservice
properties:
cmd:
- ./podinfo
- stress-cpu=1
image: stefanprodan/podinfo:5.0.2
port: 8080
updateStrategyType: InPlaceOnly
traits:
- type: ingress
properties:
domain: test-1.example.com
http:
"/": 8080
-18
View File
@@ -1,18 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: AppRollout
metadata:
name: rolling-e2e-test
spec:
# application (revision) reference
targetAppRevisionName: test-e2e-rolling-v2
sourceAppRevisionName: test-e2e-rolling-v1
# HPA reference (optional)
componentList:
- metrics-provider
rolloutPlan:
rolloutStrategy: "IncreaseFirst"
rolloutBatches:
- replicas: 10%
- replicas: 40%
- replicas: 50%
batchPartition: 2
@@ -1,14 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: AppRollout
metadata:
name: rolling-e2e-test
spec:
# application (revision) reference
targetAppRevisionName: test-e2e-rolling-v1
componentList:
- metrics-provider
rolloutPlan:
rolloutStrategy: "IncreaseFirst"
rolloutBatches:
- replicas: 2
batchPartition: 3
@@ -1,110 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT.
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
name: clonesetservice
namespace: vela-system
annotations:
definition.oam.dev/description: "Describes long-running, scalable, containerized services that have a stable network endpoint to receive external network traffic from customers.
If workload type is skipped for any service defined in Appfile, it will be defaulted to `webservice` type."
spec:
workload:
definition:
apiVersion: apps.kruise.io/v1alpha1
kind: CloneSet
schematic:
cue:
template: |
output: {
apiVersion: "apps.kruise.io/v1alpha1"
kind: "CloneSet"
metadata: labels: {
"app.oam.dev/component": context.name
}
spec: {
if parameter["replicas"] != _|_ {
replicas: parameter.replicas
}
selector: matchLabels: {
"app.oam.dev/component": context.name
}
template: {
metadata: labels: {
"app.oam.dev/component": context.name
}
spec: {
containers: [{
name: context.name
image: parameter.image
if parameter["cmd"] != _|_ {
command: parameter.cmd
}
if parameter["env"] != _|_ {
env: parameter.env
}
if context["config"] != _|_ {
env: context.config
}
ports: [{
containerPort: parameter.port
}]
if parameter["cpu"] != _|_ {
resources: {
limits:
cpu: parameter.cpu
requests:
cpu: parameter.cpu
}
}
}]
}
}
if parameter["updateStrategyType"] != _|_ {
updateStrategy: {
type: parameter.updateStrategyType
}
}
}
}
parameter: {
// +usage=Which image would you like to use for your service
// +short=i
image: string
// +usage=Commands to run in the container
cmd?: [...string]
// +usage=Which port do you want customer traffic sent to
// +short=p
port: *80 | int
// +usage=Define arguments by using environment variables
env?: [...{
// +usage=Environment variable name
name: string
// +usage=The value of the environment variable
value?: string
// +usage=Specifies a source the value of this var should come from
valueFrom?: {
// +usage=Selects a key of a secret in the pod's namespace
secretKeyRef: {
// +usage=The name of the secret in the pod's namespace to select from
name: string
// +usage=The key of the secret to select from. Must be a valid secret key
key: string
}
}
}]
// +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)
cpu?: string
// +usage=Cloneset updateStrategy, candidates are `ReCreate`/`InPlaceIfPossible`/`InPlaceOnly`
updateStrategyType?: string
// +usage=Number of pods in the cloneset
replicas?: int
}
@@ -1,110 +0,0 @@
# Code generated by KubeVela templates. DO NOT EDIT.
apiVersion: core.oam.dev/v1beta1
kind: ComponentDefinition
metadata:
name: clonesetservice
namespace: vela-system
annotations:
definition.oam.dev/description: "Describes long-running, scalable, containerized services that have a stable network endpoint to receive external network traffic from customers.
If workload type is skipped for any service defined in Appfile, it will be defaulted to `webservice` type."
spec:
workload:
definition:
apiVersion: apps.kruise.io/v1alpha1
kind: CloneSet
schematic:
cue:
template: |
output: {
apiVersion: "apps.kruise.io/v1alpha1"
kind: "CloneSet"
metadata: labels: {
"app.oam.dev/component": context.name
}
spec: {
if parameter["replicas"] != _|_ {
replicas: parameter.replicas
}
selector: matchLabels: {
"app.oam.dev/component": context.name
}
template: {
metadata: labels: {
"app.oam.dev/component": context.name
}
spec: {
containers: [{
name: context.name
image: parameter.image
if parameter["cmd"] != _|_ {
command: parameter.cmd
}
if parameter["env"] != _|_ {
env: parameter.env
}
if context["config"] != _|_ {
env: context.config
}
ports: [{
containerPort: parameter.port
}]
if parameter["cpu"] != _|_ {
resources: {
limits:
cpu: parameter.cpu
requests:
cpu: parameter.cpu
}
}
}]
}
}
if parameter["updateStrategyType"] != _|_ {
updateStrategy: {
type: parameter.updateStrategyType
}
}
}
}
parameter: {
// +usage=Which image would you like to use for your service
// +short=i
image: string
// +usage=Commands to run in the container
cmd?: [...string]
// +usage=Which port do you want customer traffic sent to
// +short=p
port: *80 | int
// +usage=Define arguments by using environment variables
env?: [...{
// +usage=Environment variable name
name: string
// +usage=The value of the environment variable
value?: string
// +usage=Specifies a source the value of this var should come from
valueFrom?: {
// +usage=Selects a key of a secret in the pod's namespace
secretKeyRef: {
// +usage=The name of the secret in the pod's namespace to select from
name: string
// +usage=The key of the secret to select from. Must be a valid secret key
key: string
}
}
}]
// +usage=Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)
cpu?: string
// +usage=Cloneset updateStrategy, candidates are `ReCreate`/`InPlaceIfPossible`/`InPlaceOnly`
updateStrategyType?: string
// +usage=Number of pods in the cloneset
replicas?: int
}
@@ -1,15 +0,0 @@
apiVersion: standard.oam.dev/v1alpha1
kind: Rollout
metadata:
name: rolling-test
spec:
# application (revision) reference
targetRevisionName: metrics-provider-v1
# HPA reference (optional)
componentName: metrics-provider
rolloutPlan:
rolloutStrategy: "IncreaseFirst"
rolloutBatches:
- replicas: 3
- replicas: 2
targetSize: 5
@@ -1,43 +0,0 @@
apiVersion: apps/v1
data:
apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
creationTimestamp: null
name: metrics-provider
spec:
workload:
apiVersion: apps.kruise.io/v1alpha1
kind: CloneSet
metadata:
name: metrics-provider
labels:
app.oam.dev/component: metrics-provider
spec:
replicas: 5
selector:
matchLabels:
app.oam.dev/component: metrics-provider
template:
metadata:
labels:
app.oam.dev/component: metrics-provider
spec:
containers:
- command:
- ./podinfo
- stress-cpu=1
image: stefanprodan/podinfo:4.0.3
name: metrics-provider
ports:
- containerPort: 8080
updateStrategy:
type: InPlaceOnly
status:
observedGeneration: 0
kind: ControllerRevision
metadata:
name: metrics-provider-v1
labels:
controller.oam.dev/component: metrics-provider
revision: 1
@@ -1,43 +0,0 @@
apiVersion: apps/v1
data:
apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
creationTimestamp: null
name: metrics-provider
spec:
workload:
apiVersion: apps.kruise.io/v1alpha1
kind: CloneSet
metadata:
name: metrics-provider
labels:
app.oam.dev/component: metrics-provider
spec:
replicas: 5
selector:
matchLabels:
app.oam.dev/component: metrics-provider
template:
metadata:
labels:
app.oam.dev/component: metrics-provider
spec:
containers:
- command:
- ./podinfo
- stress-cpu=1
image: stefanprodan/podinfo:5.0.2
name: metrics-provider
ports:
- containerPort: 8080
updateStrategy:
type: InPlaceOnly
status:
observedGeneration: 0
kind: ControllerRevision
metadata:
name: metrics-provider-v2
labels:
controller.oam.dev/component: metrics-provider
revision: 1
@@ -1,79 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: "Enable public web traffic for the component."
name: ingress
namespace: vela-system
spec:
status:
customStatus: |-
let igs = context.outputs.ingress.status.loadBalancer.ingress
if igs == _|_ {
message: "No loadBalancer found, visiting by using 'vela port-forward " + context.appName + " --route'\n"
}
if len(igs) > 0 {
if igs[0].ip != _|_ {
message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host + ", IP: " + igs[0].ip
}
if igs[0].ip == _|_ {
message: "Visiting URL: " + context.outputs.ingress.spec.rules[0].host
}
}
healthPolicy: |
isHealth: len(context.outputs.service.spec.clusterIP) > 0
appliesToWorkloads:
- deployments.apps
podDisruptive: false
schematic:
cue:
template: |
// trait template can have multiple outputs in one trait
outputs: service: {
apiVersion: "v1"
kind: "Service"
metadata:
name: context.name
spec: {
selector: {
"app.oam.dev/component": context.name
}
ports: [
for k, v in parameter.http {
port: v
targetPort: v
},
]
}
}
outputs: ingress: {
apiVersion: "networking.k8s.io/v1beta1"
kind: "Ingress"
metadata:
name: context.name
spec: {
rules: [{
host: parameter.domain
http: {
paths: [
for k, v in parameter.http {
path: k
backend: {
serviceName: context.name
servicePort: v
}
},
]
}
}]
}
}
parameter: {
// +usage=Specify the domain you want to expose
domain: string
// +usage=Specify the mapping relationship between the http path and the workload port
http: [string]: int
}
@@ -1,16 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: rollout-trait-test
spec:
components:
- name: express-server
type: webservice
properties:
image: stefanprodan/podinfo:4.0.3
traits:
- type: rollout
properties:
targetSize: 2
firstBatchReplicas: 1
secondBatchReplicas: 1
@@ -1,27 +0,0 @@
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: rollout-trait-test
spec:
components:
- name: express-server
type: webservice
properties:
image: stefanprodan/podinfo:4.0.3
traits:
- type: rollout
properties:
targetSize: 2
firstBatchReplicas: 1
secondBatchReplicas: 1
- name: express-server-another
type: webservice
properties:
image: stefanprodan/podinfo:4.0.3
traits:
- type: rollout
properties:
targetSize: 2
firstBatchReplicas: 1
secondBatchReplicas: 1