instruction: Create a Dockerfile for configuration
output: ```dockerfile
  from imperative object configuration to declarative object configurationSet 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 labelsWarning: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 nextManaging Kubernetes Objects Using Imperative CommandsImperative Management of Kubernetes Objects Using Configuration FilesKubectl Command ReferenceKubernetes API ReferenceFeedbackWas this page helpful?Yes
  NoThanks 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 an issue
   Print entire sectionBefore you beginTrade-offsOverviewHow to create objectsHow to update objectsHow to delete objectsRecommended: kubectl delete -f <filename>Alternative: kubectl apply -f <directory> --pruneHow to view an objectHow apply calculates differences and merges changesMerge patch calculationHow different types of fields are mergedMerging changes to primitive fieldsMerging changes to map fieldsMerging changes for fields of type listDefault field valuesHow to clear server-defaulted fields or fields set by other writersHow to change ownership of a field between the configuration file and direct imperative writers<a href=#changing-the-owner-
  ```