| vijaynag | 8339ed2 | 2019-07-25 17:10:58 +0530 | [diff] [blame] | 1 | # 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 | |
| 17 | apiVersion: v1 |
| 18 | kind: Service |
| 19 | metadata: |
| 20 | name: ro |
| 21 | spec: |
| 22 | clusterIP: None |
| 23 | ports: |
| 24 | - port: 9090 |
| 25 | protocol: TCP |
| 26 | targetPort: 9090 |
| 27 | selector: |
| 28 | app: ro |
| 29 | type: ClusterIP |
| 30 | --- |
| 31 | apiVersion: apps/v1 |
| 32 | kind: Deployment |
| 33 | metadata: |
| 34 | name: ro |
| 35 | labels: |
| 36 | app: ro |
| 37 | spec: |
| 38 | replicas: 1 |
| 39 | selector: |
| 40 | matchLabels: |
| 41 | app: ro |
| 42 | template: |
| 43 | metadata: |
| 44 | labels: |
| 45 | app: ro |
| 46 | spec: |
| 47 | initContainers: |
| 48 | - name: ro-db-test |
| 49 | image: alpine:latest |
| 50 | command: ["sh", "-c", "until nc -zvw1 mysql 3306; do sleep 3 ; done; exit 0"] |
| 51 | containers: |
| 52 | - name: ro |
| 53 | image: opensourcemano/ro:latest |
| 54 | ports: |
| 55 | - containerPort: 9090 |
| 56 | protocol: TCP |
| 57 | env: |
| 58 | - name: RO_DB_HOST |
| 59 | value: mysql |
| 60 | envFrom: |
| 61 | - secretRef: |
| 62 | name: ro-secret |
| 63 | volumeMounts: |
| 64 | - name: ro |
| 65 | mountPath: /var/log/osm |
| 66 | volumes: |
| 67 | - name: ro |
| 68 | hostPath: |
| 69 | path: /var/lib/osm/osm_ro/_data |