Changes done for bug fixes 28/3528/1
authorabhijit_onap <abhijit.das.gupta@huawei.com>
Fri, 29 May 2020 18:29:50 +0000 (23:59 +0530)
committerabhijit_onap <abhijit.das.gupta@huawei.com>
Fri, 29 May 2020 18:29:50 +0000 (23:59 +0530)
Signed-off-by: abhijit_onap <abhijit.das.gupta@huawei.com>
Change-Id: I414290f70db062bce7e1fe533ac75ddfc92246e1

ocd/infra/playbooks/roles/applcm/files/deploy/applcm-broker-deployment.yaml
ocd/infra/playbooks/roles/applcm/files/deploy/db-deployment.yaml [deleted file]
ocd/infra/playbooks/roles/applcm/files/deploy/postgres-db-pvc.yaml [moved from ocd/infra/playbooks/roles/applcm/files/deploy/db-service.yaml with 56% similarity]
ocd/infra/playbooks/roles/applcm/files/deploy/postgres-k8s.yaml [new file with mode: 0644]

index ce4d6b4..74bb34a 100644 (file)
@@ -50,13 +50,15 @@ spec:
           value: /go/release/logfile
         - name: LOGGER_LEVEL
           value: info
-        - name: MYSQL_DATABASE
-          value: db
-        - name: MYSQL_PASSWORD
+        - name: POSTGRES_DATABASE
+          value: mecmdb
+        - name: DBHOST
+          value: mecmdb
+        - name: POSTGRES_PASSWORD
           value: password
-        - name: MYSQL_ROOT_PASSWORD
+        - name: POSTGRES_ROOT_PASSWORD
           value: password
-        - name: MYSQL_USER
+        - name: POSTGRES_USER
           value: root
         - name: PACKAGE_ARTIFACT_PATH
           value: /Artifacts/Deployment/
diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/db-deployment.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/db-deployment.yaml
deleted file mode 100644 (file)
index 3d75520..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 2020 Huawei Technologies Co., Ltd.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# yamllint disable
-apiVersion: apps/v1
-kind: Deployment
-metadata:
-  annotations:
-    kompose.cmd: kompose convert
-    kompose.version: 1.21.0 (992df58d8)
-  creationTimestamp: null
-  labels:
-    io.kompose.service: db
-  name: db
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-      io.kompose.service: db
-  strategy:
-    type: Recreate
-  template:
-    metadata:
-      annotations:
-        kompose.cmd: kompose convert
-        kompose.version: 1.21.0 (992df58d8)
-      creationTimestamp: null
-      labels:
-        io.kompose.service: db
-    spec:
-      containers:
-      - env:
-        - name: MYSQL_DATABASE
-          value: db
-        - name: MYSQL_PASSWORD
-          value: password
-        - name: MYSQL_ROOT_PASSWORD
-          value: password
-        - name: MYSQL_USER
-          value: root
-        image: mysql/mysql-server
-        imagePullPolicy: ""
-        name: db
-        ports:
-        - containerPort: 3306
-        resources: {}
-        volumeMounts:
-        - mountPath: /var/lib/mysql
-          name: my-db
-      restartPolicy: Always
-      serviceAccountName: ""
-      volumes:
-      - name: my-db
-        hostPath:
-          path: /data
-          type: DirectoryOrCreate
-status: {}
-
-# yamllint enable
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# yamllint disable
+
+# persistent volume
+---
+kind: PersistentVolume
 apiVersion: v1
-kind: Service
 metadata:
-  annotations:
-    kompose.cmd: kompose convert
-    kompose.version: 1.21.0 (992df58d8)
-  creationTimestamp: null
+  name: postgres-pv-volume
   labels:
-    io.kompose.service: db
-  name: dbhost
+    type: local
+    app: postgres
 spec:
-  ports:
-  - name: "3306"
-    port: 3306
-    targetPort: 3306
-  selector:
-    io.kompose.service: db
-status:
-  loadBalancer: {}
+  storageClassName: manual
+  capacity:
+    storage: 5Gi
+  accessModes:
+    - ReadWriteMany
+  hostPath:
+    path: "/data"
 
-# yamllint enable
+# pvc
+---
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+  name: postgres-pv-claim
+  namespace: default
+  labels:
+    app: postgres
+spec:
+  storageClassName: manual
+  accessModes:
+    - ReadWriteMany
+  resources:
+    requests:
+      storage: 5Gi
diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-k8s.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-k8s.yaml
new file mode 100644 (file)
index 0000000..82e2921
--- /dev/null
@@ -0,0 +1,69 @@
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# postgres database
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: postgres-db
+  namespace: default
+  labels:
+    app: postgres-db
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: postgres-db
+  template:
+    metadata:
+      labels:
+        app: postgres-db
+    spec:
+      volumes:
+        - name: postgres-data
+          persistentVolumeClaim:
+            claimName: postgres-pv-claim
+      containers:
+        - name: postgres-db
+          image: postgres:9.6
+          imagePullPolicy: "IfNotPresent"
+          env:
+            - name: POSTGRES_DB
+              value: mecmdb
+            - name: POSTGRES_USER
+              value: root
+            - name: POSTGRES_PASSWORD
+              value: password
+          volumeMounts:
+            - mountPath: /var/lib/postgresql/data
+              name: postgres-data
+          ports:
+            - containerPort: 5432
+
+# postgres service
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: mecmdb
+  namespace: default
+spec:
+  selector:
+    app: postgres-db
+  ports:
+    - name: "5432"
+      port: 5432
+      targetPort: 5432