commit | author | age
|
440b7d
|
1 |
--- |
D |
2 |
apiVersion: v1 |
e60fad
|
3 |
kind: Template |
D |
4 |
labels: |
|
5 |
template: mongodb-ephemeral-template |
440b7d
|
6 |
message: |- |
D |
7 |
The following service(s) have been created in your project: ${DATABASE_SERVICE_NAME}. |
|
8 |
|
|
9 |
Username: ${MONGODB_USER} |
|
10 |
Password: ${MONGODB_PASSWORD} |
|
11 |
Database Name: ${MONGODB_DATABASE} |
|
12 |
Connection URL: mongodb://${MONGODB_USER}:${MONGODB_PASSWORD}@${DATABASE_SERVICE_NAME}/${MONGODB_DATABASE} |
|
13 |
|
|
14 |
For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/blob/master/3.2/README.md. |
e60fad
|
15 |
metadata: |
D |
16 |
annotations: |
|
17 |
description: |- |
|
18 |
MongoDB database service, without persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mongodb-container/blob/master/3.2/README.md. |
|
19 |
|
|
20 |
WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing |
|
21 |
iconClass: icon-mongodb |
|
22 |
openshift.io/display-name: MongoDB (Ephemeral) |
|
23 |
openshift.io/documentation-url: https://docs.openshift.org/latest/using_images/db_images/mongodb.html |
|
24 |
openshift.io/long-description: This template provides a standalone MongoDB server |
|
25 |
with a database created. The database is not stored on persistent storage, |
|
26 |
so any restart of the service will result in all data being lost. The database |
|
27 |
name, username, and password are chosen via parameters when provisioning this |
|
28 |
service. |
|
29 |
openshift.io/provider-display-name: Red Hat, Inc. |
|
30 |
openshift.io/support-url: https://access.redhat.com |
|
31 |
tags: database,mongodb |
|
32 |
name: mongodb-ephemeral |
440b7d
|
33 |
objects: |
e60fad
|
34 |
- apiVersion: v1 |
D |
35 |
kind: Secret |
440b7d
|
36 |
metadata: |
D |
37 |
annotations: |
|
38 |
template.openshift.io/expose-admin_password: "{.data['database-admin-password']}" |
|
39 |
template.openshift.io/expose-database_name: "{.data['database-name']}" |
e60fad
|
40 |
template.openshift.io/expose-password: "{.data['database-password']}" |
D |
41 |
template.openshift.io/expose-username: "{.data['database-user']}" |
|
42 |
name: "${DATABASE_SERVICE_NAME}" |
440b7d
|
43 |
stringData: |
D |
44 |
database-admin-password: "${MONGODB_ADMIN_PASSWORD}" |
|
45 |
database-name: "${MONGODB_DATABASE}" |
e60fad
|
46 |
database-password: "${MONGODB_PASSWORD}" |
D |
47 |
database-user: "${MONGODB_USER}" |
|
48 |
- apiVersion: v1 |
|
49 |
kind: Service |
440b7d
|
50 |
metadata: |
D |
51 |
annotations: |
|
52 |
template.openshift.io/expose-uri: mongodb://{.spec.clusterIP}:{.spec.ports[?(.name=="mongo")].port} |
e60fad
|
53 |
name: "${DATABASE_SERVICE_NAME}" |
440b7d
|
54 |
spec: |
D |
55 |
ports: |
|
56 |
- name: mongo |
|
57 |
nodePort: 0 |
e60fad
|
58 |
port: 27017 |
D |
59 |
protocol: TCP |
|
60 |
targetPort: 27017 |
440b7d
|
61 |
selector: |
D |
62 |
name: "${DATABASE_SERVICE_NAME}" |
|
63 |
sessionAffinity: None |
e60fad
|
64 |
type: ClusterIP |
440b7d
|
65 |
status: |
D |
66 |
loadBalancer: {} |
e60fad
|
67 |
- apiVersion: v1 |
D |
68 |
kind: DeploymentConfig |
440b7d
|
69 |
metadata: |
D |
70 |
annotations: |
|
71 |
template.alpha.openshift.io/wait-for-ready: 'true' |
e60fad
|
72 |
name: "${DATABASE_SERVICE_NAME}" |
440b7d
|
73 |
spec: |
e60fad
|
74 |
replicas: 1 |
D |
75 |
selector: |
|
76 |
name: "${DATABASE_SERVICE_NAME}" |
440b7d
|
77 |
strategy: |
D |
78 |
type: Recreate |
e60fad
|
79 |
template: |
D |
80 |
metadata: |
|
81 |
labels: |
|
82 |
name: "${DATABASE_SERVICE_NAME}" |
|
83 |
spec: |
|
84 |
containers: |
|
85 |
- capabilities: {} |
|
86 |
env: |
|
87 |
- name: MONGODB_USER |
|
88 |
valueFrom: |
|
89 |
secretKeyRef: |
|
90 |
key: database-user |
|
91 |
name: "${DATABASE_SERVICE_NAME}" |
|
92 |
- name: MONGODB_PASSWORD |
|
93 |
valueFrom: |
|
94 |
secretKeyRef: |
|
95 |
key: database-password |
|
96 |
name: "${DATABASE_SERVICE_NAME}" |
|
97 |
- name: MONGODB_ADMIN_PASSWORD |
|
98 |
valueFrom: |
|
99 |
secretKeyRef: |
|
100 |
key: database-admin-password |
|
101 |
name: "${DATABASE_SERVICE_NAME}" |
|
102 |
- name: MONGODB_DATABASE |
|
103 |
valueFrom: |
|
104 |
secretKeyRef: |
|
105 |
key: database-name |
|
106 |
name: "${DATABASE_SERVICE_NAME}" |
|
107 |
image: " " |
|
108 |
imagePullPolicy: IfNotPresent |
|
109 |
livenessProbe: |
|
110 |
initialDelaySeconds: 30 |
|
111 |
tcpSocket: |
|
112 |
port: 27017 |
|
113 |
timeoutSeconds: 1 |
|
114 |
name: mongodb |
|
115 |
ports: |
|
116 |
- containerPort: 27017 |
|
117 |
protocol: TCP |
|
118 |
readinessProbe: |
|
119 |
exec: |
|
120 |
command: |
|
121 |
- "/bin/sh" |
|
122 |
- "-i" |
|
123 |
- "-c" |
|
124 |
- mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD |
|
125 |
--eval="quit()" |
|
126 |
initialDelaySeconds: 3 |
|
127 |
timeoutSeconds: 1 |
|
128 |
resources: |
|
129 |
limits: |
|
130 |
memory: "${MEMORY_LIMIT}" |
|
131 |
securityContext: |
|
132 |
capabilities: {} |
|
133 |
privileged: false |
|
134 |
terminationMessagePath: "/dev/termination-log" |
|
135 |
volumeMounts: |
|
136 |
- mountPath: "/var/lib/mongodb/data" |
|
137 |
name: "${DATABASE_SERVICE_NAME}-data" |
|
138 |
dnsPolicy: ClusterFirst |
|
139 |
restartPolicy: Always |
|
140 |
volumes: |
|
141 |
- emptyDir: |
|
142 |
medium: '' |
|
143 |
name: "${DATABASE_SERVICE_NAME}-data" |
440b7d
|
144 |
triggers: |
e60fad
|
145 |
- imageChangeParams: |
440b7d
|
146 |
automatic: true |
D |
147 |
containerNames: |
|
148 |
- mongodb |
|
149 |
from: |
|
150 |
kind: ImageStreamTag |
|
151 |
name: mongodb:${MONGODB_VERSION} |
|
152 |
namespace: "${NAMESPACE}" |
|
153 |
lastTriggeredImage: '' |
e60fad
|
154 |
type: ImageChange |
440b7d
|
155 |
- type: ConfigChange |
D |
156 |
status: {} |
|
157 |
parameters: |
|
158 |
- name: MEMORY_LIMIT |
|
159 |
displayName: Memory Limit |
|
160 |
description: Maximum amount of memory the container can use. |
|
161 |
value: 512Mi |
|
162 |
required: true |
|
163 |
- name: NAMESPACE |
|
164 |
displayName: Namespace |
|
165 |
description: The OpenShift Namespace where the ImageStream resides. |
|
166 |
value: openshift |
|
167 |
- name: DATABASE_SERVICE_NAME |
|
168 |
displayName: Database Service Name |
|
169 |
description: The name of the OpenShift Service exposed for the database. |
|
170 |
value: mongodb |
|
171 |
required: true |
|
172 |
- name: MONGODB_USER |
|
173 |
displayName: MongoDB Connection Username |
|
174 |
description: Username for MongoDB user that will be used for accessing the database. |
|
175 |
value: username |
|
176 |
required: true |
|
177 |
- name: MONGODB_PASSWORD |
|
178 |
displayName: MongoDB Connection Password |
|
179 |
description: Password for the MongoDB connection user. |
|
180 |
value: password |
|
181 |
required: true |
|
182 |
- name: MONGODB_DATABASE |
|
183 |
displayName: MongoDB Database Name |
|
184 |
description: Name of the MongoDB database accessed. |
|
185 |
value: sampledb |
|
186 |
required: true |
|
187 |
- name: MONGODB_ADMIN_PASSWORD |
|
188 |
displayName: MongoDB Admin Password |
|
189 |
description: Password for the database admin user. |
|
190 |
generate: expression |
|
191 |
from: "[a-zA-Z0-9]{16}" |
|
192 |
required: true |
|
193 |
- name: MONGODB_VERSION |
|
194 |
displayName: Version of MongoDB Image |
|
195 |
description: Version of MongoDB image to be used (2.4, 2.6, 3.2 or latest). |
|
196 |
value: '3.2' |
|
197 |
required: true |