| garciadeblas | 0e49b4a | 2023-04-17 12:38:17 +0200 | [diff] [blame] | 1 | ####################################################################################### |
| 2 | # Copyright ETSI Contributors and Others. |
| 3 | # |
| 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. |
| 16 | ####################################################################################### |
| 17 | apiVersion: v1 |
| 18 | kind: Service |
| 19 | metadata: |
| 20 | name: mon |
| 21 | spec: |
| 22 | clusterIP: None |
| 23 | ports: |
| 24 | - port: 8662 |
| 25 | protocol: TCP |
| 26 | targetPort: 8662 |
| 27 | selector: |
| 28 | app: mon |
| 29 | type: ClusterIP |
| 30 | --- |
| 31 | apiVersion: apps/v1 |
| 32 | kind: Deployment |
| 33 | metadata: |
| 34 | name: mon |
| 35 | labels: |
| 36 | app: mon |
| 37 | spec: |
| 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 |
| 50 | command: ["sh", "-c", "until (nc -zvw1 kafka 9092 && nc -zvw1 mongodb-k8s 27017); do sleep 3; done; exit 0"] |
| 51 | containers: |
| 52 | - name: mon |
| 53 | command: ["/bin/bash"] |
| 54 | args: ["scripts/dashboarder-start.sh"] |
| 55 | image: opensourcemano/mon:13 |
| 56 | ports: |
| 57 | - containerPort: 8662 |
| 58 | protocol: TCP |
| 59 | env: |
| 60 | - name: OSMMON_MESSAGE_HOST |
| 61 | value: kafka |
| 62 | - name: OSMMON_MESSAGE_PORT |
| 63 | value: "9092" |
| 64 | - name: OSMMON_DATABASE_URI |
| 65 | value: mongodb://mongodb-k8s:27017/?replicaSet=rs0 |
| 66 | envFrom: |
| 67 | - secretRef: |
| 68 | name: mon-secret |