Skip to content

dustinspecker/kpt-remove-resource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kpt-remove-resource

a kpt function for removing a Kubernetes resource

Build Status

CLI usage

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=NAMESPACE

A kubernetes resource matching the kind, name, and namespace will be removed.

declarative usage

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-nginx

and run:

kpt fn run .

A kubernetes resource matching the kind, name, and namespace will be removed.