-
Notifications
You must be signed in to change notification settings - Fork 2
/
init-job.yaml
42 lines (41 loc) · 1.18 KB
/
init-job.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
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
---
apiVersion: batch/v1
kind: Job
metadata:
name: minio-setup
labels:
k8s-app: minio-setup
spec:
ttlSecondsAfterFinished: 3600
template:
metadata:
labels:
k8s-app: minio-setup
spec:
serviceAccountName: wait-for-minio
restartPolicy: OnFailure
volumes:
- name: config
emptyDir: {}
initContainers:
- name: wait-for-minio
image: groundnuty/k8s-wait-for
imagePullPolicy: Always
args: ["pod", "$(MINIO_STS_NAME)-0"]
containers:
- name: mc
image: minio/mc
imagePullPolicy: Always
envFrom:
- secretRef:
name: minio-credentials
command:
- /bin/sh
- -c
- "mc --config-dir=/config config host add $(MINIO_NAMESPACE) http://$(MINIO_STS_NAME)-0.$(MINIO_SERVICE_NAME):9000 ${MINIO_ACCESS_KEY} ${MINIO_SECRET_KEY} && mc --config-dir=/config mb -p $(MINIO_NAMESPACE)/$(MINIO_NAMESPACE)"
volumeMounts:
- name: config
mountPath: "/config"