1 # Copyright 2020 Huawei Technologies Co., Ltd.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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 implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
18 cmd: kubectl create namespace mep
21 - name: copy deploy folder to mep node to install mepserver
26 - name: Generate Certificates
28 # yamllint disable rule:line-length
29 cmd: openssl genrsa -out ca.key 2048
30 chdir: /tmp/mepserver/deploy/
32 - name: Generate Certificate - Step 2
34 cmd: openssl req -new -key ca.key -subj /C=CN/ST=Peking/L=Beijing/O=ealtedge/CN=www.ealtedge.org -out ca.csr
35 chdir: /tmp/mepserver/deploy/
37 - name: Generate Root Certificate
39 cmd: openssl x509 -req -days 365 -in ca.csr -extensions v3_req -signkey ca.key -out trust.cer
40 chdir: /tmp/mepserver/deploy/
42 - name: Generate TLS certificate and TLS Key
44 cmd: openssl genrsa -out server_key.pem 2048
45 chdir: /tmp/mepserver/deploy/
47 - name: Generate TLS Certificate and TLS Key
49 cmd: openssl req -new -key server_key.pem -subj /C=CN/ST=Beijing/L=Beijing/O=ealtedge/CN=www.ealtedge.org -out tls.csr
50 chdir: /tmp/mepserver/deploy/
52 - name: Generate TLS Certificate and TLS Key
54 cmd: openssl x509 -req -in tls.csr -extensions v3_req -CA trust.cer -CAkey ca.key -CAcreateserial -out server.cer
55 chdir: /tmp/mepserver/deploy/
57 - name: Create mepssl-secret
59 # yamllint disable rule:line-length
60 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
62 - name: Create kongssl-secret
64 # yamllint disable rule:line-length
65 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
67 - name: Apply mep-basic.yaml
69 cmd: kubectl apply -f /tmp/mepserver/deploy/mep-basic.yaml
71 - name: Apply mep-k8s.yaml
73 cmd: kubectl apply -f /tmp/mepserver/deploy/mep-k8s.yaml
75 - name: Apply kong-k8s.yaml
77 cmd: kubectl apply -f /tmp/mepserver/deploy/kong-k8s.yaml
79 - name: Apply postgres-k8s.yaml
81 cmd: kubectl apply -f /tmp/mepserver/deploy/postgres-k8s.yaml
83 - name: -----Configuring Kong API Gateway-----
87 - name: Configuring Kong API Gateway
89 cmd: chmod +x kongconfig.sh && ./kongconfig.sh
90 chdir: /tmp/mepserver/deploy/