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

pod disruption budget is created for default backend when default backend creation is disabled, but default backend replicas are set to 1 or more #7271

Closed
marcportabellaclotet-mt opened this issue Jun 23, 2021 · 6 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@marcportabellaclotet-mt
Copy link
Contributor

NGINX Ingress controller version:

Kubernetes version (use kubectl version):

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:

What you expected to happen:

PBD should not be created when default-backend deployment creation is set to disabled

How to reproduce it:

Anything else we need to know:
Adding the same if condition that the deployment creation have will solve the issue:

{{- if .Values.defaultBackend.enabled -}}
{{- if or (gt (.Values.defaultBackend.replicaCount | int) 1) (gt (.Values.defaultBackend.autoscaling.minReplicas | int) 1) }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
  labels:
    {{- include "ingress-nginx.labels" . | nindent 4 }}
    app.kubernetes.io/component: default-backend
  name: {{ include "ingress-nginx.defaultBackend.fullname" . }}
  namespace: {{ .Release.Namespace }}
spec:
  selector:
    matchLabels:
      {{- include "ingress-nginx.selectorLabels" . | nindent 6 }}
      app.kubernetes.io/component: default-backend
  minAvailable: {{ .Values.defaultBackend.minAvailable }}
{{- end }}
{{- end }}

/kind bug

@marcportabellaclotet-mt marcportabellaclotet-mt added the kind/bug Categorizes issue or PR as related to a bug. label Jun 23, 2021
@longwuyuan
Copy link
Contributor

/remove-kind bug
/kind feature
I think a little more information would help make some progress on this.

  • What was the exact command you used to install the ingress-controller. Please show the complete command as it is including any values file, if used
  • default-backend is disabled by default, in the helm chart, at least in the latest release of the ingress-nginx controller so hoping you can confirm or add some more context when the title says "when default backend creation is disabled"
  • How this impacts your use and how the change you suggested would impact existing and new users is not described clearly (but we can guess i suppose)

Also, PRs would be welcomed for review so wondering if you want to

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Jul 12, 2021
@marcportabellaclotet-mt
Copy link
Contributor Author

marcportabellaclotet-mt commented Jul 12, 2021

Here is my updated information:
You can reproduce the issue with the this values:

defaultBackend:
  enabled: false
  replicas: 2
helm install ingress-nginx ingress-nginx/ingress-nginx -f myconfig.yaml

In the pbd template file, there is a condition to create a pbd if default backend replicas are greater than 1.

The issue occurs in the scenario where I have disabled the default backend , but I have set more than 1 replicas for the default backend. In this case, a pbd is created even than the default backend is not deployed.

I am using helmfile for a multiple environment setup. That is why in some scenarios I have replicas:2 and enabled:false

I will raise a PR with the proposed solution.

@k8s-triage-robot
Copy link

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 10, 2021
@k8s-triage-robot
Copy link

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 9, 2021
@k8s-triage-robot
Copy link

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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-ci-robot
Copy link
Contributor

@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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

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.

k8s-ci-robot pushed a commit that referenced this issue Jan 17, 2022
…icas-gt-1 (#8155)

* feat: avoid-pdb-creation-when-default-backend-disabled-and-replicas-gt-1

* fix: added-eol

* feat: avoid-pdb-creation-when-default-backend-disabled-and-replicas-gt-1

* fix: added-eol
rchshld pushed a commit to joomcode/ingress-nginx that referenced this issue May 19, 2023
…d-and-replicas-gt-1 (kubernetes#8155)

* feat: avoid-pdb-creation-when-default-backend-disabled-and-replicas-gt-1

* fix: added-eol

* feat: avoid-pdb-creation-when-default-backend-disabled-and-replicas-gt-1

* fix: added-eol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants