Closed marshall007 closed 3 months ago
I see that my suggestion of using spec.ttlSecondsAfterFinished
is already implemented in the helm chart:
However, this does not end up in the generated static manifests:
In order for this to work we'd need to start setting --api-versions
in the calls to helm template
in the gen script to something reasonable:
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:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
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:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
Not stale
/remove-lifecycle rotten
Can we get some eyes on this?
/lifecycle active /area helm /priority important-longterm
@NeckBeardPrince see this comment from @rikatz: https://github.com/kubernetes/ingress-nginx/pull/7128#issuecomment-950412596
As a temporary workaround, I added the following steps after I deploy the controller:
kubectl patch -n ingress-nginx job ingress-nginx-admission-create -p '{"spec":{"ttlSecondsAfterFinished":0}}'
kubectl patch -n ingress-nginx job ingress-nginx-admission-patch -p '{"spec":{"ttlSecondsAfterFinished":0}}'
If you are using PowerShell on Windows, don't forget to escape the quotes differently:
kubectl patch -n ingress-nginx job ingress-nginx-admission-create -p '{\"spec\":{\"ttlSecondsAfterFinished\":0}}'
kubectl patch -n ingress-nginx job ingress-nginx-admission-patch -p '{\"spec\":{\"ttlSecondsAfterFinished\":0}}'
/triage accepted /help
@iamNoah1: This request has been marked as needing help from a contributor.
Please ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help
command.
In our config we are kustomize. For this component we are applying a patch, e.g.:
patches:
- target:
kind: Job
patch: |-
- op: add
path: /spec/ttlSecondsAfterFinished
value: 0
Looks like newer versions of k8s do not ship the batch/v1alpha1 version anymore and therefore the capacilities flag does not work anymore. The following patch should do the trick:
@@ -17,7 +17,7 @@
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
-{{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
+{{- if or (.Capabilities.APIVersions.Has "batch/v1alpha1") (.Capabilities.APIVersions.Has "batch/v1beta1") (.Capabilities.APIVersions.Has "batch/v1") }}
# Alpha feature since k8s 1.12, beta since 1.21, GA in 1.23
ttlSecondsAfterFinished: 0
{{- end }}
@robert-heinzmann-logmein wanna send the PR? Then just tag me and I can approve it.
Also we dont support k8s <v1.20 anymore so fully dropping this API should be good
Not sure, how about https://github.com/kubernetes/ingress-nginx/pull/7128 ? Following the discussions, I think as long as you support 1.20 (where this is still alpha) the toggle can not be removed right ?
Oh it is beta only on v1.21? :/
yeah we should wait until v1.25 and drop support to v1.20
Also apparently that PR is stale, so if you are willing to open a new one lmk.
It seems 1.25 is out, so this looks unblocked.
This issue has not been updated in over 1 year, and should be re-triaged.
You can:
/triage accepted
(org members only)/close
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/
/remove-triage accepted
Enough number of upgrades are safely assumed to have been performed since the last activity on this issue and the version of the controller + the version of the Kubernetes referred to here, is no longer supported or too old to support.
Since nobody is reporting upgrade failures due to pending jobs, I will close the issue for now. If a user posts data proving that upgrades fail due to pending jobs, on a kind cluster or a minikube cluster, then we can reopen this issue.
/close
@longwuyuan: Closing this issue.
NGINX Ingress controller version:
v0.45.0
Kubernetes version (use
kubectl version
):v1.19.0
Environment:
kustomize
andkpt live apply
What happened:
First deployment of
ingress-nginx
from static manifests is successful. When attempting to upgrade to any newer version of the static manifests (in our casev0.44.0 -> v0.45.0
) you will see errors indicating that job specs are immutable:I think this is simply because labels like
app.kubernetes.io/version
andhelm.sh/chart
are changing between versions.We are using
kpt pkg
commands to pull the manifests maintained indeploy/static/provider/cloud
into our own git repo, we apply kustomizations on top of that, and deploy withkpt live
commands.What you expected to happen:
I believe helm users do not experience this problem because of the
helm.sh/hook-delete-policy
annotations specified on the variousJob
resources. These is obviously not respected when deploying static manifests using other tooling.I would expect users deploying from static manifests to have a similar experience when upgrading between versions.
Rather than relying on proprietary helm hooks to ensure cleanup of the
Job
resources, perhaps we can usespec.ttlSecondsAfterFinished
in order to ensure these resources are pruned in a portable fashion.How to reproduce it:
This is not precisely what we are doing, but it should be reproducible like so:
/kind bug