Difference between revisions of "Kubectl apply"
Jump to navigation
Jump to search
(→Errors) |
(→Errors) |
||
Line 28: | Line 28: | ||
== Errors == | == Errors == | ||
− | <code>[[Cannot unmarshal XXXXX into Go struct field]]</code> | + | * <code>[[Cannot unmarshal XXXXX into Go struct field]]</code> |
+ | * <code>[[Operation cannot be fulfilled on]] ...<code> | ||
kubectl apply -f ./file.yaml | kubectl apply -f ./file.yaml |
Revision as of 14:56, 9 August 2023
kubectl apply
apply a configuration to a resource by filename or stdin
[1]
kubectl apply -f your.yaml -n your-namespace
kubectl apply --dry-run=server
kubectl apply --server-side
- Dashboard:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
- Istio install:
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
kubectl apply -f https://k8s.io/examples/application/mysql/mysql-pv.yaml persistentvolume/mysql-pv-volume created persistentvolumeclaim/mysql-pv-claim created
Contents
Activities
Errors
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
Warning: resource configmaps/kube-root-ca.crt 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. secret/default-token-7z4zd created
Error from server (Conflict): error when applying patch:
.../...
to:
Resource: "/v1, Resource=configmaps", GroupVersionKind: "/v1, Kind=ConfigMap"
Name: "kube-root-ca.crt", Namespace: "your-namespace"
for: "your.yaml": Operation cannot be fulfilled on configmaps "kube-root-ca.crt": the object has been modified; please apply your changes to the latest version and try again
Related commands
See also
↑ https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply
Advertising: