"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: 1 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风雨"
"试一下把下面这个用 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 社区交流群” }"
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。