我正在做一个关于Google Cloud中的kubernetes的实验室。
我已经创建了YAML文件,但是当我尝试部署它时,shell显示了此错误:
将YAML转换为JSON时出错:yaml:第34行:找不到预期的密钥
YAML文件:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
spec:
volumes:
- name: nginx-config
configMap:
name: nginx-config
- name: php-config
configMap:
name: php-config
containers:
- image: php-fpm:7.2
name: php
ports:
- containerPort: 9000
volumeMounts:
- name: persistent-storage
mountPath: /var/www/data
- name: php-config
mountPath: /usr/local/etc/php-fpm.d/www.conf
subPath: www.conf
- image: nginx:latest
name: nginx
- containerPort: 80
volumeMounts:
- name: persistent-storage
mountPath: /var/www/data
- name: nginx-config
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf …
Run Code Online (Sandbox Code Playgroud)