私はYAML形式とkubernetesに関する初心者です。このコンテキストではマッピング値は許可されていません
以下は、dep_prom.ymlファイルです。しかし
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
name: prometheus-deployment
name: prometheus
#namespace: prometheus
spec:
replicas: 1
template:
metadata:
labels:
app: prometheus
spec:
containers:
- image: prom/prometheus:master
name: prometheus
command:
- "/bin/prometheus"
args:
- "-config.file=/etc/prometheus/prometheus.yml"
- "-storage.local.path=/prometheus"
- "-storage.local.retention=24h"
ports:
- containerPort: 9090
protocol: TCP
volumeMounts:
- mountPath: "/prometheus"
name: data
- mountPath: "/etc/prometheus"
name: config-volume
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 500m
memory: 2500Mi
volumes:
- name: data
hostPath:
path: /data/prometheus
- name: config-volume
configMap:
name: prometheus
nodeSelector: westporch-kubeminion-1
kubernetes.io/hostname: 10.0.24.52
---
...私は-f dep_prom.ymlに
エラー作成kubectl を実行:JSONにYAMLの変換エラー:YAMLを:行47:マッピング値は、このコンテキストでは許可されません私はYAMLファイル形式がnであることを考えるwestporch-kubeminion-1
:
ライン47はnodeSelectorですormal。
私にいくつかアドバイスをください。
ありがとうございました。
「westporch-kubeminion-1」を削除してください。 'nodeSelector'はマップであり、単一の値フィールドではありません。 – fishi
[Kubectlの重複の可能性は常にエラーを返します:yaml:このコンテキストではマッピング値は許可されていません](https://stackoverflow.com/questions/40435173/kubectl-always-returns-a-error-yaml-mapping-values -are-not-allowed-in-this-con) – Anthon