apiVersion: v1
kind: Service
metadata:
  name: repostajes
  namespace: repostajes
  labels:
    app: repostajes
spec:
  type: NodePort
  ports:
    - port: 80
      nodePort: 30480
      targetPort: repostajes
  selector:
    app: repostajes
    tier: frontend
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: repostajes-pv-claim
  namespace: repostajes
  labels:
    app: repostajes
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ""
  resources:
    requests:
      storage: 5Gi
  selector:
    matchLabels:
      app: repostajes
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: repostajes
  namespace: repostajes
  labels:
    app: repostajes
spec:
  selector:
    matchLabels:
      app: repostajes
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: repostajes
        tier: frontend
    spec:
      containers:
      - image: creylopez/phpmysql:1.0
        name: repostajes
        ports:
        - containerPort: 80
          name: repostajes
        volumeMounts:
        - name: repostajes-persistent-storage
          mountPath: /var/www/html
      imagePullSecrets:
              #- name: reg-cred-secret
      - name: regcred
      volumes:
      - name: repostajes-persistent-storage
        persistentVolumeClaim:
          claimName: repostajes-pv-claim
