apiVersion: apps/v1
kind: Deployment
metadata:
  name: fedora-repository
spec:
  replicas: 2
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: fedora
  template:
    metadata:
      labels:
        app: fedora
    spec:
      containers:
        - name: fedora-repository
          image: nginx:latest
          ports:
            - containerPort: 80
          volumeMounts:
            - name: packages
              mountPath: /usr/share/nginx/html
              subPath: fedora
            - name: nginx-config
              mountPath: /etc/nginx
      volumes:
        - name: packages
          persistentVolumeClaim:
            claimName: packages
        - name: nginx-config
          configMap:
            name: fedora-repository-nginx
