Wordpress deployment error

Hi all,

I’am asking for help, I’am beginner in kunernetes, and I want to deploy wordpress sample using mariadb and persistent volume mounted on NFS share.

I had error during deployment creation:

Error:

Error from server (BadRequest): error when creating “08-wordpress-deploy.yaml”: Deployment in version “v1” cannot be handled as a Deployment: strict decoding error: unknown field “spec.template.spec.containers[0].env[0].valueFrom.configMapRef”, unknown field “spec.template.spec.containers[0].env[1].valueFrom.secretkeyRef”, unknown field “spec.template.spec.containers[0].env[2].valueFrom.secretkeyRef”, unknown field “spec.template.volumes”

YAML File:

apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress
labels:
app: wordpress
spec:
replicas: 1
selector:
matchLabels:
app: wordpress
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
tier: frontend
spec:
containers:
- image: wordpress
name: wordpress
env:
- name: wordpress_DB_HOST
valueFrom:
configMapRef:
name: maria-config
key: database.url
- name: wordpress_DB_USER
valueFrom:
secretkeyRef:
name: mariadb
key: username
- name: wordpress_DB_PASSWORD
valueFrom:
secretkeyRef:
name: mariadb
key: password
ports:
- containerPort: 80
name: wordpress
volumeMounts:
- name: wordpress-pv
mountPath: “/var/www/html”
volumes:
- name: wordpress-pv
persistentVolumeClaim:
claimName: wordpress-pvc
#######################################

Can you please help on this?

Best Regards
Azzeddine

The YAML pasted is not valid. Please try adding ``` before and after the snippet?