Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollout experiment validate dupplicated containerPort with different name on template specs #2271

Closed
namnh2204 opened this issue Sep 28, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@namnh2204
Copy link

namnh2204 commented Sep 28, 2022

Checklist:

  • [ x ] I've included steps to reproduce the bug.
  • [ x ] I've inclued the version of argo rollouts.

Describe the bug
When I tried to create rollout with experiment, the error below throw.
The Rollout "rollout-demo" is invalid: spec.template.spec.containers[0].ports[1]: Duplicate value: map[string]interface {}{"containerPort":8080, "protocol":"TCP"}. Why rollout required unique containerPort instead of port name?

To Reproduce

  • rollout.yaml
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: rollout-demo
spec:
  replicas: 3
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: rollout-demo
  template:
    metadata:
      labels:
        app: rollout-demo
    spec:
      containers:
      - name: main
        image: argoproj/rollouts-demo:green
        imagePullPolicy: Always
        ports:
        - name: http
          containerPort: 8080
          protocol: TCP
        - name: metrics
          containerPort: 8080 # dupplicate port here, but the name is different
          protocol: TCP
        readinessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 10
        resources:
          requests:
            memory: 32Mi
            cpu: 5m
  strategy:
    canary:
      canaryService: rollout-demo-canary
      steps:
      - experiment:
          duration: 60s
          templates:
          - name: experiment
            specRef: canary
          analyses:
          - name: load-test
            templateName: http-benchmark
            args:
            - name: host
              value: rollout-demo-canary
      - setWeight: 30
      - pause: {duration: 10s}
      - setWeight: 60
      - pause: {}
      - setWeight: 100
      - pause: {duration: 10}

---
apiVersion: v1
kind: Service
metadata:
  name: rollout-demo
spec:
  ports:
  - port: 80
    targetPort: http
    protocol: TCP
    name: http
  selector:
    app: rollout-demo
---
apiVersion: v1
kind: Service
metadata:
  name: rollout-demo-canary
spec:
  ports:
  - port: 80
    targetPort: http
    protocol: TCP
    name: http
  selector:
    app: rollout-demo
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
  name: http-benchmark
spec:
  args:
  - name: host
  metrics:
  - name: http-benchmark
    failureLimit: 3
    interval: 5s
    count: 5
    provider:
      job:
        spec:
          template:
            spec:
              containers:
              - name: load-tester
                image: argoproj/load-tester:latest
                command: [sh, -xec]
                args:
                - |
                  wrk -t1 -c1 -d5 -s report.lua http://{{args.host}}/color
                  jq -e '.errors_ratio <= 0.05' report.json
              restartPolicy: Never
          backoffLimit: 0

Expected behavior

Argo rollout is created with experiment pods.

Screenshots

Version

v1.2.0

Logs

# Paste the logs from the rollout controller

# Logs for the entire controller:
kubectl logs -n argo-rollouts deployment/argo-rollouts

# Logs for a specific rollout:
kubectl logs -n argo-rollouts deployment/argo-rollouts | grep rollout=<ROLLOUTNAME

Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

@namnh2204 namnh2204 added the bug Something isn't working label Sep 28, 2022
@namnh2204 namnh2204 changed the title Rollout experiment validate dupplicated containerPort on template specs Rollout experiment validate dupplicated containerPort with different name on template specs Sep 28, 2022
@harikrongali harikrongali added this to the v1.4 milestone Oct 20, 2022
@zachaller
Copy link
Collaborator

This I belive is fixed via #2397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants