Docs: Add API docs from swagger json file; Add user guide document
[pti/o2.git] / charts / templates / deployment.yaml
1 # Copyright (C) 2021 Wind River Systems, Inc.\r
2 #\r
3 #  Licensed under the Apache License, Version 2.0 (the "License");\r
4 #  you may not use this file except in compliance with the License.\r
5 #  You may obtain a copy of the License at\r
6 #\r
7 #      http://www.apache.org/licenses/LICENSE-2.0\r
8 #\r
9 #  Unless required by applicable law or agreed to in writing, software\r
10 #  distributed under the License is distributed on an "AS IS" BASIS,\r
11 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
12 #  See the License for the specific language governing permissions and\r
13 #  limitations under the License.\r
14 \r
15 ---\r
16 apiVersion: apps/v1\r
17 kind: Deployment\r
18 metadata:\r
19   name: o2api\r
20   namespace: {{ .Values.global.namespace }}\r
21   labels:\r
22     app: o2api\r
23 spec:\r
24   replicas: 1\r
25   selector:\r
26     matchLabels:\r
27       app: o2api\r
28   template:\r
29     metadata:\r
30       labels:\r
31         app: o2api\r
32     spec:\r
33       imagePullSecrets:\r
34         - name: {{ .Values.o2ims.imagePullSecrets }}\r
35 {{- if .Values.o2ims.affinity }}\r
36       affinity:\r
37 {{ toYaml .Values.o2ims.affinity | indent 8 }}\r
38 {{- end }}\r
39       containers:\r
40         - name: postgres\r
41           image: postgres:9.6\r
42           ports:\r
43             - containerPort: 5432\r
44           env:\r
45             - name: POSTGRES_PASSWORD\r
46               value: o2ims123\r
47             - name: POSTGRES_USER\r
48               value: o2ims\r
49           command: ["/bin/bash", "/opt/postgres_start.sh"]\r
50           volumeMounts:\r
51             - name: scripts\r
52               mountPath: /opt\r
53         - name: o2api\r
54           image: "{{ .Values.o2ims.image.repository }}:{{ .Values.o2ims.image.tag }}"\r
55           ports:\r
56             - containerPort: 80\r
57           env:\r
58             - name: API_HOST\r
59               value: api\r
60             - name: DB_HOST\r
61               value: postgres\r
62             - name: DB_PASSWORD\r
63               value: o2ims123\r
64             - name: FLASK_APP\r
65               value: /root/o2/o2app/entrypoints/flask_application.py\r
66             - name: FLASK_DEBUG\r
67               value: {{ .Values.o2ims.logginglevel }}\r
68             - name: LOGGING_CONFIG_LEVEL\r
69               value: {{ .Values.o2ims.logginglevel }}\r
70             - name: OS_AUTH_URL\r
71             - name: OS_PASSWORD\r
72             - name: OS_USERNAME\r
73             - name: PYTHONDONTWRITEBYTECODE\r
74               value: "1"\r
75             - name: PYTHONUNBUFFERED\r
76               value: "1"\r
77             - name: REDIS_HOST\r
78               value: redis\r
79           command: ["/bin/bash", "/opt/o2api_start.sh"]\r
80           volumeMounts:\r
81             - name: scripts\r
82               mountPath: /opt\r
83         - name: redis\r
84           image: redis:alpine\r
85           ports:\r
86             - containerPort: 6379\r
87         - name: watcher\r
88           image: "{{ .Values.o2ims.image.repository }}:{{ .Values.o2ims.image.tag }}"\r
89           command: ["/bin/bash", "/opt/o2watcher_start.sh"]\r
90           env:\r
91             - name: DB_HOST\r
92               value: postgres\r
93             - name: DB_PASSWORD\r
94               value: o2ims123\r
95             - name: LOGGING_CONFIG_LEVEL\r
96               value: {{ .Values.o2ims.logginglevel }}\r
97             - name: OS_AUTH_URL\r
98               value: {{ .Values.ocloud.OS_AUTH_URL }}\r
99             - name: OS_PASSWORD\r
100               value: {{ .Values.ocloud.OS_PASSWORD }}\r
101             - name: OS_USERNAME\r
102               value: {{ .Values.ocloud.OS_USERNAME }}\r
103             - name: PYTHONDONTWRITEBYTECODE\r
104               value: "1"\r
105             - name: REDIS_HOST\r
106               value: redis\r
107           volumeMounts:\r
108             - name: scripts\r
109               mountPath: /opt\r
110         - name: o2pubsub\r
111           image: "{{ .Values.o2ims.image.repository }}:{{ .Values.o2ims.image.tag }}"\r
112           command: ["/bin/bash", "/opt/o2pubsub_start.sh"]\r
113           env:\r
114             - name: DB_HOST\r
115               value: postgres\r
116             - name: DB_PASSWORD\r
117               value: o2ims123\r
118             - name: LOGGING_CONFIG_LEVEL\r
119               value: {{ .Values.o2ims.logginglevel }}\r
120             - name: OS_AUTH_URL\r
121               value: {{ .Values.ocloud.OS_AUTH_URL }}\r
122             - name: OS_PASSWORD\r
123               value: {{ .Values.ocloud.OS_PASSWORD }}\r
124             - name: OS_USERNAME\r
125               value: {{ .Values.ocloud.OS_USERNAME }}\r
126             - name: PYTHONDONTWRITEBYTECODE\r
127               value: "1"\r
128             - name: REDIS_HOST\r
129               value: redis\r
130             - name: K8S_KUBECONFIG\r
131               value: {{ .Values.ocloud.K8S_KUBECONFIG }}\r
132           volumeMounts:\r
133             - name: scripts\r
134               mountPath: /opt\r
135       volumes:\r
136         - name: scripts\r
137           configMap:\r
138             name: {{ .Chart.Name }}-scripts-configmap\r
139 ---\r