a kpt function for removing a Kubernetes resource
To use this function via the kpt CLI run the following:
kpt fn run . --image dustinspecker/kpt-remove-resource:latest -- kind=KIND name=NAME namespace=NAMESPACEA kubernetes resource matching the kind, name, and namespace will be removed.
Create a YAML file with the following content:
apiVersion: v1
kind: ConfigMap
metadata:
annotations:
config.kubernetes.io/function: |
container:
image: dustinspecker/kpt-remove-resource:latest
data:
kind: Service
name: ingress-nginx-controller
namespace: ingress-nginxand run:
kpt fn run .A kubernetes resource matching the kind, name, and namespace will be removed.