开发者社区 > 云原生 > Serverless > 正文

labelsOAM好像在1.7版本好像能作用于service,升到1.8版本后就不能是为什么

"labels(trait)好像在1.7版本好像能作用于service,升到1.8版本后就不能作用于service了apiVersion: core.oam.dev/v1beta1 kind: Application metadata: annotations: app.oam.dev/appAlias: """" app.oam.dev/appName: dev-first-prod app.oam.dev/deployVersion: """" app.oam.dev/publishVersion: workflow-dev-product-20230530015724171 app.oam.dev/workflowName: workflow-dev-product creationTimestamp: null labels: app.oam.dev/appName: dev-first-prod app.oam.dev/source-of-truth: from-velaux name: dev-first-prod namespace: dev resourceVersion: ""44309791561"" spec: components: - name: dev-first-prod properties: cpu: ""0.5"" exposeType: ClusterIP image: wangyikewyk/canarydemo:v1 memory: 1024Mi ports: - expose: true name: web-port port: 8090 protocol: TCP traits: - properties: replicas: 1 type: scaler - properties: cpu: 1789df182c16ef2740352cda80d0c37c4.png service的lables里面就没有 CPX : dev这个 limits: cpu: 1 memory: 2049Mi memory: 2048Mi requests: cpu: 200m memory: 1024Mi type: resource - properties: CPX: dev type: labels - properties: strategy: rollingStrategy: maxSurge: 10% maxUnavailable: 0% partition: 0 type: RollingUpdate targetAPIVersion: apps/v1 targetKind: Deployment type: k8s-update-strategy - properties: class: ingress-internal classInSpec: true domain: dev-first.xxx.com gatewayHost: dev-first-prod http: /: 8090 type: gateway - properties: max: 10 min: 6 targetAPIVersion: apps/v1 targetKind: Deployment type: hpa type: webservice policies: - name: apply-once-ignore-replicas properties: enable: true rules: - selector: resourceTypes: - Deployment - StatefulSet - Job strategy: path: - spec.replicas type: apply-once - name: xxx-dev-product properties: clusters: - local namespace: dev type: topology workflow: mode: steps: DAG subSteps: DAG steps: - meta: alias: Deploy To xxx-dev-product name: xxx-dev-product properties: auto: true ignoreTerraformComponent: true parallelism: 5 policies: - xxx-dev-product - apply-once-ignore-replicas type: deploy风雨"

展开
收起
JWRRR 2023-06-03 09:16:09 89 0
1 条回答
写回答
取消 提交回答
  • "试一下把下面这个用 vela def apply 创建到集群里,然后把 trait type ""labels"" 改成 ""labels-ws-svc"" ""labels-ws-svc"": { type: ""trait"" annotations: {} description: ""Add labels on the service created by webservice."" attributes: { podDisruptive: true appliesToWorkloads: [""*""] } } template: { patchOutputs: webserviceExpose: { metadata: { labels: { for k, v in parameter { (k): v } } } } parameter: [string]: string | null此回答整理自钉群“OAM/KubeVela 社区交流群” }"

    2023-06-03 10:14:31
    赞同 展开评论 打赏

快速交付实现商业价值。

热门讨论

热门文章

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载