Use default VS and TS templates when CfgMap obj is deleted #6780
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR introduces following change:
Test in
kind:VS config before applying custom template from configMap:
nginx@nginx-ingress-7fb4ff9677-z4t7b:/etc/nginx/conf.d$ head vs_default_cafe.conf upstream vs_default_cafe_coffee { zone vs_default_cafe_coffee 512k; random two least_conn; server 10.244.0.6:8080 max_fails=1 fail_timeout=10s max_conns=0; server 10.244.0.7:8080 max_fails=1 fail_timeout=10s max_conns=0; } ...VS after applying custom template from configMap:
pod logs:
... I20241111 14:12:39.372865 1 controller.go:262] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"nginx-ingress", Name:"nginx-config", UID:"054001d6-4f81-43aa-b5b9-07a9d29fc8a3", APIVersion:"v1", ResourceVersion:"11892", FieldPath:""}): type: 'Normal' reason: 'Updated' Configuration from nginx-ingress/nginx-config was updated I20241111 14:12:39.373038 1 controller.go:262] Event(v1.ObjectReference{Kind:"VirtualServer", Namespace:"default", Name:"cafe", UID:"edd41c17-e78e-40a4-9f86-c5b485f46963", APIVersion:"k8s.nginx.org/v1", ResourceVersion:"5989", FieldPath:""}): type: 'Normal' reason: 'AddedOrUpdated' Configuration for default/cafe was added or updated 2024/11/11 14:12:39 [notice] 127#127: exit 2024/11/11 14:12:39 [notice] 128#128: exit 2024/11/11 14:12:39 [notice] 22#22: signal 17 (SIGCHLD) received from 120 ...remove the custom VS template - original, default template is applied:
nginx@nginx-ingress-7fb4ff9677-z4t7b:/etc/nginx/conf.d$ head vs_default_cafe.conf upstream vs_default_cafe_coffee { zone vs_default_cafe_coffee 512k; random two least_conn; server 10.244.0.6:8080 max_fails=1 fail_timeout=10s max_conns=0; server 10.244.0.7:8080 max_fails=1 fail_timeout=10s max_conns=0; } ...pod logs:
... I20241111 14:14:21.563389 1 controller.go:262] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"nginx-ingress", Name:"nginx-config", UID:"054001d6-4f81-43aa-b5b9-07a9d29fc8a3", APIVersion:"v1", ResourceVersion:"12039", FieldPath:""}): type: 'Normal' reason: 'Updated' Configuration from nginx-ingress/nginx-config was updated I20241111 14:14:21.563577 1 controller.go:262] Event(v1.ObjectReference{Kind:"VirtualServer", Namespace:"default", Name:"cafe", UID:"edd41c17-e78e-40a4-9f86-c5b485f46963", APIVersion:"k8s.nginx.org/v1", ResourceVersion:"5989", FieldPath:""}): type: 'Normal' reason: 'AddedOrUpdated' Configuration for default/cafe was added or updated 2024/11/11 14:14:21 [notice] 137#137: exit ...Checklist
Before creating a PR, run through this checklist and mark each as complete.