Editing Kubectl apply

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 2: Line 2:
 
<code>[[kubectl]] apply</code> apply a configuration to a [[resource]] by filename or <code>[[stdin]]</code> <ref>https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply</ref>
 
<code>[[kubectl]] apply</code> apply a configuration to a [[resource]] by filename or <code>[[stdin]]</code> <ref>https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply</ref>
  
<code>[[kubectl apply --help]]</code>
 
[[--recursive]]
 
  
* <code>[[kubectl apply -f]] https://k8s.io/examples/pods/storage/redis.yaml</code>
+
* <code>kubectl apply -f https://k8s.io/examples/pods/storage/redis.yaml</code>
 +
* <code>kubectl apply -f ./[[secret.yaml]]</code>
  
* <code>[[kubectl apply -f myredis.yaml]]</code>
+
* <code>[[kubectl apply -k]]</code>
  
* <code>[[kubectl apply -f ./secret.yaml]]</code>
+
* <code> kubectl apply --dry-run=server</code>
  
* <code>[[kubectl apply -f]] your.yaml [[-n]] your-[[Kubernetes namespaces|namespace]]</code>
+
* [[Dashboard]]:
 +
<code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml</code>
  
* <code>[[kubectl apply -k]]</code>
 
  
* <code> kubectl apply --dry-run=server</code>
 
* <code>[[kubectl apply --server-side]]</code>
 
 
* [[Dashboard]]: <code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml</code>
 
 
* [[Istio install]]: <code>[[kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml]]</code>
 
* [[Istio install]]: <code>[[kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml]]</code>
  
Line 24: Line 19:
 
  persistentvolume/mysql-pv-volume created
 
  persistentvolume/mysql-pv-volume created
 
  persistentvolumeclaim/mysql-pv-claim created
 
  persistentvolumeclaim/mysql-pv-claim created
 
== Activities ==
 
* [[CKA v1.15]], [[CKA v1.21]]: [[Create and configure a basic Pod]] (<code>[[kubectl apply]]</code>)
 
 
== Errors ==
 
* <code>[[Cannot unmarshal XXXXX into Go struct field]]</code>
 
* <code>[[Operation cannot be fulfilled on]] ...</code>
 
* <code>[[the object has been modified; please apply your changes to the latest version and try again]]</code>
 
  
 
  kubectl apply -f ./file.yaml
 
  kubectl apply -f ./file.yaml
  Error from server (InternalError): error when creating "./file.yaml": [[Internal error occurred: failed calling webhook]] "virtualmachines- mutator.[[kubevirt.io]]": Post https://virt-api.kubevirt.svc:443/virtualmachines-mutate?timeout=30s: [[service]] "[[virt-api]]" not found
+
  Error from server (InternalError): error when creating "./file.yaml": Internal error occurred: failed calling webhook "virtualmachines- mutator.[[kubevirt.io]]": Post https://virt-api.kubevirt.svc:443/virtualmachines-mutate?timeout=30s: [[service]] "[[virt-api]]" not found
  
{{is missing}}
 
  
[[error: error parsing yourfile: error converting YAML to JSON]]: yaml: line 11:
+
== Activities ==
[[mapping values are not allowed in this context]]
+
* [[CKA v1.15]], [[CKA v1.21]]: [[Create and configure a basic Pod]] (<code>[[kubectl apply]]</code>)
  
error: error validating "yourfile": error validating data:
+
== Related commans ==
 
[ValidationError(PersistentVolumeClaim.metadata.finalizers): invalid type for
 
[[io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta.finalizers]]: got "string", expected "array",
 
 
ValidationError([[PersistentVolumeClaim]]): unknown field "name" in
 
[[io.k8s.api.core.v1.PersistentVolumeClaim]] ]; if you choose to ignore these errors, turn
 
 
validation off with [[--validate=false]]
 
 
 
== Warning ==
 
Warning: resource endpoints/your-endpoint is missing the [[kubectl.kubernetes.io/last-applied-configuration]] [[annotation]] which is required by kubectl apply. kubectl 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.
 
endpoints/your-endpoint configured
 
 
 
== Related ==
 
 
* <code>[[kubectl create]]</code>
 
* <code>[[kubectl create]]</code>
 
* <code>[[kubectl edit]]</code>
 
* <code>[[kubectl edit]]</code>
 
* <code>[[kubectl run]]</code>
 
* <code>[[kubectl run]]</code>
 
* <code>[[kubectl get]]</code>
 
* <code>[[kubectl get]]</code>
* <code>[[kubectl apply --server-side]]</code>
 
* <code>[[kubectl delete]]</code>
 
* [[creationTimestamp]] [[Kubernetes metadata|metadata]]
 
* Terraform resource: <code>[[Terraform resource: kubernetes_deployment|kubernetes_deployment]]</code>
 
  
 
== See also ==
 
== See also ==
* {{kubectl apply}}
+
* {{kubectl}}
 +
 
  
 
[[Category:Kubernetes]]
 
[[Category:Kubernetes]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: