karmada: argo rollout CRD resources submit member cluster to create Work resource field types are inconsistent

Environment:

Karmada version: v1.5.0 Kubernetes version: v1.20.8

use argo rollout, install crd and sample reference: https://argo-rollouts.readthedocs.io/en/stable/installation/ https://argo-rollouts.readthedocs.io/en/stable/features/canary/

First install argo rollout crd on karmada apiserver.

k get crd rollouts.argoproj.io

image

Then submit the argo rollout resource to karmada

apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  labels:
    app: nginx
  name: nginx-rollout
  namespace: default
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: nginx
  strategy:
    canary:
      maxSurge: 100%
      maxUnavailable: 0
      steps:
      - setWeight: 40
      - pause: {}
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx
        imagePullPolicy: Always
        name: nginx
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30

Query Work resources event:

Events:
  Type     Reason      Age                   From                  Message
  ----     ------      ----                  ----                  -------
  Warning  SyncFailed  9m46s (x19 over 31m)  execution-controller  Failed to sync work(nginx-rollout-6fc47b96ff) to cluster(member-1): Rollout.argoproj.io "nginx-rollout" is invalid: spec.strategy.canary.steps: Invalid value: "array": spec.strategy.canary.steps in body must be of type object: "array"

Query Work resource Manifest spec.strategy.canary.steps definition

apiVersion: work.karmada.io/v1alpha1
kind: Work
metadata:
   ....
spec:
  workload:
    manifests:
    - apiVersion: argoproj.io/v1alpha1
      kind: Rollout
      metadata:
        annotations:
          kubectl.kubernetes.io/last-applied-configuration: |
            {"apiVersion":"argoproj.io/v1alpha1","kind":"Rollout","metadata":{"annotations":{},"labels":{"app":"nginx"},"name":"nginx-rollout","namespace":"default"},"spec":{"progressDeadlineSeconds":600,"replicas":2,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"nginx"}},"strategy":{"canary":{"maxSurge":"100%","maxUnavailable":0,"steps":[{"setWeight":40},{"pause":{}}]}},"template":{"metadata":{"labels":{"app":"nginx"}},"spec":{"containers":[{"image":"nginx","imagePullPolicy":"Always","name":"nginx","resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}}}
            ....
      spec:
        ...
        strategy:
          canary:
            maxSurge: 100%
            maxUnavailable: 0
            steps:
            - setWeight: 40
            - []
     ......
status:
  conditions:
  - lastTransitionTime: "2023-06-01T09:31:38Z"
    message: 'Failed to apply all manifests (0/1): Rollout.argoproj.io "nginx-rollout"
      is invalid: spec.strategy.canary.steps: Invalid value: "array": spec.strategy.canary.steps
      in body must be of type object: "array"'
    reason: AppliedFailed
    status: "False"
    type: Applied

Through the definition of Work Manifest spec.strategy.canary.steps, it is found that the type of ‘object’{} has changed to ‘array’[], which does not conform to the original type definition, so the submission will fail.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments