ingress-nginx
ingress-nginx copied to clipboard
Issue with canary annotation
When I am using these annotations:
nginx.ingress.kubernetes.io/canary: true
nginx.ingress.kubernetes.io/canary-weight: 100
the host goes down even when the main endpoint is unresponsive.
Expected Behaviour: The host should not go down when the main endpoint is unresponsive since canary-weight is 100.
@tarun-asthana: This issue is currently awaiting triage.
If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.
The triage/accepted label can be added by org members by writing /triage accepted in a comment.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
A reproducible example
apiVersion: apps/v1
kind: Deployment
metadata:
name: canary-whoami
labels:
app: canary-whoami
spec:
replicas: 1
selector:
matchLabels:
app: canary-whoami
template:
metadata:
labels:
app: canary-whoami
spec:
containers:
- name: whoami
image: containous/whoami
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: canary-whoami
spec:
ports:
- port: 80
targetPort: 80
selector:
app: canary-whoami
---
apiVersion: v1
kind: Service
metadata:
name: stable-whoami
spec:
ports:
- port: 80
targetPort: 80
selector:
app: stable-whoami
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: stable-whoami
spec:
ingressClassName: nginx
rules:
- http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: stable-whoami
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: canary-whoami
annotations:
nginx.ingress.kubernetes.io/canary-weight: "100"
nginx.ingress.kubernetes.io/canary: "true"
spec:
ingressClassName: nginx
rules:
- http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: canary-whoami
port:
number: 80
➜ k8s curl localhost/
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body>
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>nginx</center>
</body>
</html>
@tarun-asthana you can try following example with this you can easily deploy with canary annotation https://github.com/ContainerSolutions/k8s-deployment-strategies/tree/master/canary/nginx-ingress
/remove-kind bug /kind support
Thanks @kundan2707 ! However I didn't get how your repo was different from my problem. We are using the same annotations.
@tarun-asthana only change that i can observe is sequence of nginx.ingress.kubernetes.io/canary: "true" As per official documentation annotations to configure canary can be enabled after nginx.ingress.kubernetes.io/canary: "true" is set
@tarun-asthana only change that i can observe is sequence of nginx.ingress.kubernetes.io/canary: "true" As per official documentation annotations to configure canary can be enabled after nginx.ingress.kubernetes.io/canary: "true" is set
@kundan2707 Do you mean the double quotes on true is the difference?
@tarun-asthana i am asking change that i have observed which is sequence of annotations. nginx.ingress.kubernetes.io/canary: "true" comes first
I do the same, my canary is not working, apply canary-weight given to me an error
kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/canary: "true" nginx.ingress.kubernetes.io/canary-weight: "50"
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress
namespace: ingress
annotations:
# kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/canary: "true"
nginx.ingress.kubernetes.io/canary-weight: "50"
spec:
ingressClassName: nginx
rules:
- host: webservice.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web2
port:
number: 80
- path: /web2
pathType: Prefix
backend:
service:
name: web2
port:
number: 80
- path: /web3
pathType: Prefix
backend:
service:
name: web3
port:
number: 80
I add another annotation, but it was ok.
What's the role of service-upstream annotation? I've observed it to be working fine with that annotation
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Reopen this issue or PR with
/reopen - Mark this issue or PR as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closing this issue.
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou can:
- Reopen this issue or PR with
/reopen- Mark this issue or PR as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.