apiVersion: v1
kind: Service
metadata:
  name: nginx-example
spec:
  type: NodePort
  ports:
    - name: http
      port: 80
      nodePort: 30080
      targetPort: nginx-http
  selector:
    app: nginx
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nginx-pv-claim
  labels:
    app: nginx
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-example
  labels:
    app: nginx
spec:
  selector:
    matchLabels:
      app: nginx
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: nginx
        tier: frontend
    spec:
      containers:
      - name: nginx
        #image: linuxserver/nginx
        image: httpd
        ports:
        - containerPort: 80
          name: "nginx-http"
        volumeMounts:
        - name: nginx-www-folder
          #          mountPath: /config/www
          mountPath: /usr/local/apache2/htdocs
      volumes:
      - name: nginx-www-folder
        persistentVolumeClaim:
          claimName: nginx-pv-claim
