Rollout:版本“argoproj.io/v1alpha1”中的“Rollout”类型没有匹配项

问题描述

我是 ArgoCD 的新手,但出现以下错误

error: unable to recognize "rollout.yaml": no matches for kind "Rollout" in version "argoproj.io/v1alpha1"

我的 rollout.yaml 文件内容

apiVersion: argoproj.io/v1alpha1
kind: Rollout
Metadata:
  name: istio-rollout
  namespace: imo
spec:
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: details
  template:
    Metadata:
      annotations:
        sidecar.istio.io/inject: "true"
      labels:
        app: details
    spec:
      containers:
      - name: istio-rollout
        image: imo/employee:23
        ports:
        - name: http
          containerPort: 80
          protocol: TCP
  strategy:
    canary:
      canaryService: istio-rollout-canary
      stableService: istio-rollout-stable
      trafficRouting:
        istio:
          virtualService:
            name: customerinfo
            routes:
            - primary
      steps:
      - setWeight: 10
      - pause: {}
      - setWeight: 20
      - pause: {duration: 20s}
      - setWeight: 30
      - pause: {duration: 20s}
      - setWeight: 40
      - pause: {duration: 20s}
      - setWeight: 50
      - pause: {duration: 20s}
      - setWeight: 60
      - pause: {duration: 20s}
      - setWeight: 70
      - pause: {duration: 20s}
      - setWeight: 80
      - pause: {duration: 20s}
      - setWeight: 90
      - pause: {duration: 20s}

当我执行 kubectl apply -f rollout.yaml 或使用“ArgoCD UI”部署它时,我收到此错误

enter image description here

Istio 和 ArgoCD pod 正在我的集群设置中运行。

K8 的版本:1.20

Docker:20.10.5

集群设置:Kubeadm

解决方法

Argo Rollouts 是一个自己的项目,而不是 Argo CD 的一部分。 见https://argoproj.github.io/argo-rollouts/FAQ/