blob: c71325fb1e61a727531843785cf77c07b4a5b254 [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: mon
21spec:
22 clusterIP: None
23 ports:
24 - port: 8662
25 protocol: TCP
26 targetPort: 8662
27 selector:
28 app: mon
29 type: ClusterIP
30---
31apiVersion: apps/v1
32kind: Deployment
33metadata:
34 name: mon
35 labels:
36 app: mon
37spec:
38 replicas: 1
39 selector:
40 matchLabels:
41 app: mon
42 template:
43 metadata:
44 labels:
45 app: mon
46 spec:
47 initContainers:
48 - name: kafka-mongo-test
49 image: alpine:latest
David Garciaa1376012020-10-19 15:42:42 +020050 command: ["sh", "-c", "until (nc -zvw1 kafka 9092 && nc -zvw1 mongodb-k8s 27017); do sleep 3; done; exit 0"]
vijaynag8339ed22019-07-25 17:10:58 +053051 containers:
52 - name: mon
garciadeblas7b3ed792020-12-21 11:50:36 +000053 image: opensourcemano/mon:9
vijaynag8339ed22019-07-25 17:10:58 +053054 ports:
55 - containerPort: 8662
56 protocol: TCP
57 env:
58 - name: OSMMON_MESSAGE_HOST
59 value: kafka
60 - name: OSMMON_MESSAGE_PORT
61 value: "9092"
David Garciaa1376012020-10-19 15:42:42 +020062 - name: OSMMON_DATABASE_URI
63 value: mongodb://mongodb-k8s:27017/?replicaSet=rs0
vijaynag8339ed22019-07-25 17:10:58 +053064 envFrom:
65 - secretRef:
66 name: mon-secret
67 volumeMounts:
68 - name: mon-storage
69 mountPath: /app/database
70 volumes:
71 - name: mon-storage
72 hostPath:
73 path: /var/lib/osm/osm_mon_db/_data