2

ここに画像の説明を入力

私はカナリア展開戦略に取り組んでいます。トラフィック メッシュをインストールした後、サービス メッシュ インターフェイスを使用します。コマンドで初めてプログラムを起動するとき

kubectl apply -f applications.yaml

アプリケーション全体、つまり 4 つのレプリカをデプロイする必要がありますが、アプリケーションの 20% (1 つのレプリカ) のみをデプロイし、進行中の状態になり、エラーが発生します。

TrafficRoutingErro: the server could not find the requested resource (post trafficsplits.splits.smi-spec.io) TrafficSplitNotCreated: Unable to create traffic Split 'demo-traefficsplit'

これが私のマニフェストです:

argocd-rollout.yaml

---
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: demo
  labels:
    app: demo
spec:
  strategy:
    canary:
      steps:
      - setWeight: 20
      - pause:
          duration: "1m"
      - setWeight: 50
      - pause:
          duration: "2m"
      canaryService: demo-canary
      stableService: demo

      trafficRouting:
        smi:
          rootService: demo-smi
          trafficSplitName: demo-trafficsplit

  replicas: 4
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: demo
      version: blue
  template:
    metadata:
      labels:
        app: demo
        version: blue
    spec:
      containers:
      - name: demo
        image: argoproj/rollouts-demo:blue
        imagePullPolicy: Always
        ports:
        - name: web
          containerPort: 8080
        resources:
          requests:
            memory: "64Mi"
            cpu: "100m"
          limits:
            memory: "128Mi"
            cpu: "140m"

---
apiVersion: split.smi-spec.io/v1alpha3
kind: TrafficSplit
metadata:
  name: demo-trafficsplit
spec:
  service: demo-smi # controller uses the stableService if Rollout does not specify the rootService field
  backends:
  - service: demo
    weight: 10
  - service: demo-canary
    weight: 90

---
apiVersion: v1
kind: Service
metadata:
  name: demo-smi
spec:
  ports:
  - port: 80
    targetPort: 8080
  selector:
    app: demo
    version: blue
  type: ClusterIP

---
apiVersion: v1
kind: Service
metadata:
  name: demo
spec:
  ports:
  - port: 80
    targetPort: 8080
  selector:
    app: demo
    version: blue
  type: ClusterIP

---
apiVersion: v1
kind: Service
metadata:
  name: demo-canary
spec:
  ports:
  - port: 80
    targetPort: 8080
  selector:
    app: demo
    version: blue
  type: ClusterIP

---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: rollout-ing
spec:
  entryPoints:
    - websecure
  routes:
    - kind: Rule
      match: Host(`mycompagny.com`) 
      services:
        - name: demo-smi
          port: 80
  tls:
    certResolver: myresolver

applications.yaml

apiVersion: v1
kind: Namespace
metadata:
  name: net

---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: rollout
  namespace: argocd
spec:
  project: default
  source:
    repoURL: git@github.com:telemaqueHQ/DevOps.git
    targetRevision: master
    path: gitOps/test/argocd
  destination:
    server: https://kubernetes.default.svc
    namespace: net
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

4

0 に答える 0