I'm getting an invalid field selector error when I try and create my deployment using a YAML file. The error is error validating data: found invalid field selector for v1.PodSpec
and my file can be seen below.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: zalenium-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: zalenium
spec:
serviceAccountName: zalenium
serviceAccount: zalenium
selector:
app: zalenium
role: grid
containers:
- name: zalenium-pod
image: dosel/zalenium
ports:
- containerPort: 4444
protocol: TCP
volumeMounts:
- name: zalenium-shared
mountPath: /tmp/mounted
- name: zalenium-videos
mountPath: /home/seluser/videos
resources:
requests:
memory: "250m"
cpu: "500m"
limits:
memory: "1Gi"
volumes:
- name: zalenium-shared
persistentVolumeClaim:
claimName: zalenium-shared-claim
- name: zalenium-videos
persistentVolumeClaim:
claimName: zalenium-videos-claim
I have tried using online YAML File Validator and they don't seem to show anything wrong with the format. When I try and create the Deployment above with the validate=false flag, the deployment runs, but then the pods continuously crash and restart (crashLoopBackOff). What should I be looking into? I'm still getting familiar with k8s but from the error I would assume it had something to do with the container specs in my deployment. Any tips on approaching this? Thanks!