instruction: Create a Dockerfile for configuration
output: ```dockerfile
  from imperative object configuration to declarative object configuration
  
  Set the kubectl.kubernetes.io/last-applied-configuration annotation on the object:
  kubectl replace --save-config -f <kind>_<name>.yaml
  
  Change processes to use kubectl apply for managing the object exclusively.
  
  Defining controller selectors and PodTemplate labels
  Warning:Updating selectors on controllers is strongly discouraged.
  The recommended approach is to define a single, immutable PodTemplate label
  used only by the controller selector with no other semantic meaning.
  Example:
  selector:
   matchLabels:
   controller-selector: "apps/v1/deployment/nginx"
  template:
   metadata:
   labels:
   controller-selector: "apps/v1/deployment/nginx"
  What's next
  
  Managing Kubernetes Objects Using Imperative Commands
  Imperative Management of Kubernetes Objects Using Configuration Files
  Kubectl Command Reference
  Kubernetes API Reference
  
  Feedback
  Was this page helpful?
  Yes
  No
  
   Thanks for the feedback. If you have a specific, answerable question about how to use Kubernetes, ask it on
  
   Stack Overflow.
   Open an issue in the GitHub Repository if you want to
  
   report a problem
   or
  
   suggest an improvement.
  
   Last modified August 24, 2023 at 6:38 PM PST: Use code_sample shortcode instead of code shortcode (e8b136c3b3)
  
    Create child page
   Create documentation issue
   Print entire section
  
  Before you begin
  Trade-offs
  Overview
  How to create objects
  How to update objects
  How to delete objects
  
  Recommended: kubectl delete -f <filename>
  Alternative: kubectl apply -f <directory> --prune
  
  How to view an object
  How apply calculates differences and merges changes
  
  Merge patch calculation
  How different types of fields are merged
  Merging changes to primitive fields
  Merging changes to map fields
  Merging changes for fields of type list
  
  Default field values
  
  How to clear server-defaulted fields or fields set by other writers
  
  How to change ownership of a field between the configuration file and direct imperative writers
  
  <a href="#changing-the-owner-
  ```