| --- |
| kind: ConfigMap |
| apiVersion: v1 |
| metadata: |
| name: nginx-config |
| data: |
| default.conf: | |
| server { |
| listen 80; |
| server_name mendel-linux.org; |
| |
| location /apt { |
| autoindex on; |
| alias /usr/share/nginx/html/publishes; |
| } |
| |
| location /images { |
| autoindex on; |
| alias /usr/share/nginx/html/images; |
| } |
| |
| location / { |
| autoindex on; |
| root /usr/share/nginx/html; |
| } |
| } |
| |
| --- |
| apiVersion: apps/v1 |
| kind: Deployment |
| metadata: |
| name: nginx-apt |
| labels: |
| app: nginx-apt |
| spec: |
| replicas: 1 |
| selector: |
| matchLabels: |
| app: nginx-apt |
| template: |
| metadata: |
| labels: |
| app: nginx-apt |
| spec: |
| restartPolicy: Always |
| containers: |
| - name: nginx |
| image: nginx:1.19-alpine |
| imagePullPolicy: Always |
| ports: |
| - containerPort: 80 |
| name: http |
| readinessProbe: |
| httpGet: |
| path: /apt |
| port: http |
| failureThreshold: 1 |
| periodSeconds: 10 |
| resources: |
| requests: |
| memory: 0.5Gi |
| volumeMounts: |
| - mountPath: /usr/share/nginx/html |
| name: aptly-publishes |
| - mountPath: /etc/nginx/conf.d |
| name: nginx-config |
| volumes: |
| - name: aptly-publishes |
| persistentVolumeClaim: |
| claimName: aptly-state |
| - name: nginx-config |
| configMap: |
| name: nginx-config |