2 # Copyright 2020 Huawei Technologies Co., Ltd.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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 implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 - name: Doing deployment setup for edge gallery
24 - name: Import config file
26 file: ../../../config.yml
29 - name: Create mep namespace
30 command: kubectl create ns mep
34 - name: Create generic pg secret
35 # yamllint disable rule:line-length
36 command: kubectl -n mep create secret generic pg-secret --from-literal=pg_admin_pwd={{ vardata.mepadminpwd.name}} --from-literal=kong_pg_pwd={{ vardata.mepkongpgpwd.name}} --from-file=server.key=/tmp/.mep_tmp_cer/server_tls.key --from-file=server.crt=/tmp/.mep_tmp_cer/server_tls.crt
37 # yamllint disable rule:line-length
41 - name: Create mep generic for mep ssl
42 # yamllint disable rule:line-length
43 command: kubectl -n mep create secret generic mep-ssl --from-literal=cert_pwd={{ vardata.mepcertpwd.name}} --from-file=server.cer=/tmp/.mep_tmp_cer/server_tls.crt --from-file=server_key.pem=/tmp/.mep_tmp_cer/server_encryptedtls.key --from-file=trust.cer=/tmp/.mep_tmp_cer/ca.crt
44 # yamllint disable rule:line-length
48 - name: Create mep seret generic
49 # yamllint disable rule:line-length
50 command: kubectl -n mep create secret generic mepauth-secret --from-file=server.crt=/tmp/.mep_tmp_cer/server_tls.crt --from-file=server.key=/tmp/.mep_tmp_cer/server_tls.key --from-file=ca.crt=/tmp/.mep_tmp_cer/ca.crt --from-file=jwt_publickey=/tmp/.mep_tmp_cer/jwt_publickey --from-file=jwt_encrypted_privatekey=/tmp/.mep_tmp_cer/jwt_encrypted_privatekey
51 # yamllint disable rule:line-length
56 msg: Deploy_dns_metallb execution start
58 - name: Eg_Mep deployment execution of namesapce
59 command: kubectl apply -f /tmp/eg_mep/deploy/conf/edge/metallb/namespace.yaml
61 chdir: /tmp/eg_mep/deploy/
63 - name: Eg_Mep deployment execution of metallb
64 command: kubectl apply -f /tmp/eg_mep/deploy/conf/edge/metallb/metallb.yaml
66 chdir: /tmp/eg_mep/deploy/
68 - name: Eg_Mep deployment create secret
69 command: kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"
71 chdir: /tmp/eg_mep/deploy/
73 - name: Eg_Mep deployment execution of config-mep
74 command: kubectl apply -f /tmp/eg_mep/deploy/conf/edge/metallb/config-map.yaml
76 chdir: /tmp/eg_mep/deploy/
79 msg: Deploy_network_isolation_multus execution start
81 - name: Running multus yaml files
82 command: kubectl apply -f /tmp/eg_mep/deploy/conf/edge/network-isolation/multus.yaml
84 chdir: /tmp/eg_mep/deploy/
86 - name: Running eg-sp-rbac yaml files
87 command: kubectl apply -f /tmp/eg_mep/deploy/conf/edge/network-isolation/eg-sp-rbac.yaml
89 chdir: /tmp/eg_mep/deploy/
91 - name: Replacing image
93 path: /tmp/eg_mep/deploy/conf/edge/network-isolation/eg-sp-controller.yaml
94 regexp: 'edgegallery/edgegallery-secondary-ep-controller:{{ vardata.egepcontroller.name}}'
95 replace: "swr.ap-southeast-1.myhuaweicloud.com/edgegallery/edgegallery-secondary-ep-controller:{{ vardata.cloudegepcontroller.name}}"
97 - name: Running eg-sp-controller yaml files
98 command: kubectl apply -f /tmp/eg_mep/deploy/conf/edge/network-isolation/eg-sp-controller.yaml
100 chdir: /tmp/eg_mep/deploy/
103 msg: Setup_interfaces execution start
105 - name: Link eg mep macvlan
106 command: ip link add eg-mp1 link {{ vardata.systeminterface1.name}} type macvlan mode bridge
108 chdir: /tmp/eg_mep/deploy/
112 - name: Link eg mep macvlan
113 command: ip addr add {{ vardata.ipaddregmepmacvlan.name}} dev eg-mp1
115 chdir: /tmp/eg_mep/deploy/
119 - name: Link eg me1 up
120 command: ip link set dev eg-mp1 up
122 chdir: /tmp/eg_mep/deploy/
126 - name: Link eg eg mm5 with eth1
127 command: ip link add eg-mm5 link {{ vardata.systeminterface2.name}} type macvlan mode bridge
129 chdir: /tmp/eg_mep/deploy/
133 - name: Link eg eg mm5 ip addr
134 command: ip addr add {{ vardata.ipaddregmep5.name}} dev eg-mm5
136 chdir: /tmp/eg_mep/deploy/
140 - name: Link eg eg mm5 set dev
141 command: ip link set dev eg-mm5 up
143 chdir: /tmp/eg_mep/deploy/
148 msg: Pull helm repo start
150 - name: Edge gallery mep installation pull chart
151 # yamllint disable rule:line-length
152 command: helm install --wait mep-edgegallery edgegallery/mep --set networkIsolation.phyInterface.mp1={{ vardata.systeminterface1.name}} --set networkIsolation.phyInterface.mm5={{ vardata.systeminterface2.name}} --set images.mep.tag={{ vardata.mepimagetag.name}} --set images.mepauth.tag={{ vardata.mepauthimagetag.name}} --set images.dns.tag={{ vardata.mepdnsimagetag.name}} --set ssl.secretName=mep-ssl
153 # yamllint disable rule:line-length
155 chdir: /tmp/eg_mep/deploy/