apiVersion: v1
kind: Service
metadata:
  name: miweb
spec:
  type: NodePort
  ports:
    - name: http
      port: 80
      nodePort: 30080
      targetPort: miweb-http
  selector:
    app: miweb
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: miweb-pv-claim
  labels:
    app: miweb
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 2Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: miweb-conf-pv-claim
  labels:
    app: miweb
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 100M
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: 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: linuxserver/nginx
        image: docker-registry:32000/minginx:2.0
        #image: httpd
        ports:
        - containerPort: 80
          name: "miweb-http"
        volumeMounts:
        - name: miweb-www-folder
          mountPath: /usr/share/nginx/html
        - name: miweb-conf-folder
          mountPath: /etc/nginx/conf.d
      imagePullSecrets:
      - name: reg-cred-secret
      volumes:
      - name: miweb-www-folder
        persistentVolumeClaim:
          claimName: miweb-pv-claim
      - name: miweb-conf-folder
        persistentVolumeClaim:
          claimName: miweb-conf-pv-claim
