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

docs: fix error example in deployment strategies #1518

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

mumubin
Copy link

@mumubin mumubin commented Sep 18, 2023

in my test, the example canary doesn't work. After removing promotion, it works.

@stefanprodan
Copy link
Member

These are snippets about promotion step weight, the promotion field is optional while the canary step weight is mandatory.

@stefanprodan stefanprodan added the invalid This doesn't seem right label Sep 18, 2023
@mumubin
Copy link
Author

mumubin commented Sep 18, 2023

mandatory

Sorry, I didn't get you. The example in doc throw a grammatical error.
Could you give a detail example or help me figure out what's wrong with my test?

Env:
flagger version 1.32.0

My test canary:

apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: podinfo
  namespace: flagger-bin
spec:
  provider: nginx
  # deployment reference
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: podinfo
  # ingress reference
  ingressRef:
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    name: podinfo
  # the maximum time in seconds for the canary deployment
  # to make progress before it is rollback (default 600s)
  progressDeadlineSeconds: 6000
  service:
    # ClusterIP port number
    port: 80
    # container port number or name
    targetPort: 9898
  analysis:
    # schedule interval (default 60s)
    interval: 60s
    # max number of failed metric checks before rollback
    threshold: 10
    # max traffic percentage routed to canary
    # percentage (0-100)
    # canary increment step
    # percentage (0-100)
    # stepWeight: 5
    # NGINX Prometheus checks
    #stepWeights: [1, 2, 10, 80]
    promotion:
      maxWeight: 50
      stepWeight: 20

Applied with error:

> kubectl apply -f podinfo-canary.yml -n flagger-bin
error: error validating "podinfo-canary.yml": error validating data: ValidationError(Canary.spec.analysis): unknown field "promotion" in app.flagger.v1beta1.Canary.spec.analysis; if you choose to ignore these errors, turn validation off with --validate=false

After changing to the following canary.yaml. it works.

apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: podinfo
  namespace: flagger-bin
spec:
  provider: nginx
  # deployment reference
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: podinfo
  # ingress reference
  ingressRef:
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    name: podinfo
  # the maximum time in seconds for the canary deployment
  # to make progress before it is rollback (default 600s)
  progressDeadlineSeconds: 6000
  service:
    # ClusterIP port number
    port: 80
    # container port number or name
    targetPort: 9898
  analysis:
    # schedule interval (default 60s)
    interval: 60s
    # max number of failed metric checks before rollback
    threshold: 10
    # max traffic percentage routed to canary
    # percentage (0-100)
    # maxWeight: 50
    # canary increment step
    # percentage (0-100)
    # stepWeight: 5
    # NGINX Prometheus checks
    #stepWeights: [1, 2, 10, 80]
    maxWeight: 50
    stepWeight: 20

@stefanprodan stefanprodan added kind/docs kind/bug Something isn't working and removed invalid This doesn't seem right labels Sep 18, 2023
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @mumubin

@stefanprodan stefanprodan merged commit 3a7fd48 into fluxcd:main Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working kind/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants