-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmigrate-job.yml
71 lines (70 loc) · 1.75 KB
/
migrate-job.yml
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
apiVersion: template.openshift.io/v1
kind: Template
metadata:
annotations:
description: for migate pod
openshift.io/display-name: for migate pod
openshift.io/long-description: This template deploys pod migrate
tags: df-db-migrate
name: df-db-migrate-pod-template
labels:
app.kubernetes.io/component: df-db-migrate-pod
app.kubernetes.io/name: df
app.kubernetes.io/managed-by: template
objects:
# - apiVersion: v1
# kind: Pod
# metadata:
# labels:
# app: migrate-pod
# name: migrate-pod
# spec:
# imagePullSecrets:
# - name: artifactory-pull-secret
# containers:
# - image: ${IMAGE_NAME}
# name: migrate-pod
# env:
# - name: DB_HOST
# value: ${DB_HOST}
# - name: DB_PORT
# value: ${DB_PORT}
# - name: DB_NAME
# value: ${DB_NAME}
# - name: DB_USER
# value: ${DB_USER}
# - name: DB_PASS
# value: ${DB_PASS}
- apiVersion: batch/v1
kind: Job
metadata:
name: db-migrate-job
spec:
completions: 1
template:
spec:
imagePullSecrets:
- name: artifactory-pull-secret
containers:
- image: ${IMAGE_NAME}
name: migrate-pod
env:
- name: DB_HOST
value: ${DB_HOST}
- name: DB_PORT
value: ${DB_PORT}
- name: DB_NAME
value: ${DB_NAME}
- name: DB_USER
value: ${DB_USER}
- name: DB_PASS
value: ${DB_PASS}
restartPolicy: Never
backoffLimit: 1
parameters:
- name: IMAGE_NAME
- name: DB_HOST
- name: DB_PORT
- name: DB_NAME
- name: DB_USER
- name: DB_PASS