कुबर्नेट्स 1.2.4 का उपयोग करना, मेरे नीचे Deployment परिभाषा (redis.yaml) निम्न त्रुटि क्यों उत्पन्न करती है?कुबर्नेट्स - चयनकर्ता फ़ील्ड तैनाती के लिए मान्य क्यों विफल रहता है?
$ kubectl apply -f redis.yaml
error validating "redis.yaml": error validating data: found invalid field name for v1beta1.LabelSelector; if you choose to ignore these errors, turn validation off with --validate=false
redis.yaml: तैनाती में
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis
spec:
replicas: 3
selector:
name: redis
template:
metadata:
labels:
name: redis
spec:
containers:
- name: redis
image: kubernetes/redis:v1
ports:
- containerPort: 6379
resources:
limits:
cpu: "0.1"
volumeMounts:
- mountPath: /redis-master-data
name: data
volumes:
- name: data
emptyDir: {}
क्या आप '.spec.selector' के उद्देश्य पर विस्तार से बता सकते हैं? मैं प्रलेखन द्वारा थोड़ा उलझन में हूं, विशेष रूप से अनुच्छेद "यदि निर्दिष्ट है, '.spec.selector'' .spec.template.metadata.labels' से मेल खाना चाहिए [...]। यदि' .spec.selector' निर्दिष्ट नहीं है , '.spec.selector.matchLabels' को' .spec.template.metadata.labels' 'पर डिफॉल्ट किया जाएगा। '.spec.selector' होने का उद्देश्य क्या है यदि उसे' .spec.selector.matchLabels' से मिलान करने की आवश्यकता है, लेकिन यदि निर्दिष्ट नहीं किया गया है तो इसके लिए डिफ़ॉल्ट भी है? –
मेरा मतलब था कि मेरी अंतिम वाक्य में '.spec.selector.matchLabels' के बजाय' .spec.template.metadata.labels' कहें। –