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