{"id":5423,"date":"2023-09-23T11:45:25","date_gmt":"2023-09-23T10:45:25","guid":{"rendered":"https:\/\/www.baeldung.com\/?p=166074"},"modified":"2023-09-23T11:45:25","modified_gmt":"2023-09-23T10:45:25","slug":"difference-between-kubectl-apply-and-kubectl-create","status":"publish","type":"post","link":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/2023\/09\/23\/difference-between-kubectl-apply-and-kubectl-create\/","title":{"rendered":"Difference Between kubectl apply and kubectl create"},"content":{"rendered":"<p><img src=\"https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/01\/On-Baeldung-9-1024x536.jpg\" class=\"webfeedsFeaturedVisual wp-post-image\" alt=\"\" decoding=\"async\" style=\"float: left; margin-right: 5px;\" loading=\"lazy\" srcset=\"https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/01\/On-Baeldung-9-1024x536.jpg 1024w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/01\/On-Baeldung-9-300x157.jpg 300w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/01\/On-Baeldung-9-768x402.jpg 768w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/01\/On-Baeldung-9-100x52.jpg 100w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/01\/On-Baeldung-9.jpg 1200w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/p>\n<h2 id=\"bd-overview\" data-id=\"overview\">1. Overview<\/h2>\n<div class=\"bd-anchor\" id=\"overview\"><\/div>\n<p><a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/ops\/kubernetes\">Kubernetes<\/a> is an orchestration tool for containerized applications. It uses the <em>kubectl<\/em> command line to interact with a cluster.<\/p>\n<p>In this tutorial, we&#8217;ll see the difference between the <em>kubectl create<\/em> and <em>kubectl apply<\/em> commands with some examples in a running cluster.<\/p>\n<h2 id=\"bd-kubernetes-setup\" data-id=\"kubernetes-setup\">2. Kubernetes Setup<\/h2>\n<div class=\"bd-anchor\" id=\"kubernetes-setup\"><\/div>\n<p><a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/kubernetes.io\/\">Kubernetes<\/a> (K8s) requires cluster creation and a good understanding of its <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/kubernetes.io\/docs\/concepts\/architecture\/\">architecture<\/a>. Furthermore, we should be confident using the API with the <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/kubernetes.io\/docs\/reference\/kubectl\/\"><em>kubectl<\/em><\/a> command.<\/p>\n<h3 id=\"bd-1-cluster-setup\" data-id=\"1-cluster-setup\">2.1. Cluster Setup<\/h3>\n<div class=\"bd-anchor\" id=\"1-cluster-setup\"><\/div>\n<p>We can set up a K8s cluster in different ways. A good learning experience would be <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/kubernetes.io\/docs\/reference\/setup-tools\/kubeadm\/\"><em>Kubeadm<\/em><\/a> and a local K8s cluster connecting multiple virtual machines on the same network. We might want to try with <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/wiki.archlinux.org\/title\/Kubernetes\">Archlinux<\/a> or any other Linux distribution.<\/p>\n<p>Nonetheless, we can use a <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/ops\/kubernetes-lightweight-distributions\">lightweight K8s distribution<\/a> for a quick start. This allows us at least to save time for the cluster configuration setup.<\/p>\n<p>If we want to skip cluster configuration and play with common commands, we can use K8s playgrounds such as <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/killercoda.com\/playgrounds\/scenario\/kubernetes\">Killercoda<\/a> or <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/labs.play-with-k8s.com\/\">Play with Kubernetes<\/a>.<\/p>\n<h3 id=\"bd-2-kubectl\" data-id=\"2-kubectl\">2.2. <em>kubectl<\/em><\/h3>\n<div class=\"bd-anchor\" id=\"2-kubectl\"><\/div>\n<p>In any case, we&#8217;ll have to <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/kubernetes.io\/docs\/tasks\/tools\/#kubectl\">install <em>kubectl<\/em><\/a>. It works on the command line, although it&#8217;s not strictly a K8s component. It communicates with the K8s API using the K8s cluster configuration.<\/p>\n<h2 id=\"bd-declarative-vs-imperative\" data-id=\"declarative-vs-imperative\">3. Declarative vs. Imperative<\/h2>\n<div class=\"bd-anchor\" id=\"declarative-vs-imperative\"><\/div>\n<p>Before we discuss <em>create<\/em> and <em>apply,<\/em> let&#8217;s see how we can manage objects in a cluster.<\/p>\n<h3 id=\"bd-1-object-management\" data-id=\"1-object-management\">3.1. Object Management<\/h3>\n<div class=\"bd-anchor\" id=\"1-object-management\"><\/div>\n<p>K8s is about <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/kubernetes.io\/docs\/concepts\/overview\/working-with-objects\/object-management\/\">managing objects<\/a> in a cluster. We might add or update a <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/ops\/kubertenes-pod-vs-container#pods\">pod<\/a> that runs, for instance, a web application or a database. We apply operations such as create, read, replace, and delete.<\/p>\n<h3 id=\"bd-2-imperative-commands-and-objects-configuration\" data-id=\"2-imperative-commands-and-objects-configuration\">3.2. Imperative Commands and Objects Configuration<\/h3>\n<div class=\"bd-anchor\" id=\"2-imperative-commands-and-objects-configuration\"><\/div>\n<p><strong>Imperative management means to use verb-driven commands<\/strong>. For example, we create an Nginx deployment:<\/p>\n<pre><code class=\"language-bash\">$ kubectl create deployment nginx --image nginx\r\n<\/code><\/pre>\n<p>Likewise, we can extend the same concept to a configuration file:<\/p>\n<pre><code class=\"language-bash\">$ kubectl create -f nginx.yaml\r\n<\/code><\/pre>\n<h3 id=\"bd-3-declarative-objects-configuration\" data-id=\"3-declarative-objects-configuration\">3.3. Declarative Objects Configuration<\/h3>\n<div class=\"bd-anchor\" id=\"3-declarative-objects-configuration\"><\/div>\n<p><strong>With declarative commands, we only need a configuration file or a list of files<\/strong>. K8s manages the difference from what is already in the cluster. The <em>apply<\/em> syntax is what we use in this case:<\/p>\n<pre><code class=\"language-bash\">$ kubectl apply -f deployment.yaml<\/code><\/pre>\n<h2 id=\"bd-kubectl-create\" data-id=\"kubectl-create\">4. <em>kubectl create<\/em><\/h2>\n<div class=\"bd-anchor\" id=\"kubectl-create\"><\/div>\n<p>As we&#8217;ve already seen, the <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/kubernetes.io\/docs\/reference\/generated\/kubectl\/kubectl-commands#create\"><em>kubectl create<\/em><\/a> is an imperative command. We can create many resources like services, secrets, ingress, etc.<\/p>\n<p>For easiness, we&#8217;ll see a simple Nginx deployment from a YAML configuration file <em>deployment.yaml<\/em>:<\/p>\n<pre><code class=\"language-yaml\">apiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: nginx-deployment\r\nspec:\r\n  selector:\r\n    matchLabels:\r\n      app: nginx\r\n  minReadySeconds: 5\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: nginx\r\n    spec:\r\n      containers:\r\n      - name: nginx\r\n        image: nginx:1.14.2\r\n        ports:\r\n        - containerPort: 80<\/code><\/pre>\n<p>We can now use the <em>create<\/em> command:<\/p>\n<pre><code class=\"language-bash\">$ kubectl create -f deployment.yaml<\/code><\/pre>\n<p>K8s notifies us of the resource creation:<\/p>\n<pre><code class=\"language-bash\">deployment.apps\/nginx-deployment created<\/code><\/pre>\n<p>We can double-check with the <em>kubectl get pods<\/em> command to see if the Nginx container is running:<\/p>\n<pre><code class=\"language-bash\">NAME                                READY   STATUS    RESTARTS   AGE\r\nnginx-deployment-86dcfdf4c6-zhkw8   1\/1     Running   0          88s\r\n<\/code><\/pre>\n<h3 id=\"bd-1-error-creating-the-same-resource\" data-id=\"1-error-creating-the-same-resource\">4.1. Error Creating the Same Resource<\/h3>\n<div class=\"bd-anchor\" id=\"1-error-creating-the-same-resource\"><\/div>\n<p>We&#8217;ll get an error if we now try to create, for example, the same deployment:<\/p>\n<pre><code class=\"language-bash\">Error from server (AlreadyExists): error when creating &quot;deployment.yaml&quot;: deployments.apps &quot;nginx-deployment&quot; already exists\r\n<\/code><\/pre>\n<h3 id=\"bd-2-modify-objects-before-creation\" data-id=\"2-modify-objects-before-creation\">4.2. Modify Objects Before Creation<\/h3>\n<div class=\"bd-anchor\" id=\"2-modify-objects-before-creation\"><\/div>\n<p>It&#8217;s an option to modify an object before creation. Suppose we want to use a different Nginx version:<\/p>\n<pre><code class=\"language-\">$ kubectl create -f deployment.yaml -o yaml --dry-run=client | kubectl set image --local -f - &#039;nginx=nginx:1.25.2&#039; -o yaml | kubectl create -f -<\/code><\/pre>\n<p>We can also output the file and edit it in a second step:<\/p>\n<pre><code class=\"language-\">$ kubectl create -f deployment.yaml -o yaml --dry-run=client &gt; deployment_1.yaml &amp;&amp; kubectl create --edit -f deployment_1.yaml<\/code><\/pre>\n<p>This opens up the default text editor with the YAML file for the new deployment.<\/p>\n<h3 id=\"bd-3-one-imperative-command-at-a-time\" data-id=\"3-one-imperative-command-at-a-time\">4.3. One Imperative Command at a Time<\/h3>\n<div class=\"bd-anchor\" id=\"3-one-imperative-command-at-a-time\"><\/div>\n<p>Now that our resources are running in the cluster, we might want to follow up and do some operations on them.<\/p>\n<p><strong>Similarly to how we modify before creation, K8s recommends interacting with resources using one imperative command at a time<\/strong>.<\/p>\n<p>So, let&#8217;s say we want to scale our deployment to <em>5<\/em> replicas. We could use the <em>scale<\/em> command:<\/p>\n<pre><code class=\"language-bash\">$ kubectl scale --replicas=5 deployment nginx-deployment<\/code><\/pre>\n<p>Instead, we should create another YAML file, for example, <em>deployment_scale.yaml<\/em> from the previous file, and add to the deployment spec:<\/p>\n<pre><code class=\"language-yaml\">...\r\nspec:\r\n  replicas: 2\r\n...<\/code><\/pre>\n<p>If we want to update, we can now use the <em>replace<\/em> command:<\/p>\n<pre><code class=\"language-bash\">$ kubectl replace -f deployment_scale.yml<\/code><\/pre>\n<p>Likewise, we might want to use the <em>delete<\/em> command to remove an object:<\/p>\n<pre><code class=\"language-bash\">$ kubectl delete -f deployment.yml<\/code><\/pre>\n<h3 id=\"bd-4-command-options\" data-id=\"4-command-options\">4.4. Command Options<\/h3>\n<div class=\"bd-anchor\" id=\"4-command-options\"><\/div>\n<p>Let&#8217;s have a look at some of the <em>create<\/em> options:<\/p>\n<ul>\n<li><em>dry-run<\/em> allows the creation of an object without sending or persisting to the server<\/li>\n<li><em>edit\u00a0<\/em>to modify the resource before the creation<\/li>\n<li><em>selector\u00a0<\/em>to identify a selector we want to filter<\/li>\n<li><em>save-config<\/em> to add info about the last version of the object to make it usable by the <em>apply<\/em> command<\/li>\n<\/ul>\n<h2 id=\"bd-kubectl-apply\" data-id=\"kubectl-apply\">5. <em>kubectl apply<\/em><\/h2>\n<div class=\"bd-anchor\" id=\"kubectl-apply\"><\/div>\n<p>The <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/kubernetes.io\/docs\/reference\/generated\/kubectl\/kubectl-commands#apply\"><em>kubectl apply<\/em><\/a> command gives us more flexibility if we want to manage the life cycle of a resource in a cluster.<\/p>\n<h3 id=\"bd-1-replace-create-with-apply\" data-id=\"1-replace-create-with-apply\">5.1. Replace <em>create<\/em> With <em>apply<\/em><\/h3>\n<div class=\"bd-anchor\" id=\"1-replace-create-with-apply\"><\/div>\n<p>We can replace the <em>create<\/em> command with <em>apply:<\/em><\/p>\n<pre><code class=\"language-bash\">$ kubectl apply -f deployment.yaml<\/code><\/pre>\n<p>The deployment works as well. So, what&#8217;s the difference between the two commands?<\/p>\n<h3 id=\"bd-2-no-error-applying-the-same-resource\" data-id=\"2-no-error-applying-the-same-resource\">5.2. No Error Applying the Same Resource<\/h3>\n<div class=\"bd-anchor\" id=\"2-no-error-applying-the-same-resource\"><\/div>\n<p>Using the <em>apply<\/em> command with the same configuration produces an unchanged status:<\/p>\n<pre><code class=\"language-bash\">deployment.apps\/nginx-deployment unchanged<\/code><\/pre>\n<p>Instead, with a different input, we&#8217;ll get a new configuration response:<\/p>\n<pre><code class=\"language-bash\">deployment.apps\/nginx-deployment configured\r\n<\/code><\/pre>\n<h3 id=\"bd-3-object-agnostic\" data-id=\"3-object-agnostic\">5.3. Object Agnostic<\/h3>\n<div class=\"bd-anchor\" id=\"3-object-agnostic\"><\/div>\n<p><strong>The <em>apply<\/em> command works with any object, so it&#8217;s declarative in the object definition<\/strong>. We know the <em>kind<\/em> of object in the YAML file. It could be a service, a pod, etc. Thus, in the <em>kubectl<\/em> command, we avoid stating the resource&#8217;s type.<\/p>\n<h3 id=\"bd-4-keep-track-of-objects-history\" data-id=\"4-keep-track-of-objects-history\">5.4. Keep Track of Objects&#8217; History<\/h3>\n<div class=\"bd-anchor\" id=\"4-keep-track-of-objects-history\"><\/div>\n<p>What&#8217;s relevant about the <em>apply<\/em> command is the <em>kubectl.kubernetes.io\/last-applied-configuration<\/em> field in the metadata definition. We can see it from the YAML file configuration:<\/p>\n<pre><code class=\"language-bash\">$ kubectl apply view-last-applied -f deployment.yaml -o yaml<\/code><\/pre>\n<p>The output corresponds to the current deployment:<\/p>\n<pre><code class=\"language-yaml\">apiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  annotations: {}\r\n  name: nginx-deployment\r\n  namespace: default\r\nspec:\r\n  minReadySeconds: 5\r\n  replicas: 3\r\n  selector:\r\n    matchLabels:\r\n      app: nginx\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: nginx\r\n    spec:\r\n      containers:\r\n      - image: nginx:1.14.2\r\n        name: nginx\r\n        ports:\r\n        - containerPort: 80\r\n<\/code><\/pre>\n<h3 id=\"bd-5-a-new-revision-for-every-change\" data-id=\"5-a-new-revision-for-every-change\">5.5. A New Revision for Every Change<\/h3>\n<div class=\"bd-anchor\" id=\"5-a-new-revision-for-every-change\"><\/div>\n<p>Notably, we can see the last applied configuration with the <em>get<\/em> command:<\/p>\n<pre><code class=\"language-bash\">$ kubectl get deployments.apps nginx-deployment -o yaml<\/code><\/pre>\n<p>We omit the <em>last-applied-configuration <\/em>field in the output for brevity:<\/p>\n<pre><code class=\"language-yaml\">apiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  annotations:\r\n    deployment.kubernetes.io\/revision: &quot;1&quot;\r\n    kubectl.kubernetes.io\/last-applied-configuration: |\r\n      ... \r\n  creationTimestamp: &quot;2023-09-18T14:58:34Z&quot;\r\n  generation: 1\r\n  name: nginx-deployment\r\n  namespace: default\r\n  resourceVersion: &quot;154473&quot;\r\n  uid: a154ad80-db02-4ec4-888d-0c56281c4816\r\n...<\/code><\/pre>\n<p>Let&#8217;s say we now update the replicas to <em>5<\/em>. This creates a new version of the deployment. For example, we can see the <em>generation<\/em>\u00a0and <em>resourceVersion<\/em> change:<\/p>\n<pre><code class=\"language-yaml\">...  \r\n  generation: 2\r\n  name: nginx-deployment\r\n  namespace: default\r\n  resourceVersion: &quot;156401&quot;\r\n...<\/code><\/pre>\n<p>This makes K8s able to update the definition of a live object. It works by comparing the current revision with the next to come.<\/p>\n<h3 id=\"bd-6-move-from-create-to-apply\" data-id=\"6-move-from-create-to-apply\">5.6. Move From <em>create<\/em> to <em>apply<\/em><\/h3>\n<div class=\"bd-anchor\" id=\"6-move-from-create-to-apply\"><\/div>\n<p>If we don&#8217;t use the <em>save-config<\/em> option with the <em>create<\/em> command, we can continue using the <em>apply<\/em> command later on.<br \/>\n<br \/>\nK8s will warn us and set the last applied configuration with the following message:<\/p>\n<pre><code class=\"language-bash\">Warning: resource deployments\/nginx-deployment is missing the kubectl.kubernetes.io\/last-applied-configuration annotation which is required by kubectl apply. \r\nkubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.\r\n<\/code><\/pre>\n<h3 id=\"bd-7-command-options\" data-id=\"7-command-options\">5.7. Command Options<\/h3>\n<div class=\"bd-anchor\" id=\"7-command-options\"><\/div>\n<p>The<em> create<\/em> options are still valid here. Let&#8217;s see some other options for the <em>apply<\/em> command:<\/p>\n<ul>\n<li><em>prune<\/em> delete resource objects<\/li>\n<li><em>grace-period<\/em> sets the time we give to a resource to terminate<\/li>\n<\/ul>\n<h2 id=\"bd-how-the-apply-and-create-commands-differ-in-kubectl\" data-id=\"how-the-apply-and-create-commands-differ-in-kubectl\">6. How the <em>apply<\/em> and <em>create<\/em> Commands Differ in <em>kubectl<\/em><\/h2>\n<div class=\"bd-anchor\" id=\"how-the-apply-and-create-commands-differ-in-kubectl\"><\/div>\n<p><strong>We&#8217;ve seen the <em>kubectl create<\/em> as an imperative command.<\/strong> Furthermore, if we want to change to an object definition, we&#8217;d need to use another command such as <em>kubectl replace<\/em>. It doesn&#8217;t strictly require a YAML template.<\/p>\n<p>On the contrary, <strong>the <em>kubectl apply<\/em> declarative command matches the object type<\/strong>. K8s knows how to make changes according to the last applied configuration.<\/p>\n<p>However, <strong>with the <em>apply<\/em> command, <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/kubernetes.io\/docs\/tasks\/manage-kubernetes-objects\/declarative-config\/#how-apply-calculates-differences-and-merges-changes\">merging<\/a> changes between different versions can be difficult<\/strong> and lead to unexpected results.<\/p>\n<p>It&#8217;s worth noting that the <em>create<\/em> command with the <em>&#8211;save-config<\/em> option behaves similarly to the <em>apply<\/em> command.<\/p>\n<h2 id=\"bd-conclusion\" data-id=\"conclusion\">7. Conclusion<\/h2>\n<div class=\"bd-anchor\" id=\"conclusion\"><\/div>\n<p>In this article, we saw how the <em>kubectl<\/em> object management works with <em>kubectl create<\/em> and <em>kubectl apply<\/em>.<\/p>\n<p>The <em>apply<\/em> command is more flexible and can apply changes dynamically. The <em>create<\/em> command is imperative, although with straightforward syntax.<\/p>\n<p>In any case, we need to be sure not to mix up different strategies. They&#8217;re both mature commands nowadays, so it&#8217;s about choosing a direction.<\/p>\n<p><Img align=\"left\" border=\"0\" height=\"1\" width=\"1\" alt=\"\" style=\"border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;\" hspace=\"0\" src=\"https:\/\/feeds.feedblitz.com\/~\/i\/794521052\/0\/baeldung\"><\/p>\n<div style=\"clear:both;padding-top:0.2em;\"><a title=\"Like on Facebook\" href=\"https:\/\/feeds.feedblitz.com\/_\/28\/794521052\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/fblike20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Pin it!\" href=\"https:\/\/feeds.feedblitz.com\/_\/29\/794521052\/baeldung,https%3A%2F%2Fwww.baeldung.com%2Fwp-content%2Fuploads%2F2021%2F01%2FOn-Baeldung-9-1024x536.jpg\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/pinterest20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Tweet This\" href=\"https:\/\/feeds.feedblitz.com\/_\/24\/794521052\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/twitter20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Subscribe by email\" href=\"https:\/\/feeds.feedblitz.com\/_\/19\/794521052\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/email20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Subscribe by RSS\" href=\"https:\/\/feeds.feedblitz.com\/_\/20\/794521052\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/rss20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a rel=\"NOFOLLOW\" title=\"View Comments\" href=\"https:\/\/www.baeldung.com\/ops\/kubectl-apply-create#respond\"><img decoding=\"async\" height=\"20\" style=\"border:0;margin:0;padding:0;\" src=\"https:\/\/assets.feedblitz.com\/i\/comments20.png\"><\/a>&#160;<a title=\"Follow Comments via RSS\" href=\"https:\/\/www.baeldung.com\/ops\/kubectl-apply-create\/feed\"><img decoding=\"async\" height=\"20\" style=\"border:0;margin:0;padding:0;\" src=\"https:\/\/assets.feedblitz.com\/i\/commentsrss20.png\"><\/a><\/p>\n<h3 style=\"clear:left;padding-top:10px\">Related Stories<\/h3>\n<ul>\n<li><a rel=\"NOFOLLOW\" href=\"https:\/\/www.baeldung.com\/ops\/kubernetes-edit-deployment-no-manual-change\">Edit a Kubernetes Deployment Without Modifying the File Manually<\/a><\/li>\n<li><a rel=\"NOFOLLOW\" href=\"https:\/\/www.baeldung.com\/ops\/kubernetes-sort-pods-creation-time\">Sort Pods by Age in Kubernetes<\/a><\/li>\n<li><a rel=\"NOFOLLOW\" href=\"https:\/\/www.baeldung.com\/ops\/eclipse-jkube\">Guide to Eclipse JKube<\/a><\/li>\n<\/ul>\n<p>&#160;<\/p><\/div>\n\n<h2><b>Commercials Cooperation Advertisements:<\/b><\/h2>\r\n<p><br>(1) IT Teacher IT Freelance<br> <\/p>\r\n<a href=https:\/\/itteacheritfreelance.hk\/wordpress><img src=http:\/\/gamefootballmobileanimeiphone.com\/wp-content\/uploads\/2023\/09\/ITTeacherITFreelance-Website.png alt=IT\u96fb\u8166\u88dc\u7fd2 java\u88dc\u7fd2 \u70ba\u5927\u5bb6\u914d\u5c0d\u96fb\u8166\u88dc\u7fd2,IT freelance, \u79c1\u4eba\u8001\u5e2b, PHP\u88dc\u7fd2,CSS\u88dc\u7fd2,XML,Java\u88dc\u7fd2,MySQL\u88dc\u7fd2,graphic design\u88dc\u7fd2,\u4e2d\u5c0f\u5b78ICT\u88dc\u7fd2,\u4e00\u5c0d\u4e00\u79c1\u4eba\u88dc\u7fd2\u548cFreelance\u81ea\u7531\u5de5\u4f5c\u914d\u5c0d\u3002\/><\/a><p><a href=https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/findteacher>\u7acb\u523b\u8a3b\u518a\u53ca\u5831\u540d\u96fb\u8166\u88dc\u7fd2\u8ab2\u7a0b\u5427! <\/a><br>\r\n\r\n\u7535\u5b50\u8ba1\u7b97\u673a -\u6559\u80b2 -IT \u96fb\u8166\u73ed\u201d ( IT\u96fb\u8166\u88dc\u7fd2 ) \u63d0\u4f9b\u4e00\u500b\u65b9\u4fbf\u7684\u7535\u5b50\u8ba1\u7b97\u673a \u6559\u80b2\u5e73\u53f0, \u70ba\u5927\u5bb6\u914d\u5c0d\u4fe1\u606f\u6280\u672f, \u96fb\u8166 \u8001\u5e2b, IT freelance \u548c programming expert. \u8b93\u5927\u5bb6\u65b9\u4fbf\u5730\u5c31\u80fd\u627e\u5230\u5408\u9069\u7684\u96fb\u8166\u88dc\u7fd2, \u96fb\u8166\u73ed, \u5bb6\u6559, \u79c1\u4eba\u8001\u5e2b.  <br>\r\n\r\nWe are a education and information platform which you can find a IT private tutorial teacher or freelance. <br>\r\n\r\nAlso we provide different information about information technology, Computer, programming, mobile, Android, apple, game, movie, anime, animation\u2026 \r\n<\/p>\n<p><br>(2) ITSec<br> <\/p><a href=https:\/\/itsec.vip><img src=http:\/\/gamefootballmobileanimeiphone.com\/wp-content\/uploads\/2023\/09\/ITSec-Main-Promotion-Image.png alt= https:\/\/itsec.vip\/\r\nSecure Your Computers from Cyber Threats and mitigate risks with professional services to defend Hackers.  \r\nITSec provide IT Security and Compliance Services, including IT Compliance Services, Risk Assessment, IT Audit, Security Assessment and Audit, ISO 27001 Consulting and Certification, GDPR Compliance Services, Privacy Impact Assessment (PIA), Penetration test, Ethical Hacking, Vulnerabilities scan, IT Consulting, Data Privacy Consulting, Data Protection Services, Information Security Consulting, Cyber Security Consulting, Network Security Audit, Security Awareness Training.\/><\/a> \r\n<br><br> \r\n<p><a href=https:\/\/itsec.vip>www.ITSec.vip<\/a> <br> <br> \r\n<p><a href=https:\/\/sraa.com.hk>www.Sraa.com.hk<\/a> <br> <br> \r\n<p><a href=https:\/\/itsec.hk>www.ITSec.hk<\/a> <br> <br> \r\n<p><a href=https:\/\/penetrationtest.hk>www.Penetrationtest.hk<\/a> <br> <br> \r\n<p><a href=https:\/\/itseceu.uk>www.ITSeceu.uk<\/a> <br> <br> \r\nSecure Your Computers from Cyber Threats and mitigate risks with professional services to defend Hackers. <br><br>\r\nITSec provide IT Security and Compliance Services, including IT Compliance Services, Risk Assessment, IT Audit, Security Assessment and Audit, ISO 27001 Consulting and Certification, GDPR Compliance Services, Privacy Impact Assessment (PIA), Penetration test, Ethical Hacking, Vulnerabilities scan, IT Consulting, Data Privacy Consulting, Data Protection Services, Information Security Consulting, Cyber Security Consulting, Network Security Audit, Security Awareness Training. \r\n<br><br>Contact us right away. <br><br>Email (Prefer using email to contact us): <br>SalesExecutive@ITSec.vip<\/p>","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/01\/On-Baeldung-9-1024x536.jpg\" class=\"webfeedsFeaturedVisual wp-post-image\" alt=\"\" loading=\"lazy\"><\/p>\n<p>Learn how the kubectl object management works with kubectl create and kubectl apply.<\/p>\n<div><a title=\"Like on Facebook\" href=\"https:\/\/feeds.feedblitz.com\/_\/28\/794521052\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/fblike20.png\"><\/a>\u00a0<a title=\"Pin it!\" href=\"https:\/\/feeds.feedblitz.com\/_\/29\/794521052\/baeldung,https%3A%2F%2Fwww.baeldung.com%2Fwp-content%2Fuploads%2F2021%2F01%2FOn-Baeldung-9-1024x536.jpg\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/pinterest20.png\"><\/a>\u00a0<a title=\"Tweet This\" href=\"https:\/\/feeds.feedblitz.com\/_\/24\/794521052\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/twitter20.png\"><\/a>\u00a0<a title=\"Subscribe by email\" href=\"https:\/\/feeds.feedblitz.com\/_\/19\/794521052\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/email20.png\"><\/a>\u00a0<a title=\"Subscribe by RSS\" href=\"https:\/\/feeds.feedblitz.com\/_\/20\/794521052\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/rss20.png\"><\/a>\u00a0<a rel=\"NOFOLLOW\" title=\"View Comments\" href=\"https:\/\/www.baeldung.com\/ops\/kubectl-apply-create#respond\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/comments20.png\"><\/a>\u00a0<a title=\"Follow Comments via RSS\" href=\"https:\/\/www.baeldung.com\/ops\/kubectl-apply-create\/feed\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/commentsrss20.png\"><\/a><\/p>\n<h3>Related Stories<\/h3>\n<ul>\n<li><a rel=\"NOFOLLOW\" href=\"https:\/\/www.baeldung.com\/ops\/kubernetes-edit-deployment-no-manual-change\">Edit a Kubernetes Deployment Without Modifying the File Manually<\/a><\/li>\n<li><a rel=\"NOFOLLOW\" href=\"https:\/\/www.baeldung.com\/ops\/kubernetes-sort-pods-creation-time\">Sort Pods by Age in Kubernetes<\/a><\/li>\n<li><a rel=\"NOFOLLOW\" href=\"https:\/\/www.baeldung.com\/ops\/eclipse-jkube\">Guide to Eclipse JKube<\/a><\/li>\n<\/ul>\n<p>\u00a0<\/p><\/div>\n","protected":false},"author":259,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[22],"tags":[61,122,127,129,124,128,125,132,131,133,126,130,123,66,94,88,97,56,64,65,60,112,40,75,95,104,33,120,105,101,98,115,30,29,41,86,70,69,68,72,71,26,118,108,87,46,55,48,52,54,51,50,83,62,58,57,109,35,59,63,85,79,82,96,80,27,81,114,44,42,43,45,38,39,110,117,100,111,116,73,89,90,92,91,93,84,78,37,102,34,36,77,67,74,99,113,119,28,121,32,47,49,53,103,31,76],"class_list":["post-5423","post","type-post","status-publish","format-standard","hentry","category-mobile","tag-airpods","tag-anime","tag-anime-characters","tag-anime-cosplay","tag-anime-edits","tag-anime-merchandise","tag-anime-movies","tag-anime-news","tag-anime-recommendations","tag-anime-reviews","tag-anime-series","tag-anime-streaming","tag-animes","tag-app-store","tag-app-store-samsung","tag-appgallery","tag-appgallery-oneplus","tag-apple","tag-apple-music","tag-apple-tv","tag-apple-watch","tag-bbc-sport","tag-best-mobile-games","tag-bixby","tag-bixby-xiaomi","tag-champions-league","tag-cyberpunk","tag-cyberpunk-2077","tag-fantasy-football","tag-fifa","tag-football","tag-formula-1","tag-fortnite","tag-free-fire","tag-free-mobile-games","tag-freebuds-pro","tag-galaxy-a52","tag-galaxy-note-20","tag-galaxy-s21","tag-galaxy-watch-4","tag-galaxy-z-fold-3","tag-game","tag-games","tag-golf","tag-harmonyos","tag-how-to-backup-iphone","tag-how-to-factory-reset-iphone","tag-how-to-reset-iphone","tag-how-to-restore-iphone","tag-how-to-unlock-iphone","tag-how-to-unlock-iphone-5","tag-how-to-unlock-iphone-6","tag-huawei","tag-ios","tag-ipad","tag-iphone","tag-live-soccer","tag-lol","tag-macbook","tag-macos","tag-mate-40-pro","tag-mi-11-lite","tag-mi-home-security-camera-basic-1080p","tag-mi-home-security-camera-basic-1080p-huawei","tag-mi-smart-band-6","tag-minecraft","tag-miui","tag-mlb-scores","tag-mobile-game-design","tag-mobile-game-development","tag-mobile-game-marketing","tag-mobile-game-monetization","tag-mobile-games","tag-mobile-gaming","tag-nba-scores","tag-nba-standings","tag-nfl","tag-nfl-scores","tag-nhl-scores","tag-one-ui","tag-oneplus","tag-oneplus-9-pro","tag-oneplus-buds-pro","tag-oneplus-nord-ce-5g","tag-oxygenos","tag-p40-pro-plus","tag-poco-x3-pro","tag-pokemon","tag-premier-league","tag-pubg","tag-pubg-mobile","tag-redmi-note-10-pro","tag-samsung","tag-samsung-pay","tag-soccer","tag-sports","tag-steam","tag-steeam","tag-top-10-anime","tag-valorant","tag-when-do-the-iphone-7-come-out","tag-when-does-the-iphone-7-come-out","tag-when-is-the-iphone-7-coming-out","tag-world-cup","tag-xbox-series-x","tag-xiaomi"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/posts\/5423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/users\/259"}],"replies":[{"embeddable":true,"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/comments?post=5423"}],"version-history":[{"count":1,"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/posts\/5423\/revisions"}],"predecessor-version":[{"id":5424,"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/posts\/5423\/revisions\/5424"}],"wp:attachment":[{"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/media?parent=5423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/categories?post=5423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gamefootballmobileanimeiphone.com\/index.php\/wp-json\/wp\/v2\/tags?post=5423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}