Answers: <p>You can remove specified manifest using 'patchesStrategicMerge' as following:</p>
  <pre><code>patchesStrategicMerge:
  - |-
    apiVersion: v1
    kind: Namespace
    metadata:
      name: unwanted-namespace
    $patch: delete
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2021-06-06T17:45:21.473Z
Answers: 2021-06-06T17:45:21.473Z
Answers: Ahmed AbouZaid
Body: <p>I have a kustomize base that I'd like to re-use without editing it. Unfortunately, it creates a namespace I don't want to create. I'd like to simply remove that resource from consideration when compiling the manifests and add a resource for mine since I can't patch a namespace to change the name.</p>
  <p>How can this be done?</p>
  
Tags: <kubernetes><kustomize>
Title: Remove resource from Kustomize base?
UserDisplayName: Josiah
ThreadText: # Remove resource from Kustomize base?
  
  (Asked by: username_0 on 2020-11-18)
  
  I have a kustomize base that I'd like to re-use without editing it. Unfortunately, it creates a namespace I don't want to create. I'd like to simply remove that resource from consideration when compiling the manifests and add a resource for mine since I can't patch a namespace to change the name.
  
  How can this be done?
  
  **Tags:** kubernetes, kustomize
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-06-06. Score: 5
  
  You can remove specified manifest using 'patchesStrategicMerge' as following:
  
  ```
  patchesStrategicMerge:
  - |-
    apiVersion: v1
    kind: Namespace
    metadata:
      name: unwanted-namespace
    $patch: delete
  
  ```
  
  
  ---
  
  