I am trying to create a deployment declaratively, using kubectl apply
. The below configuration is created just fine when I do
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:
- name: postgres
image: postgres:10.1
ports:
- containerPort: 5432