mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-04 00:17:19 +00:00
- Splitted autoscale docs to be appfile focused, and add cpu utilization scaling policy for appfile - Allow user to input parameter with int type, like 10 instead of "10" - Change cpuRequest/cpu to proper names To fix #564
49 lines
887 B
CUE
49 lines
887 B
CUE
#deployment: {
|
|
name: string
|
|
// +usage=Which image would you like to use for your service
|
|
// +short=i
|
|
image: string
|
|
// +usage=Which port do you want customer traffic sent to
|
|
// +short=p
|
|
port: *8080 | int
|
|
env: [...{
|
|
name: string
|
|
value: string
|
|
}]
|
|
cpu?: string
|
|
}
|
|
output: {
|
|
apiVersion: "apps/v1"
|
|
kind: "Deployment"
|
|
metadata: name: parameter.name
|
|
spec: {
|
|
selector:
|
|
matchLabels:
|
|
app: parameter.name
|
|
template: {
|
|
metadata:
|
|
labels:
|
|
app: parameter.name
|
|
spec: containers: [{
|
|
image: parameter.image
|
|
name: parameter.name
|
|
env: parameter.env
|
|
ports: [{
|
|
containerPort: parameter.port
|
|
protocol: "TCP"
|
|
name: "default"
|
|
}]
|
|
if parameter["cpu"] != _|_ {
|
|
resources: {
|
|
limits:
|
|
cpu: parameter.cpu
|
|
requests:
|
|
cpu: parameter.cpu
|
|
}
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
}
|
|
parameter: #deployment
|