Skip to content

Add post-delete hook to clean up stuck GatewayClass on uninstall#1283

Open
Istiak2019331114 wants to merge 9 commits into
masterfrom
fix/gatewayclass-finalizer-cleanup
Open

Add post-delete hook to clean up stuck GatewayClass on uninstall#1283
Istiak2019331114 wants to merge 9 commits into
masterfrom
fix/gatewayclass-finalizer-cleanup

Conversation

@Istiak2019331114

@Istiak2019331114 Istiak2019331114 commented Jun 24, 2026

Copy link
Copy Markdown
Member

Problem

When uninstalling the service-gateway chart, the GatewayClass gets stuck
in Terminating because the envoy-gateway controller (deployed as a sub-chart)
adds the gateway-exists-finalizer finalizer and shuts down before it can be
removed.

Solution

Add an optional post-delete hook (cleaner.enabled) that runs kubectl patch
to null out the GatewayClass finalizer after Helm has deleted all release
resources (including the envoy-gateway controller pod). This ensures the
controller cannot re-add the finalizer.

Disabled by default. Enable with cleaner.enabled=true.

Changes

  • templates/cleaner/{serviceaccount,rbac,job}.yaml — post-delete hook resources
    with ordered hook weights (-5, -4, 0) to ensure RBAC is ready before the Job runs
  • templates/_helpers.tpl — add kubectl.registry, appscode.serviceAccountName,
    appscode.imagePullSecrets helpers
  • values.yaml — add global.registry/registryFQDN/imagePullSecrets/serviceAccount,
    kubectl, and cleaner sections

@Istiak2019331114 Istiak2019331114 marked this pull request as draft June 24, 2026 13:45
@Istiak2019331114 Istiak2019331114 force-pushed the fix/gatewayclass-finalizer-cleanup branch from 50da14f to 35f3b3a Compare June 24, 2026 13:51
@Istiak2019331114 Istiak2019331114 changed the title Add pre-delete hook to strip GatewayClass finalizer on uninstall Add post-delete hook to clean up stuck GatewayClass on uninstall Jun 25, 2026
@Istiak2019331114 Istiak2019331114 marked this pull request as ready for review June 25, 2026 10:52

@ArnobKumarSaha ArnobKumarSaha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

api change
helpers.tpl change

Comment thread charts/service-gateway/values.yaml Outdated
Comment thread charts/service-gateway/values.yaml Outdated
Comment thread charts/service-gateway/values.yaml Outdated
@ArnobKumarSaha ArnobKumarSaha force-pushed the fix/gatewayclass-finalizer-cleanup branch from 5cfe8f3 to 7aaaa79 Compare June 25, 2026 16:10
Comment thread charts/service-gateway/values.yaml Outdated
Comment thread charts/service-gateway/templates/cleaner/job.yaml
Comment thread charts/service-gateway/values.yaml
Comment thread charts/service-gateway/values.yaml Outdated
Istiak2019331114 and others added 9 commits June 26, 2026 18:53
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Arnob kumar saha <arnob@appscode.com>
@ArnobKumarSaha ArnobKumarSaha force-pushed the fix/gatewayclass-finalizer-cleanup branch from 9ab8e7e to 17a13b0 Compare June 26, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants