kubernetes/examples

error: error parsing wordpress-deployment.yaml: error converting YAML to JSON: yaml: line 33: could not find expected ':'

techbizlife opened this issue · 3 comments

trying to follow kubernetes tutorial[1]Example: Deploying WordPress and MySQL with Persistent Volumes;
run command 'kubectl apply -f wordpress-deployment.yaml' on google kubernetes using cloudshell;
got this error:**error: error parsing wordpress-deployment.yaml: error converting YAML to JSON: yaml: line 33: could not find expected ':'
[1]https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/

wordpress-deployment.yaml

apiVersion: v1
kind: Service
metadata:
  name: wordpress
  labels:
    app: wordpress
spec:
  ports:
    - port: 80
  selector:
    app: wordpress
    tier: frontend
  type: LoadBalancer
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: wp-pv-claim
  labels:
    app: wordpress
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: wordpress
  labels:
    app: wordpress
spec:
  selector:
    matchLabels:
      app: wordpress
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: wordpress
        tier: frontend
    spec:
      containers:
      - image: wordpress:4.8-apache
        name: wordpress
        env:
        - name: WORDPRESS_DB_HOST
          value: 34.72.250.151
        - name: WORDPRESS_DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mysql-pass
              key: password
        - name: WORDPRESS_DB_USER
          valueFrom:
           secretkeyRef:
            name: mysql-pass
        ports:
        - containerPort: 80
          name: wordpress
        volumeMounts:
        - name: wordpress-persistent-storage
          mountPath: /var/www/html
      volumes:
      - name: wordpress-persistent-storage
        persistentVolumeClaim:
          claimName: wp-pv-claim````

/kind support
This issue is being addressed in this issue kubernetes/kubernetes#95754

/close

@troy0820: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.