apiVersion: v1
kind: Service
metadata:
  name: miweb
  namespace: miweb
spec:
  type: NodePort
  ports:
    - name: http
      port: 80
      nodePort: 30080
      targetPort: miweb-http
  selector:
    app: miweb
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: miweb
  namespace: miweb
  labels:
    app: miweb
spec:
  selector:
    matchLabels:
      app: miweb
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: miweb
        tier: frontend
    spec:
      containers:
      - name: miweb
        image: creylopez/phpmysql:1.0
        ports:
        - containerPort: 80
          name: "miweb-http"
        volumeMounts:
        - name: miweb-www-folder
          mountPath: /var/www/html
      imagePullSecrets:
      - name: reg-cred-secret
      volumes:
      - name: miweb-www-folder
        persistentVolumeClaim:
          claimName: miweb-pv-claim
