From 650f6ee3da7d8af68e3cbd58914731892e4cb70b Mon Sep 17 00:00:00 2001 From: agrawalgaurav Date: Thu, 29 Oct 2020 14:57:03 +0530 Subject: [PATCH] Removed unused roles Signed-off-by: agrawalgaurav Change-Id: Id34eac84c88ac99656ef060cfc9d9e69940fb411 --- .../files/deploy/applcm-broker-deployment.yaml | 90 --------------- .../applcm/files/deploy/applcm-broker-service.yaml | 38 ------- .../roles/applcm/files/deploy/applcmScript.sh | 23 ---- .../playbooks/roles/applcm/files/deploy/config.sh | 23 ---- .../files/deploy/helm-plugin-deployment.yaml | 74 ------------ .../applcm/files/deploy/helm-plugin-service.yaml | 36 ------ .../playbooks/roles/applcm/files/deploy/init.sh | 16 --- .../files/deploy/my-db-persistentvolumeclaim.yaml | 31 ------ .../roles/applcm/files/deploy/postgres-config.yaml | 26 ----- .../roles/applcm/files/deploy/postgres-k8s.yaml | 50 --------- .../applcm/files/deploy/postgres-service.yaml | 30 ----- .../applcm/files/deploy/postgres-storage.yaml | 45 -------- .../playbooks/roles/applcm/tasks/install-ssl.yml | 120 -------------------- ocd/infra/playbooks/roles/applcm/tasks/install.yml | 73 ------------ ocd/infra/playbooks/roles/applcm/tasks/main.yml | 24 ---- .../playbooks/roles/applcm/tasks/uninstall.yml | 22 ---- .../roles/mepagent/files/deploy/mepagent.yaml | 46 -------- .../roles/mepagent/files/deploy/mepagentScript.sh | 24 ---- .../playbooks/roles/mepagent/tasks/install-ssl.yml | 38 ------- .../playbooks/roles/mepagent/tasks/install.yml | 23 ---- ocd/infra/playbooks/roles/mepagent/tasks/main.yml | 20 ---- .../playbooks/roles/mepagent/tasks/uninstall.yml | 29 ----- .../playbooks/roles/mepconfig/tasks/install.yml | 24 ---- ocd/infra/playbooks/roles/mepconfig/tasks/main.yml | 21 ---- .../roles/mepserver/files/deploy/kong-k8s.yaml | 124 --------------------- .../roles/mepserver/files/deploy/kongScript.sh | 27 ----- .../roles/mepserver/files/deploy/kongconfig.sh | 22 ---- .../roles/mepserver/files/deploy/mep-basic.yaml | 56 ---------- .../roles/mepserver/files/deploy/mep-k8s.yaml | 65 ----------- .../roles/mepserver/files/deploy/mepScript.sh | 24 ---- .../roles/mepserver/files/deploy/postgres-k8s.yaml | 103 ----------------- .../roles/mepserver/tasks/install-ssl.yml | 101 ----------------- .../playbooks/roles/mepserver/tasks/install.yml | 49 -------- ocd/infra/playbooks/roles/mepserver/tasks/main.yml | 20 ---- .../playbooks/roles/mepserver/tasks/uninstall.yml | 29 ----- 35 files changed, 1566 deletions(-) delete mode 100644 ocd/infra/playbooks/roles/applcm/files/deploy/applcm-broker-deployment.yaml delete mode 100644 ocd/infra/playbooks/roles/applcm/files/deploy/applcm-broker-service.yaml delete mode 100755 ocd/infra/playbooks/roles/applcm/files/deploy/applcmScript.sh delete mode 100755 ocd/infra/playbooks/roles/applcm/files/deploy/config.sh delete mode 100644 ocd/infra/playbooks/roles/applcm/files/deploy/helm-plugin-deployment.yaml delete mode 100644 ocd/infra/playbooks/roles/applcm/files/deploy/helm-plugin-service.yaml delete mode 100755 ocd/infra/playbooks/roles/applcm/files/deploy/init.sh delete mode 100644 ocd/infra/playbooks/roles/applcm/files/deploy/my-db-persistentvolumeclaim.yaml delete mode 100644 ocd/infra/playbooks/roles/applcm/files/deploy/postgres-config.yaml delete mode 100644 ocd/infra/playbooks/roles/applcm/files/deploy/postgres-k8s.yaml delete mode 100644 ocd/infra/playbooks/roles/applcm/files/deploy/postgres-service.yaml delete mode 100644 ocd/infra/playbooks/roles/applcm/files/deploy/postgres-storage.yaml delete mode 100644 ocd/infra/playbooks/roles/applcm/tasks/install-ssl.yml delete mode 100644 ocd/infra/playbooks/roles/applcm/tasks/install.yml delete mode 100644 ocd/infra/playbooks/roles/applcm/tasks/main.yml delete mode 100644 ocd/infra/playbooks/roles/applcm/tasks/uninstall.yml delete mode 100755 ocd/infra/playbooks/roles/mepagent/files/deploy/mepagent.yaml delete mode 100755 ocd/infra/playbooks/roles/mepagent/files/deploy/mepagentScript.sh delete mode 100644 ocd/infra/playbooks/roles/mepagent/tasks/install-ssl.yml delete mode 100644 ocd/infra/playbooks/roles/mepagent/tasks/install.yml delete mode 100644 ocd/infra/playbooks/roles/mepagent/tasks/main.yml delete mode 100644 ocd/infra/playbooks/roles/mepagent/tasks/uninstall.yml delete mode 100644 ocd/infra/playbooks/roles/mepconfig/tasks/install.yml delete mode 100644 ocd/infra/playbooks/roles/mepconfig/tasks/main.yml delete mode 100644 ocd/infra/playbooks/roles/mepserver/files/deploy/kong-k8s.yaml delete mode 100755 ocd/infra/playbooks/roles/mepserver/files/deploy/kongScript.sh delete mode 100755 ocd/infra/playbooks/roles/mepserver/files/deploy/kongconfig.sh delete mode 100644 ocd/infra/playbooks/roles/mepserver/files/deploy/mep-basic.yaml delete mode 100755 ocd/infra/playbooks/roles/mepserver/files/deploy/mep-k8s.yaml delete mode 100755 ocd/infra/playbooks/roles/mepserver/files/deploy/mepScript.sh delete mode 100644 ocd/infra/playbooks/roles/mepserver/files/deploy/postgres-k8s.yaml delete mode 100644 ocd/infra/playbooks/roles/mepserver/tasks/install-ssl.yml delete mode 100644 ocd/infra/playbooks/roles/mepserver/tasks/install.yml delete mode 100644 ocd/infra/playbooks/roles/mepserver/tasks/main.yml delete mode 100644 ocd/infra/playbooks/roles/mepserver/tasks/uninstall.yml diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/applcm-broker-deployment.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/applcm-broker-deployment.yaml deleted file mode 100644 index 9d889a4..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/applcm-broker-deployment.yaml +++ /dev/null @@ -1,90 +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: applcm-broker - name: applcm-broker -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: applcm-broker - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: applcm-broker - spec: - containers: - - env: - - name: ADDRESS - value: 0.0.0.0:8081 - - name: HELM_PLUGIN_PORT - value: "50051" - - name: KUBERNETES_PLUGIN_PORT - value: "50052" - - name: LOGFILE_PATH - value: /go/release/logfile - - name: LOGGER_LEVEL - value: info - - name: POSTGRES_DATABASE - value: mecmdb - - name: DBHOST - value: postgres-db - - name: POSTGRES_PASSWORD - value: mecm - - name: POSTGRES_ROOT_PASSWORD - value: mecm - - name: POSTGRES_USER - value: mecm - - name: PACKAGE_ARTIFACT_PATH - value: /Artifacts/Deployment/ - - name: PACKAGE_PATH - value: /go/release/application/packages/ - - name: HTTPS_FLAG - value: "false" - - name: CERTIFICATE_PATH - value: /go/release/certificates/server.cer - - name: KEY_PATH - value: /go/release/certificates/server_key.pem - image: ealtedge/applcm-broker:latest - imagePullPolicy: "" - name: applcm-broker - ports: - - containerPort: 8081 - resources: {} - #volumeMounts: - #- mountPath: /go/release/certificates/ - #name: server-cert - restartPolicy: Always - serviceAccountName: "" - #volumes: - #- name: server-cert - #secret: - #secretName: applcm-secret -status: {} - -# yamllint enable diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/applcm-broker-service.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/applcm-broker-service.yaml deleted file mode 100644 index 737611b..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/applcm-broker-service.yaml +++ /dev/null @@ -1,38 +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: v1 -kind: Service -metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: applcm-broker - name: applcm-broker -spec: - type: NodePort - ports: - - name: "28081" - port: 8081 - targetPort: 8081 - nodePort: 30001 - selector: - io.kompose.service: applcm-broker -status: - loadBalancer: {} - -# yamllint enable diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/applcmScript.sh b/ocd/infra/playbooks/roles/applcm/files/deploy/applcmScript.sh deleted file mode 100755 index 16fc242..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/applcmScript.sh +++ /dev/null @@ -1,23 +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. - -#Server is running on https port -sed -i 's/value: \"false\"/value: \"true"/g' applcm-broker-deployment-ssl.yaml -sed -i 's/#volumeMounts/volumeMounts/g' applcm-broker-deployment-ssl.yaml -sed -i 's/#- mountPath/ - mountPath/g' applcm-broker-deployment-ssl.yaml -sed -i 's/#name/ name/g' applcm-broker-deployment-ssl.yaml -sed -i 's/#volumes/volumes/g' applcm-broker-deployment-ssl.yaml -sed -i 's/#- name/ - name/g' applcm-broker-deployment-ssl.yaml -sed -i 's/#secret/ secret/g' applcm-broker-deployment-ssl.yaml -sed -i 's/#secretName/ secretName/g' applcm-broker-deployment-ssl.yaml diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/config.sh b/ocd/infra/playbooks/roles/applcm/files/deploy/config.sh deleted file mode 100755 index d5e7b2f..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/config.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# 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. - -# Command to give privileges to mysql root user -# The Grant is necessary for Applcm-Broker to create applcmdb -mysql -u root -ppassword << EOF -SELECT host,user,Grant_priv,Super_priv FROM mysql.user; -UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root'; -FLUSH PRIVILEGES; -GRANT ALL ON *.* TO 'root'@'%'; -EOF diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/helm-plugin-deployment.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/helm-plugin-deployment.yaml deleted file mode 100644 index ae24fe8..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/helm-plugin-deployment.yaml +++ /dev/null @@ -1,74 +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: helm-plugin - name: helm-plugin -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: helm-plugin - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: helm-plugin - spec: - containers: - - env: - - name: CERTIFICATE_PATH - - name: CHART_PATH - value: /go/release/charts/ - - name: HELM_PLUGIN_PORT - value: "50051" - - name: KEY_PATH - - name: KUBECONFIG_DIR_PATH - value: /go/release/kubeconfig/ - - name: LOGFILE_PATH - value: /go/release/logfile - - name: LOGGER_LEVEL - value: info - - name: RELEASE_NAMESPACE - value: default - image: ealtedge/helmplugin:latest - imagePullPolicy: "" - name: helmplugin - ports: - - containerPort: 50051 - resources: {} - volumeMounts: - - mountPath: /go/release/kubeconfig/ - name: config-dir - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: config-dir - hostPath: - path: /kubeconfig -status: {} - -# yamllint enable diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/helm-plugin-service.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/helm-plugin-service.yaml deleted file mode 100644 index cd9543e..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/helm-plugin-service.yaml +++ /dev/null @@ -1,36 +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: v1 -kind: Service -metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: helm-plugin - name: helmplugin -spec: - ports: - - name: "50051" - port: 50051 - targetPort: 50051 - selector: - io.kompose.service: helm-plugin -status: - loadBalancer: {} - -# yamllint enable diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/init.sh b/ocd/infra/playbooks/roles/applcm/files/deploy/init.sh deleted file mode 100755 index bb7eed7..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/init.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# 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. - -echo "applcm-db preconfig step" diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/my-db-persistentvolumeclaim.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/my-db-persistentvolumeclaim.yaml deleted file mode 100644 index a0e6cfc..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/my-db-persistentvolumeclaim.yaml +++ /dev/null @@ -1,31 +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: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: my-db - name: my-db -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} - -# yamllint enable diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-config.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-config.yaml deleted file mode 100644 index 1b6e041..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-config.yaml +++ /dev/null @@ -1,26 +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. - -# configmap ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: postgres-config - labels: - app: postgres -data: - POSTGRES_DB: mecmdb - POSTGRES_USER: mecm - POSTGRES_PASSWORD: mecm diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-k8s.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-k8s.yaml deleted file mode 100644 index cd1439c..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-k8s.yaml +++ /dev/null @@ -1,50 +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. - - -# 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: - containers: - - name: postgres - image: postgres:9.6 - imagePullPolicy: "Always" - envFrom: - - configMapRef: - name: postgres-config - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: postgredb - ports: - - containerPort: 5432 - volumes: - - name: postgredb - persistentVolumeClaim: - claimName: postgres-pv-claim diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-service.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-service.yaml deleted file mode 100644 index 96d4e61..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-service.yaml +++ /dev/null @@ -1,30 +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. - -# postgres-service ---- -apiVersion: v1 -kind: Service -metadata: - name: postgres-db - namespace: default - labels: - app: postgres -spec: - selector: - app: postgres-db - ports: - - name: "5432" - port: 5432 - targetPort: 5432 diff --git a/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-storage.yaml b/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-storage.yaml deleted file mode 100644 index 9119282..0000000 --- a/ocd/infra/playbooks/roles/applcm/files/deploy/postgres-storage.yaml +++ /dev/null @@ -1,45 +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. - -# persistent volume ---- -kind: PersistentVolume -apiVersion: v1 -metadata: - name: postgres-pv-volume - labels: - type: local - app: postgres -spec: - storageClassName: manual - capacity: - storage: 5Gi - accessModes: - - ReadWriteMany - hostPath: - path: "/mnt/data" ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: postgres-pv-claim - labels: - app: postgres -spec: - storageClassName: manual - accessModes: - - ReadWriteMany - resources: - requests: - storage: 5Gi diff --git a/ocd/infra/playbooks/roles/applcm/tasks/install-ssl.yml b/ocd/infra/playbooks/roles/applcm/tasks/install-ssl.yml deleted file mode 100644 index e18ac62..0000000 --- a/ocd/infra/playbooks/roles/applcm/tasks/install-ssl.yml +++ /dev/null @@ -1,120 +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. - ---- -- name: copy deploy folder to mecm host for installing APPLCM - copy: - src: deploy - dest: /tmp/applcm/ - -- name: modifying configuration to support https - shell: - cmd: cp applcm-broker-deployment.yaml applcm-broker-deployment-ssl.yaml - chdir: /tmp/applcm/deploy/ - -- name: modify configuraiton to support https - shell: - cmd: chmod +x applcmScript.sh && ./applcmScript.sh - chdir: /tmp/applcm/deploy/ - -- name: Generate Certificates - shell: -# yamllint disable rule:line-length - cmd: openssl genrsa -out ca.key 2048 - chdir: /tmp/applcm/deploy/ - -- name: Generate Certificate - Step 2 - shell: - cmd: openssl req -new -key ca.key -subj /C=CN/ST=Peking/L=Beijing/O=ealtedge/CN=www.ealtedge.org -out ca.csr - chdir: /tmp/applcm/deploy/ - -- name: Generate Root Certificate - shell: - cmd: openssl x509 -req -days 365 -in ca.csr -extensions v3_req -signkey ca.key -out trust.cer - chdir: /tmp/applcm/deploy/ - -- name: Generate Server Key - shell: - cmd: openssl genrsa -out server_key.pem 2048 - chdir: /tmp/applcm/deploy/ - - -- name: Generate Server CSR - shell: - cmd: openssl req -new -key server_key.pem -subj /C=CN/ST=Beijing/L=Beijing/O=ealtedge/CN=www.ealtedge.org -out tls.csr - chdir: /tmp/applcm/deploy/ - -- name: Generate Server Certificate - shell: - cmd: openssl x509 -req -in tls.csr -extensions v3_req -CA trust.cer -CAkey ca.key -CAcreateserial -out server.cer - chdir: /tmp/applcm/deploy/ - -- name: Create applcm-secret - shell: -# yamllint disable rule:line-length - cmd: kubectl create secret --namespace default generic applcm-secret --from-file=/tmp/applcm/deploy/server.cer --from-file=/tmp/applcm/deploy/server_key.pem --from-file=/tmp/applcm/deploy/trust.cer - -- name: Install applcm postgres-configmap - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/postgres-config.yaml - -- name: Install applcm - pvc - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/postgres-storage.yaml - -- name: Install applcm - db - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/postgres-k8s.yaml - -- name: Install applcm - postgres-service - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/postgres-service.yaml - -- name: Install applcm - db-init-config - shell: -# yamllint disable rule:line-length - cmd: sleep 10; - ignore_errors: yes - failed_when: false - no_log: True - -- name: Install applcm - helmplugin - shell: - cmd: sleep 10 - -- name: Install applcm - helmplugin - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/helm-plugin-deployment.yaml - - -- name: Install applcm - helmplugin - shell: - cmd: sleep 10 - -- name: Install applcm - helmplugin - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/helm-plugin-service.yaml - - -- name: Install applcm - helmplugin - shell: - cmd: sleep 10 - -- name: Install applcm - broker - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/applcm-broker-deployment-ssl.yaml - -- name: Install applcm - broker - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/applcm-broker-service.yaml diff --git a/ocd/infra/playbooks/roles/applcm/tasks/install.yml b/ocd/infra/playbooks/roles/applcm/tasks/install.yml deleted file mode 100644 index 12c7aa4..0000000 --- a/ocd/infra/playbooks/roles/applcm/tasks/install.yml +++ /dev/null @@ -1,73 +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. - ---- -- name: copy deploy folder to mecm host for installing APPLCM - copy: - src: deploy - dest: /tmp/applcm/ - -- name: Install applcm postgres-configmap - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/postgres-config.yaml - -- name: Install applcm - pvc - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/postgres-storage.yaml - -- name: Install applcm - db - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/postgres-k8s.yaml - -- name: Install applcm - postgres-service - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/postgres-service.yaml - -- name: Install applcm - db-init-config - shell: -# yamllint disable rule:line-length - cmd: sleep 10; - ignore_errors: yes - failed_when: false - no_log: True - -- name: Install applcm - helmplugin - shell: - cmd: sleep 10 - -- name: Install applcm - helmplugin - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/helm-plugin-deployment.yaml - - -- name: Install applcm - helmplugin - shell: - cmd: sleep 10 - -- name: Install applcm - helmplugin - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/helm-plugin-service.yaml - - -- name: Install applcm - helmplugin - shell: - cmd: sleep 10 - -- name: Install applcm - broker - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/applcm-broker-deployment.yaml - -- name: Install applcm - broker - shell: - cmd: kubectl apply -f /tmp/applcm/deploy/applcm-broker-service.yaml diff --git a/ocd/infra/playbooks/roles/applcm/tasks/main.yml b/ocd/infra/playbooks/roles/applcm/tasks/main.yml deleted file mode 100644 index 4a1fe7e..0000000 --- a/ocd/infra/playbooks/roles/applcm/tasks/main.yml +++ /dev/null @@ -1,24 +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. - ---- -- include: "install.yml" - when: operation == 'install' and mode == 'dev' - - -- include: "install-ssl.yml" - when: operation == 'install' and mode == 'prod' - - #- include: "uninstall.yml" - #when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/applcm/tasks/uninstall.yml b/ocd/infra/playbooks/roles/applcm/tasks/uninstall.yml deleted file mode 100644 index 24f63eb..0000000 --- a/ocd/infra/playbooks/roles/applcm/tasks/uninstall.yml +++ /dev/null @@ -1,22 +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. - ---- -- name: Uninstalling APPLCM - shell: - cmd: echo "Reseting the appclm environment" - -- name: Deleting the Deployment and Services of APPLCM - shell: - cmd: kubectl delete -f /tmp/applcm/deploy diff --git a/ocd/infra/playbooks/roles/mepagent/files/deploy/mepagent.yaml b/ocd/infra/playbooks/roles/mepagent/files/deploy/mepagent.yaml deleted file mode 100755 index a8df546..0000000 --- a/ocd/infra/playbooks/roles/mepagent/files/deploy/mepagent.yaml +++ /dev/null @@ -1,46 +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. - - -# mep pod ---- -apiVersion: v1 -kind: Pod -metadata: - name: mepagent - namespace: mep - labels: - app: mepagent -spec: - containers: - - image: ealtedge/mepagent:latest - imagePullPolicy: Always - name: mepagent-pod - env: - - name: CA_CERT_DOMAIN_NAME - value: "www.ealtedge.org" - - name: SSL_ROOT - value: "/etc/mepagent_ssl/trust.cer" - - name: APP_SSL_MODE - value: "0" - ports: - - containerPort: 80 - #volumeMounts: - #- name: mepagentssl - #mountPath: "/etc/mepagent_ssl" - #readOnly: true - #volumes: - #- name: mepagentssl - #secret: - #secretName: mepagentssl-secret diff --git a/ocd/infra/playbooks/roles/mepagent/files/deploy/mepagentScript.sh b/ocd/infra/playbooks/roles/mepagent/files/deploy/mepagentScript.sh deleted file mode 100755 index 48b1b58..0000000 --- a/ocd/infra/playbooks/roles/mepagent/files/deploy/mepagentScript.sh +++ /dev/null @@ -1,24 +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. - -#- name: Server is running on http port" -sed -i 's/value: \"0\"/value: \"1"/g' mepagent.yaml -sed -i 's/#volumeMounts/ volumeMounts/g' mepagent.yaml -sed -i 's/#- name/ - name/g' mepagent.yaml -sed -i 's/#mountPath/ mountPath/g' mepagent.yaml -sed -i 's/#readOnly/ readOnly/g' mepagent.yaml -sed -i 's/#volumes/ volumes/g' mepagent.yaml -sed -i 's/#- name/ - name/g' mepagent.yaml -sed -i 's/#secret/ secret/g' mepagent.yaml -sed -i 's/#secretName/ secretName/g' mepagent.yaml diff --git a/ocd/infra/playbooks/roles/mepagent/tasks/install-ssl.yml b/ocd/infra/playbooks/roles/mepagent/tasks/install-ssl.yml deleted file mode 100644 index 60897e2..0000000 --- a/ocd/infra/playbooks/roles/mepagent/tasks/install-ssl.yml +++ /dev/null @@ -1,38 +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. - ---- -- name: copy deploy folder to mep node to install mepagent - copy: - src: deploy - dest: /tmp/mepagent/ - -- name: modifying configuration to support https - shell: - cmd: cp mepagent.yaml mepagent-ssl.yaml - chdir: /tmp/mepagent/deploy/ - -- name: modify configuraiton to support https - shell: - cmd: chmod +x mepagentScript.sh && ./mepagentScript.sh - chdir: /tmp/mepagent/deploy/ - -- name: Create mepagent-secret - shell: -# yamllint disable rule:line-length - cmd: kubectl create secret --namespace mep generic mepagentssl-secret --from-file=/tmp/mepserver/deploy/server.cer --from-file=/tmp/mepserver/deploy/server_key.pem --from-file=/tmp/mepserver/deploy/trust.cer - -- name: Apply mepagent service - shell: - cmd: kubectl apply -f /tmp/mepagent/deploy/mepagent-ssl.yaml diff --git a/ocd/infra/playbooks/roles/mepagent/tasks/install.yml b/ocd/infra/playbooks/roles/mepagent/tasks/install.yml deleted file mode 100644 index 20fd1e0..0000000 --- a/ocd/infra/playbooks/roles/mepagent/tasks/install.yml +++ /dev/null @@ -1,23 +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. - ---- -- name: copy deploy folder to mep node to install mepagent - copy: - src: deploy - dest: /tmp/mepagent/ - -- name: Apply mepagent service - shell: - cmd: kubectl apply -f /tmp/mepagent/deploy/mepagent.yaml diff --git a/ocd/infra/playbooks/roles/mepagent/tasks/main.yml b/ocd/infra/playbooks/roles/mepagent/tasks/main.yml deleted file mode 100644 index 17cc6ff..0000000 --- a/ocd/infra/playbooks/roles/mepagent/tasks/main.yml +++ /dev/null @@ -1,20 +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. - ---- -- include: "install.yml" - when: operation == 'install' and mode == 'dev' - -- include: "install-ssl.yml" - when: operation == 'install' and mode == 'prod' diff --git a/ocd/infra/playbooks/roles/mepagent/tasks/uninstall.yml b/ocd/infra/playbooks/roles/mepagent/tasks/uninstall.yml deleted file mode 100644 index 4a95461..0000000 --- a/ocd/infra/playbooks/roles/mepagent/tasks/uninstall.yml +++ /dev/null @@ -1,29 +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. - ---- -- name: Uninstalling mepagent - shell: - cmd: echo "Reseting the mepagent" - -- name: Remove the Deployment of mepagent - shell: - cmd: kubectl delete namespace mep - ignore_errors: 'True' - - -- name: Remove the Deployment of mepserver - shell: - cmd: kubectl delete -f /tmp/mepagent/deploy - ignore_errors: 'True' diff --git a/ocd/infra/playbooks/roles/mepconfig/tasks/install.yml b/ocd/infra/playbooks/roles/mepconfig/tasks/install.yml deleted file mode 100644 index 180f787..0000000 --- a/ocd/infra/playbooks/roles/mepconfig/tasks/install.yml +++ /dev/null @@ -1,24 +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. - ---- -# tasks file for transferring mep k3s cluster config file to mecm k8s -- name: debug msg - debug: - msg: transfering MEP kubeconfig files to MECM Server - -- name: Transfer kubeconfig files from all MEP Nodes to MEP Server - copy: - src: /root/.kube/kubeconfig - dest: / diff --git a/ocd/infra/playbooks/roles/mepconfig/tasks/main.yml b/ocd/infra/playbooks/roles/mepconfig/tasks/main.yml deleted file mode 100644 index a3fc9af..0000000 --- a/ocd/infra/playbooks/roles/mepconfig/tasks/main.yml +++ /dev/null @@ -1,21 +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. - ---- -# tasks file for kubeconfig transfer -- include: "install.yml" - when: operation == 'install' - -#- include: "uninstall.yml" - #when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/mepserver/files/deploy/kong-k8s.yaml b/ocd/infra/playbooks/roles/mepserver/files/deploy/kong-k8s.yaml deleted file mode 100644 index c61475f..0000000 --- a/ocd/infra/playbooks/roles/mepserver/files/deploy/kong-k8s.yaml +++ /dev/null @@ -1,124 +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. - - -# kong deployment ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: apigw-kong - name: apigw-kong - namespace: mep -spec: - replicas: 1 - selector: - matchLabels: - app: apigw-kong - template: - metadata: - labels: - app: apigw-kong - spec: - initContainers: - - name: check-db-ready - image: postgres:9.6 - command: ['sh', '-c', 'until pg_isready -h postgres-db -p 5432; - do echo waiting for database; sleep 2; done;'] - containers: - - name: kong-proxy - image: kong:1.5.1-alpine - env: - - name: KONG_DATABASE - value: "postgres" - - name: KONG_NGINX_WORKER_PROCESSES - value: "1" - - name: KONG_ADMIN_ACCESS_LOG - value: /dev/stdout - - name: KONG_ADMIN_ERROR_LOG - value: /dev/stderr - - name: KONG_ADMIN_ACCESS_LOG - value: /dev/stdout - - name: KONG_ADMIN_ERROR_LOG - value: /dev/stderr - - name: KONG_ADMIN_LISTEN - value: 127.0.0.1:8444 ssl - - name: KONG_PROXY_LISTEN - value: 0.0.0.0:8000, 0.0.0.0:8443 ssl http2 - - name: KONG_ADMIN_LISTEN - value: 0.0.0.0:8001 - - name: KONG_PG_DATABASE - value: kong - - name: KONG_PG_HOST - value: postgres-db - - name: KONG_PG_USER - value: kong - - name: KONG_PG_PASSWORD - value: kong - - name: KONG_PROXY_ACCESS_LOG - value: /dev/stdout - - name: KONG_PROXY_ERROR_LOG - value: /dev/stderr - #- name: KONG_SSL_CERT - #value: /run/kongssl/server.cer - #- name: KONG_SSL_CERT_KEY - #value: /run/kongssl/server_key.pem - ports: - - containerPort: 8000 - name: proxy - protocol: TCP - - containerPort: 8443 - name: proxy-ssl - protocol: TCP - - containerPort: 8001 - name: admin-api - protocol: TCP - - containerPort: 8444 - name: admin-api-ssl - protocol: TCP - #volumeMounts: - #- name: kongssl - #mountPath: "/run/kongssl" - #readOnly: true - #volumes: - #- name: kongssl - #secret: - #secretName: kongssl-secret - - -# kong service ---- -apiVersion: v1 -kind: Service -metadata: - name: kong-service - namespace: mep -spec: - selector: - app: apigw-kong - type: NodePort - ports: - - port: 8000 - name: proxy - nodePort: 30010 - - port: 8443 - name: proxy-ssl - nodePort: 30011 - - port: 8001 - name: admin-api - nodePort: 30012 - - port: 8444 - name: admin-api-ssl - nodePort: 30013 diff --git a/ocd/infra/playbooks/roles/mepserver/files/deploy/kongScript.sh b/ocd/infra/playbooks/roles/mepserver/files/deploy/kongScript.sh deleted file mode 100755 index 6abc050..0000000 --- a/ocd/infra/playbooks/roles/mepserver/files/deploy/kongScript.sh +++ /dev/null @@ -1,27 +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. - -#Server is running on https port -sed -i 's/#- name/- name/g' kong-k8s-ssl.yaml -sed -i 's/#value/value/g' kong-k8s-ssl.yaml - - -sed -i 's/#volumeMounts/volumeMounts/g' kong-k8s-ssl.yaml -sed -i 's/#- name/- name/g' kong-k8s-ssl.yaml -sed -i 's/#mountPath/mountPath/g' kong-k8s-ssl.yaml -sed -i 's/#readOnly/readOnly/g' kong-k8s-ssl.yaml -sed -i 's/#volumes/volumes/g' kong-k8s-ssl.yaml -sed -i 's/#- name/- name/g' kong-k8s-ssl.yaml -sed -i 's/#secret/secret/g' kong-k8s-ssl.yaml -sed -i 's/#secretName/secretName/g' kong-k8s-ssl.yaml diff --git a/ocd/infra/playbooks/roles/mepserver/files/deploy/kongconfig.sh b/ocd/infra/playbooks/roles/mepserver/files/deploy/kongconfig.sh deleted file mode 100755 index ea6f79d..0000000 --- a/ocd/infra/playbooks/roles/mepserver/files/deploy/kongconfig.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# 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. - -# Command to update Kong - - -curl --location --request DELETE 'http://159.138.22.15:30012/routes/mp1' -curl --location --request DELETE 'http://159.138.22.15:30012/services/http-mp1' -curl --location --request POST 'http://159.138.22.15:30012/services' --header 'Content-Type: application/json' --data '{"url": "https://mep-service:8088","name": "http-mp1"}' -curl --location --request POST 'http://159.138.22.15:30012/services/http-mp1/routes' --header 'Content-Type: application/json' --data '{"paths": ["/mp1"], "name": "mp1"}' diff --git a/ocd/infra/playbooks/roles/mepserver/files/deploy/mep-basic.yaml b/ocd/infra/playbooks/roles/mepserver/files/deploy/mep-basic.yaml deleted file mode 100644 index d8f6cbe..0000000 --- a/ocd/infra/playbooks/roles/mepserver/files/deploy/mep-basic.yaml +++ /dev/null @@ -1,56 +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. - - -# mep namespace ---- -apiVersion: v1 -kind: Namespace -metadata: - name: mep - -# persitent volume ---- -kind: PersistentVolume -apiVersion: v1 -metadata: - name: postgres-pv-volume - labels: - type: local - app: postgres -spec: - storageClassName: manual - capacity: - storage: 5Gi - accessModes: - - ReadWriteMany - hostPath: - path: "/mnt/data" - -# pvc ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: postgres-pv-claim - namespace: mep - labels: - app: postgres -spec: - storageClassName: manual - accessModes: - - ReadWriteMany - resources: - requests: - storage: 5Gi diff --git a/ocd/infra/playbooks/roles/mepserver/files/deploy/mep-k8s.yaml b/ocd/infra/playbooks/roles/mepserver/files/deploy/mep-k8s.yaml deleted file mode 100755 index b27b6bf..0000000 --- a/ocd/infra/playbooks/roles/mepserver/files/deploy/mep-k8s.yaml +++ /dev/null @@ -1,65 +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. - - -# mep pod ---- -apiVersion: v1 -kind: Pod -metadata: - name: mep - namespace: mep - labels: - app: mep -spec: - containers: - - image: ealtedge/mep:latest - imagePullPolicy: IfNotPresent - name: mep-pod - ports: - - containerPort: 8088 - - containerPort: 8443 - env: - - name: SSL_ROOT - value: "/etc/mepssl" - - name: MEP_SSL_MODE - value: "0" - #volumeMounts: - #- name: mepssl - #mountPath: "/etc/mepssl" - #readOnly: true - #volumes: - #- name: mepssl - #secret: - #secretName: mepssl-secret - - -# mep service ---- -apiVersion: v1 -kind: Service -metadata: - name: mep-service - namespace: mep -spec: - selector: - app: mep - type: NodePort - ports: - - port: 8088 - name: mep-port - nodePort: 30088 - - port: 8443 - name: mep-https-port - nodePort: 30443 diff --git a/ocd/infra/playbooks/roles/mepserver/files/deploy/mepScript.sh b/ocd/infra/playbooks/roles/mepserver/files/deploy/mepScript.sh deleted file mode 100755 index 8610d24..0000000 --- a/ocd/infra/playbooks/roles/mepserver/files/deploy/mepScript.sh +++ /dev/null @@ -1,24 +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. - -#- name: Server is running on http port" -sed -i 's/value: \"0\"/value: \"1"/g' mep-k8s-ssl.yaml -sed -i 's/#volumeMounts/volumeMounts/g' mep-k8s-ssl.yaml -sed -i 's/#- name/- name/g' mep-k8s-ssl.yaml -sed -i 's/#mountPath/mountPath/g' mep-k8s-ssl.yaml -sed -i 's/#readOnly/readOnly/g' mep-k8s-ssl.yaml -sed -i 's/#volumes/volumes/g' mep-k8s-ssl.yaml -sed -i 's/#- name/- name/g' mep-k8s-ssl.yaml -sed -i 's/#secret/secret/g' mep-k8s-ssl.yaml -sed -i 's/#secretName/secretName/g' mep-k8s-ssl.yaml diff --git a/ocd/infra/playbooks/roles/mepserver/files/deploy/postgres-k8s.yaml b/ocd/infra/playbooks/roles/mepserver/files/deploy/postgres-k8s.yaml deleted file mode 100644 index 49c0007..0000000 --- a/ocd/infra/playbooks/roles/mepserver/files/deploy/postgres-k8s.yaml +++ /dev/null @@ -1,103 +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. - - -# postgres database ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: postgres-db - namespace: mep - 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: kong - - name: POSTGRES_USER - value: kong - - name: POSTGRES_PASSWORD - value: kong - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: postgres-data - ports: - - containerPort: 5432 - -# prepare postgres-db ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: prepare-postgre-db - namespace: mep -spec: - template: - spec: - initContainers: - - name: check-db-ready - image: postgres:9.6 - command: ['sh', '-c', 'until pg_isready -h postgres-db -p 5432; - do echo waiting for database; sleep 2; done;'] - containers: - - name: prepare-postgres-db - image: kong:1.5.1-alpine - env: - - name: KONG_DATABASE - value: "postgres" - - name: KONG_PG_DATABASE - value: kong - - name: KONG_PG_HOST - value: postgres-db - - name: KONG_PG_USER - value: kong - - name: KONG_PG_PASSWORD - value: kong - command: ['kong'] - args: ['migrations', 'bootstrap'] - restartPolicy: Never - backoffLimit: 4 - - -# postgres servcie ---- -apiVersion: v1 -kind: Service -metadata: - name: postgres-db - namespace: mep -spec: - selector: - app: postgres-db - type: ClusterIP - ports: - - port: 5432 diff --git a/ocd/infra/playbooks/roles/mepserver/tasks/install-ssl.yml b/ocd/infra/playbooks/roles/mepserver/tasks/install-ssl.yml deleted file mode 100644 index c4c9419..0000000 --- a/ocd/infra/playbooks/roles/mepserver/tasks/install-ssl.yml +++ /dev/null @@ -1,101 +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. - ---- -- name: mep namespace - shell: - cmd: kubectl create namespace mep - ignore_errors: 'True' - -- name: copy deploy folder to mep node to install mepserver - copy: - src: deploy - dest: /tmp/mepserver/ - -- name: modifying configuration to support https - shell: - cmd: cp mep-k8s.yaml mep-k8s-ssl.yaml - chdir: /tmp/mepserver/deploy/ - -- name: modifying configuration to support https - shell: - cmd: cp kong-k8s.yaml kong-k8s-ssl.yaml - chdir: /tmp/mepserver/deploy/ - -- name: modify configuraiton to support https - shell: - cmd: chmod +x mepScript.sh && ./mepScript.sh - chdir: /tmp/mepserver/deploy/ - -- name: modify configuraiton to support https - shell: - cmd: chmod +x kongScript.sh && ./kongScript.sh - chdir: /tmp/mepserver/deploy/ - -- name: Generate Certificates - shell: -# yamllint disable rule:line-length - cmd: openssl genrsa -out ca.key 2048 - chdir: /tmp/mepserver/deploy/ - -- name: Generate Certificate - Step 2 - shell: - cmd: openssl req -new -key ca.key -subj /C=CN/ST=Peking/L=Beijing/O=ealtedge/CN=www.ealtedge.org -out ca.csr - chdir: /tmp/mepserver/deploy/ - -- name: Generate Root Certificate - shell: - cmd: openssl x509 -req -days 365 -in ca.csr -extensions v3_req -signkey ca.key -out trust.cer - chdir: /tmp/mepserver/deploy/ - -- name: Generate TLS certificate and TLS Key - shell: - cmd: openssl genrsa -out server_key.pem 2048 - chdir: /tmp/mepserver/deploy/ - -- name: Generate TLS Certificate and TLS Key - shell: - cmd: openssl req -new -key server_key.pem -subj /C=CN/ST=Beijing/L=Beijing/O=ealtedge/CN=www.ealtedge.org -out tls.csr - chdir: /tmp/mepserver/deploy/ - -- name: Generate TLS Certificate and TLS Key - shell: - cmd: openssl x509 -req -in tls.csr -extensions v3_req -CA trust.cer -CAkey ca.key -CAcreateserial -out server.cer - chdir: /tmp/mepserver/deploy/ - -- name: Create mepssl-secret - shell: -# yamllint disable rule:line-length - cmd: kubectl create secret --namespace mep generic mepssl-secret --from-file=/tmp/mepserver/deploy/server.cer --from-file=/tmp/mepserver/deploy/server_key.pem --from-file=/tmp/mepserver/deploy/trust.cer - -- name: Create kongssl-secret - shell: -# yamllint disable rule:line-length - cmd: kubectl create secret --namespace mep generic kongssl-secret --from-file=/tmp/mepserver/deploy/server.cer --from-file=/tmp/mepserver/deploy/server_key.pem --from-file=/tmp/mepserver/deploy/trust.cer - -- name: Apply mep-basic.yaml - shell: - cmd: kubectl apply -f /tmp/mepserver/deploy/mep-basic.yaml - -- name: Apply mep-k8s.yaml - shell: - cmd: kubectl apply -f /tmp/mepserver/deploy/mep-k8s-ssl.yaml - -- name: Apply kong-k8s.yaml - shell: - cmd: kubectl apply -f /tmp/mepserver/deploy/kong-k8s-ssl.yaml - -- name: Apply postgres-k8s.yaml - shell: - cmd: kubectl apply -f /tmp/mepserver/deploy/postgres-k8s.yaml diff --git a/ocd/infra/playbooks/roles/mepserver/tasks/install.yml b/ocd/infra/playbooks/roles/mepserver/tasks/install.yml deleted file mode 100644 index 01c3f67..0000000 --- a/ocd/infra/playbooks/roles/mepserver/tasks/install.yml +++ /dev/null @@ -1,49 +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. - ---- -- name: mep namespace - shell: - cmd: kubectl create namespace mep - ignore_errors: 'True' - -- name: copy deploy folder to mep node to install mepserver - copy: - src: deploy - dest: /tmp/mepserver/ - -- name: Apply mep-basic.yaml - shell: - cmd: kubectl apply -f /tmp/mepserver/deploy/mep-basic.yaml - -- name: Apply mep-k8s.yaml - shell: - cmd: kubectl apply -f /tmp/mepserver/deploy/mep-k8s.yaml - -- name: Apply kong-k8s.yaml - shell: - cmd: kubectl apply -f /tmp/mepserver/deploy/kong-k8s.yaml - -- name: Apply postgres-k8s.yaml - shell: - cmd: kubectl apply -f /tmp/mepserver/deploy/postgres-k8s.yaml - -- name: -----Configuring Kong API Gateway----- - shell: - cmd: sleep 30 - -- name: Configuring Kong API Gateway - shell: - cmd: chmod +x kongconfig.sh && ./kongconfig.sh - chdir: /tmp/mepserver/deploy/ diff --git a/ocd/infra/playbooks/roles/mepserver/tasks/main.yml b/ocd/infra/playbooks/roles/mepserver/tasks/main.yml deleted file mode 100644 index 17cc6ff..0000000 --- a/ocd/infra/playbooks/roles/mepserver/tasks/main.yml +++ /dev/null @@ -1,20 +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. - ---- -- include: "install.yml" - when: operation == 'install' and mode == 'dev' - -- include: "install-ssl.yml" - when: operation == 'install' and mode == 'prod' diff --git a/ocd/infra/playbooks/roles/mepserver/tasks/uninstall.yml b/ocd/infra/playbooks/roles/mepserver/tasks/uninstall.yml deleted file mode 100644 index ed82029..0000000 --- a/ocd/infra/playbooks/roles/mepserver/tasks/uninstall.yml +++ /dev/null @@ -1,29 +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. - ---- -- name: Uninstalling mepserver - shell: - cmd: echo "Reseting the mepserver" - -- name: Remove the Deployment of mepserver - shell: - cmd: kubectl delete namespace mep - ignore_errors: 'True' - - -- name: Remove the Deployment of mepserver - shell: - cmd: kubectl delete -f /tmp/mepserver/deploy - ignore_errors: 'True' -- 2.16.6