apiVersion: apps/v1
kind: Deployment
metadata:
  name: webserver-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: webserver
  template:
    metadata:
      labels:
        app: webserver
    spec:
      containers:
        - name: webserver
          image: nginx:1.26.0
          ports:
            - containerPort: 80
          volumeMounts:
            - name: logs-volume
              mountPath: /var/log/nginx
      volumes:
        - name: logs-volume
          persistentVolumeClaim:   # In this case, we are referencing the PVC that we created instead of emptyDir
            claimName: my-pvc      # This is the unique name of the PVC that we want to use
---
apiVersion: v1
kind: Service
metadata:
  name: webserver-service
spec:
  selector:
    app: webserver
  type: LoadBalancer
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80