-
Notifications
You must be signed in to change notification settings - Fork 93
/
Copy pathreports-repo.yaml
119 lines (119 loc) · 3.19 KB
/
reports-repo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: reports-repo
app.kubernetes.io/instance: reports-repo
app.kubernetes.io/name: reports-repo
app.kubernetes.io/part-of: reports-repo
name: reports-repo
spec:
replicas: 1
selector:
matchLabels:
app: reports-repo
deployment: reports-repo
template:
metadata:
labels:
app: reports-repo
deployment: reports-repo
spec:
containers:
- name: uploader
image: quay.io/chmouel/go-simple-uploader:latest
imagePullPolicy: IfNotPresent
env:
- name: UPLOADER_PORT
value: "9000"
- name: UPLOADER_DIRECTORY
value: "/fileuploads"
volumeMounts:
- mountPath: /fileuploads
name: staticfiles
- image: quay.io/siamaksade/nginx:latest
name: nginx
ports:
- containerPort: 8080
protocol: TCP
volumeMounts:
- mountPath: /etc/nginx/conf.d/
name: nginx-conf
- mountPath: /fileuploads
name: staticfiles
volumes:
- name: nexus-data
persistentVolumeClaim:
claimName: nexus-pv
volumes:
- configMap:
defaultMode: 420
name: reports-repo-nginx-conf
name: nginx-conf
- name: staticfiles
persistentVolumeClaim:
claimName: reports-repo-pv
---
apiVersion: v1
kind: ConfigMap
metadata:
name: reports-repo-nginx-conf
data:
htpasswd: |
reports:$apr1$MHzwWLP6$P/dRWWfgBe4J8wfId78v71
nginx.conf: "types {\n text/plain yaml yml;\n}\n\nserver {\n listen 8080
default_server;\n gzip on;\n\n\tlocation /upload {\n\t\tsatisfy any;\n\t\tauth_basic
\"Welcome to the Jungle!\"; #For Basic Auth\n \tauth_basic_user_file conf.d/htpasswd;
\ #For Basic Auth\n\t\tdeny all;\n\n\t\tproxy_set_header Host $host;\n\t\tproxy_set_header
\ X-Real-IP $remote_addr;\n\t\tproxy_set_header X-Forwarded-Proto https;\n\t\tproxy_set_header
\ X-Forwarded-For $remote_addr;\n\t\tproxy_set_header X-Forwarded-Host $remote_addr;\n\n\t\tproxy_pass
http://localhost:9000;\n\t}\n\n\tlocation /private {\n\t\troot /fileuploads;\n\n\t\tsatisfy
any;\n\t\tauth_basic \"Welcome to the Jungle!\"; #For Basic Auth\n \tauth_basic_user_file
conf.d/htpasswd; #For Basic Auth\n\t\tdeny all;\n\n\t autoindex
on;\n\t autoindex_exact_size off;\n\t autoindex_localtime on;\n\t}\n\n\tlocation
/ {\n\t\troot /fileuploads;\n\t autoindex on;\n\t autoindex_exact_size off;\n\t
\ autoindex_localtime on;\n\t}\n}\n"
---
apiVersion: v1
kind: Service
metadata:
labels:
app: reports-repo
name: reports-repo
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: reports-repo
deployment: reports-repo
---
apiVersion: v1
kind: Route
metadata:
labels:
app: reports-repo
name: reports-repo
spec:
port:
targetPort: 8080-tcp
to:
kind: Service
name: reports-repo
weight: 100
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app: reports-repo
name: reports-repo-pv
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi