apiVersion: v1 kind: Service metadata: name: wp-therapy namespace: wp-therapy labels: app: wp-therapy spec: type: NodePort ports: - port: 80 nodePort: 30089 targetPort: wp-therapy selector: app: wp-therapy tier: frontend --- apiVersion: apps/v1 kind: Deployment metadata: name: wp-therapy namespace: wp-therapy labels: app: wp-therapy spec: selector: matchLabels: app: wp-therapy tier: frontend strategy: type: Recreate template: metadata: labels: app: wp-therapy tier: frontend spec: containers: - image: wordpress name: wp-therapy env: - name: WORDPRESS_DB_HOST value: mycluster-instances.mysql-cluster.svc.cluster.local - name: WORDPRESS_DB_PASSWORD valueFrom: secretKeyRef: name: mysqlwp-pass key: password - name: WORDPRESS_DB_USER valueFrom: secretKeyRef: name: mysqlwp-pass key: db_user ports: - containerPort: 80 name: wp-therapy volumeMounts: - name: wp-therapy-persistent-storage mountPath: /var/www/html imagePullSecrets: - name: reg-cred-secret volumes: - name: wp-therapy-persistent-storage persistentVolumeClaim: claimName: wp-pv-claim