-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtest.txt
73 lines (37 loc) · 1.77 KB
/
test.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
********************************************************************************************************************************************************
How to use apply instead of create for deployment in Kubernetes?
********************************************************************************************************************************************************
kubectl create -f postgres-deployment.yaml
but if I go
kubectl apply -f postgres-deployment.yaml
I am presented with the lovely error message:
> error: unable to decode "postgres-deployment.yaml": no kind "Deployment"
> is registered for version "apps/v1beta1"
I have tried searching for an explanation to what this means but I cannot figure it out.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: postgres-deployment
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
image: postgres:10.1
ports:
* kubernetes
can you post the output for kubectl version
Does this answer your question? kubectl apply vs kubectl create? ( https://stackoverflow.com/questions/47369351/kubectl-apply-vs-kubectl-create )
1 Answer 1
Sorted by: Reset to default
Old Kubernetes versions supported the Deployment object on the extensions/v1beta1 API group. That is no longer the case ( https://v1-9.docs.kubernetes.io/docs/api-reference/v1.9/#deployment-v1beta1-extensions ).
For Kubernetes versions before 1.9.0 you should use the API group apps/v1beta2.
In Kubernetes 1.9 ( https://v1-9.docs.kubernetes.io/docs/api-reference/v1.9/#deployment-v1-apps ) and above you should use the API group apps/v1.
But why does kubectl create work and kubectl apply doesn't? I would expect that both fail when a wrong API version is used.
Client Version or Server version?