blob: 5b2571d892b1c9839dbc7e2c41881687eef9adef [file] [log] [blame]
vijaynag8339ed22019-07-25 17:10:58 +05301# Copyright 2019 TATA ELXSI
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12# implied.
13# See the License for the specific language governing permissions and
14# limitations under the License
15# Author: Vijay Nag B S (vijaynag.bs@tataelxsi.co.in)
16
17apiVersion: v1
18kind: Service
19metadata:
20 name: mongo
21spec:
22 clusterIP: None
23 ports:
24 - port: 27017
25 protocol: TCP
26 targetPort: 27017
27 selector:
28 app: mongo
29 type: ClusterIP
30---
31apiVersion: apps/v1
32kind: StatefulSet
33metadata:
34 name: mongo
35 labels:
36 app: mongo
37spec:
38 replicas: 1
39 serviceName: mongo
40 selector:
41 matchLabels:
42 app: mongo
43 template:
44 metadata:
45 labels:
46 app: mongo
47 spec:
48 containers:
49 - name: mongo
50 image: mongo:latest
51 ports:
52 - containerPort: 27017
53 protocol: TCP
54 volumeMounts:
55 - name: mongo-db
56 mountPath: /data/db
57 volumes:
58 - name: mongo-db
59 hostPath:
60 path: /var/lib/osm/osm_mongo_db/_data