forked from rundeck/docker-zoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
minio-deployment.yaml
98 lines (90 loc) · 2.24 KB
/
minio-deployment.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
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
# This name uniquely identifies the Deployment
name: minio
spec:
strategy:
type: Recreate
template:
metadata:
labels:
# Label is used as selector in the service.
app: minio
spec:
# Refer to the PVC created earlier
volumes:
- name: storage
persistentVolumeClaim:
# Name of the PVC created earlier
claimName: minio-pv-claim
containers:
- name: minio
# Pulls the default Minio image from Docker Hub
image: minio/minio:latest
args:
- server
- /data
env:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: rundeckpro-log-storage
key: awskey
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: rundeckpro-log-storage
key: awssecret
ports:
- containerPort: 9000
hostPort: 9000
# Mount the volume into the pod
volumeMounts:
- name: storage # must match the volume name, above
mountPath: "/data"
---
apiVersion: v1
kind: Service
metadata:
name: minio
spec:
type: LoadBalancer
ports:
- port: 9000
targetPort: 9000
protocol: TCP
selector:
app: minio
---
# Create rundeck bucket
apiVersion: batch/v1
kind: Job
metadata:
name: minio-create-bucket
spec:
completions: 1
template:
metadata:
name: minio-create-bucket
spec:
restartPolicy: Never
containers:
- name: minio-bucket
image: minio/mc
env:
- name: MINIO_URL
value: "http://minio.default.svc.cluster.local:9000"
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: rundeckpro-log-storage
key: awskey
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: rundeckpro-log-storage
key: awssecret
- name: MINIO_BUCKET
value: "rundeck"
command: ["/bin/sh","-c","sleep 30 && mc config host add miniorundeck $MINIO_URL $MINIO_ACCESS_KEY $MINIO_SECRET_KEY && mc mb miniorundeck/$MINIO_BUCKET --ignore-existing"]