-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscenario.sh
executable file
·265 lines (232 loc) · 18.8 KB
/
scenario.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
#!/usr/bin/env bash
readonly ROOT_DIR="$( cd -- "$(dirname "${0}")" >/dev/null 2>&1 ; pwd -P )" ;
source ${ROOT_DIR}/helpers.sh ;
source ${ROOT_DIR}/addons/aws/ecr.sh ;
source ${ROOT_DIR}/addons/aws/eks.sh ;
source ${ROOT_DIR}/addons/helm/argocd.sh ;
source ${ROOT_DIR}/addons/helm/gitea.sh ;
source ${ROOT_DIR}/addons/aws/lambda.sh ;
readonly AWS_ENV_FILE=${ROOT_DIR}/env_aws.json ;
readonly ARGOCD_APPS_DIR="${ROOT_DIR}/argocd-apps" ;
readonly GITEA_REPOS_DIR="${ROOT_DIR}/gitea-repos" ;
readonly GITEA_REPOS_CONFIG="${GITEA_REPOS_DIR}/repos.json" ;
readonly AWS_API_USER=$(cat ${AWS_ENV_FILE} | jq -r ".api_user") ;
readonly AWS_PROFILE=$(cat ${AWS_ENV_FILE} | jq -r ".profile") ;
readonly ACTION=${1} ;
# Repo synchronization using git clone, add, commit and push
# args:
# (1) mp kubeconfig cluster context
# (2) envsubst list of variables=values (ECR_REPO_URL=1.2.3.4:5000,EXTRA=extra_value)
function create_and_sync_gitea_repos {
[[ -z "${1}" ]] && print_error "Please provide mp kubeconfig cluster context as 1st argument" && return 2 || local mp_cluster_context="${1}" ;
[[ -z "${2}" ]] && local envsubst_list="" || local envsubst_list="${2}" ;
local gitea_http_url=$(gitea_get_http_url "${mp_cluster_context}") ;
local gitea_http_url_creds=$(gitea_get_http_url_with_credentials "${mp_cluster_context}") ;
# Gitea repository creation
local repo_count=$(jq '. | length' ${GITEA_REPOS_CONFIG}) ;
local existing_repo_list=$(gitea_get_repos_list "${gitea_http_url}") ;
for ((repo_index=0; repo_index<${repo_count}; repo_index++)); do
local repo_description=$(jq -r '.['${repo_index}'].description' ${GITEA_REPOS_CONFIG}) ;
local repo_name=$(jq -r '.['${repo_index}'].name' ${GITEA_REPOS_CONFIG}) ;
if $(echo ${existing_repo_list} | grep "${repo_name}" &>/dev/null); then
print_info "Gitea repository '${repo_name}' already exists" ;
else
print_info "Create gitea repository '${repo_name}'" ;
gitea_create_repo_current_user "${gitea_http_url}" "${repo_name}" "${repo_description}" ;
fi
done
# Repo synchronization using git clone, remove, add, commit and push
local repo_count=$(jq '. | length' ${GITEA_REPOS_CONFIG}) ;
for ((repo_index=0; repo_index<${repo_count}; repo_index++)); do
local repo_name=$(jq -r '.['${repo_index}'].name' ${GITEA_REPOS_CONFIG}) ;
print_info "Sync code for gitea repository '${repo_name}'" ;
gitea_sync_code_to_repo "${GITEA_REPOS_DIR}" "${gitea_http_url_creds}" "${repo_name}" "${envsubst_list}" ;
done
}
# Deploy argcd applications
# args:
# (1) kubeconfig cluster context
# (2) cluster name
# (3) gitea public url
function deploy_argocd_applications {
[[ -z "${1}" ]] && print_error "Please provide kubeconfig cluster context as 1st argument" && return 2 || local cluster_context="${1}" ;
[[ -z "${2}" ]] && print_error "Please provide cluster name as 2nd argument" && return 2 || local cluster_name="${2}" ;
[[ -z "${3}" ]] && print_error "Please provide gitea public url as 3rd argument" && return 2 || local gitea_url="${3}" ;
print_info "Deploying argocd applications in cluster '${cluster_name}' from gitea url '${gitea_url}'" ;
export GITEA_PUBLIC_URL="${gitea_url}" ;
for yaml_file in ${ARGOCD_APPS_DIR}/${cluster_name}/*.yaml ; do
envsubst < ${yaml_file} | kubectl --context ${cluster_context} apply -f - ;
done
}
if [[ ${ACTION} = "deploy" ]]; then
# Get public gitea url
mp_cluster_name=$(jq -r '.eks.clusters[] | select(.tsb_type=="mp").name' ${AWS_ENV_FILE}) ;
mp_cluster_region=$(jq -r '.eks.clusters[] | select(.tsb_type=="mp").region' ${AWS_ENV_FILE}) ;
mp_cluster_context=$(get_eks_cluster_context "${AWS_API_USER}" "${mp_cluster_name}" "${mp_cluster_region}") ;
gitea_public_url=$(gitea_get_http_url ${mp_cluster_context}) ;
ecr_repo_region=$(jq -r '.ecr.region' ${AWS_ENV_FILE}) ;
ecr_repository_url=$(get_ecr_repository_url "${AWS_PROFILE}" "${ecr_repo_region}") ;
# Create and synchronize gitea repos and deploy argocd applications
cluster_count=$(jq '.eks.clusters | length' ${AWS_ENV_FILE}) ;
for ((cluster_index=0; cluster_index<${cluster_count}; cluster_index++)); do
cluster_name=$(jq -r '.eks.clusters['${cluster_index}'].name' ${AWS_ENV_FILE}) ;
cluster_region=$(jq -r '.eks.clusters['${cluster_index}'].region' ${AWS_ENV_FILE}) ;
cluster_tsb_type=$(jq -r '.eks.clusters['${cluster_index}'].tsb_type' ${AWS_ENV_FILE}) ;
cluster_context=$(get_eks_cluster_context "${AWS_API_USER}" "${cluster_name}" "${cluster_region}") ;
case ${cluster_tsb_type} in
"mp")
# Create gitea repos and sync local code to them
hello_lambda_name=$(jq -r '.lambda.functions[0].name' ${AWS_ENV_FILE}) ;
hello_lambda_region=$(jq -r '.lambda.functions[0].region' ${AWS_ENV_FILE}) ;
hello_lambda_function_fqdn=$(get_lambda_function_fqdn "${AWS_PROFILE}" "${hello_lambda_name}" "${hello_lambda_region}") ;
greetings_lambda_name=$(jq -r '.lambda.functions[1].name' ${AWS_ENV_FILE}) ;
greetings_lambda_region=$(jq -r '.lambda.functions[1].region' ${AWS_ENV_FILE}) ;
greetings_lambda_function_fqdn=$(get_lambda_function_fqdn "${AWS_PROFILE}" "${greetings_lambda_name}" "${greetings_lambda_region}") ;
create_and_sync_gitea_repos "${cluster_context}" \
"ECR_REPO_URL=${ecr_repository_url},HELLO_LAMBDA_URL=${hello_lambda_function_fqdn},GREETINGS_LAMBDA_URL=${greetings_lambda_function_fqdn}" ;
# Deploy argocd applications
deploy_argocd_applications "${cluster_context}" "${cluster_name}" "${gitea_public_url}" ;
;;
"cp")
# Deploy argocd applications
deploy_argocd_applications "${cluster_context}" "${cluster_name}" "${gitea_public_url}" ;
;;
*)
print_warning "Unknown tsb cluster type '${cluster_tsb_type}'" ;
continue ;
;;
esac
done
exit 0 ;
fi
if [[ ${ACTION} = "undeploy" ]]; then
exit 0 ;
fi
if [[ ${ACTION} = "info" ]]; then
certs_base_dir="${ROOT_DIR}/certs" ;
mp_cluster_name=$(jq -r '.eks.clusters[] | select(.tsb_type=="mp").name' ${AWS_ENV_FILE}) ;
mp_cluster_region=$(jq -r '.eks.clusters[] | select(.tsb_type=="mp").region' ${AWS_ENV_FILE}) ;
mp_cluster_context=$(get_eks_cluster_context "${AWS_API_USER}" "${mp_cluster_name}" "${mp_cluster_region}") ;
echo -n "Waiting for Tier1 Gateway external hostname address of AppABC in mgmt cluster: " ;
while ! appabc_tier1_hostname=$(kubectl --context ${mp_cluster_context} get svc -n tier1-abc gw-tier1-abc --output jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null) ; do
echo -n "." ; sleep 1 ;
done
echo "DONE" ;
echo -n "Waiting for Tier1 Gateway external hostname address of AppDEF in mgmt cluster: " ;
while ! appdef_tier1_hostname=$(kubectl --context ${mp_cluster_context} get svc -n tier1-def gw-tier1-def --output jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null) ; do
echo -n "." ; sleep 1 ;
done
echo "DONE" ;
echo -n "Waiting for Tier1 Gateway external hostname address of AppGHI in mgmt cluster: " ;
while ! appghi_tier1_hostname=$(kubectl --context ${mp_cluster_context} get svc -n tier1-ghi gw-tier1-ghi --output jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null) ; do
echo -n "." ; sleep 1 ;
done
echo "DONE" ;
echo -n "Waiting for Tier1 Gateway external hostname address of AppLambda in mgmt cluster: " ;
while ! applambda_tier1_hostname=$(kubectl --context ${mp_cluster_context} get svc -n tier1-lambda gw-tier1-lambda --output jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null) ; do
echo -n "." ; sleep 1 ;
done
echo "DONE" ;
echo -n "Waiting for Tier1 Gateway external hostname address of AppABC in mgmt cluster to resolve into an ip address: " ;
appabc_tier1_ip=$(host ${appabc_tier1_hostname} | awk '/has address/ { print $4 }' | head -1 ) ;
while [[ -z "${appabc_tier1_ip}" ]] ; do
echo -n "." ; sleep 1 ;
appabc_tier1_ip=$(host ${appabc_tier1_hostname} | awk '/has address/ { print $4 }' | head -1 ) ;
done
echo "DONE" ;
echo -n "Waiting for Tier1 Gateway external hostname address of AppDEF in mgmt cluster to resolve into an ip address: " ;
appdef_tier1_ip=$(host ${appdef_tier1_hostname} | awk '/has address/ { print $4 }' | head -1 ) ;
while [[ -z "${appdef_tier1_ip}" ]] ; do
echo -n "." ; sleep 1 ;
appdef_tier1_ip=$(host ${appdef_tier1_hostname} | awk '/has address/ { print $4 }' | head -1 ) ;
done
echo "DONE" ;
echo -n "Waiting for Tier1 Gateway external hostname address of AppGHI in mgmt cluster to resolve into an ip address: " ;
appghi_tier1_ip=$(host ${appghi_tier1_hostname} | awk '/has address/ { print $4 }' | head -1 ) ;
while [[ -z "${appghi_tier1_ip}" ]] ; do
echo -n "." ; sleep 1 ;
appghi_tier1_ip=$(host ${appghi_tier1_hostname} | awk '/has address/ { print $4 }' | head -1 ) ;
done
echo "DONE" ;
echo -n "Waiting for Tier1 Gateway external hostname address of AppLambda in mgmt cluster to resolve into an ip address: " ;
applambda_tier1_ip=$(host ${applambda_tier1_hostname} | awk '/has address/ { print $4 }' | head -1 ) ;
while [[ -z "${applambda_tier1_ip}" ]] ; do
echo -n "." ; sleep 1 ;
applambda_tier1_ip=$(host ${applambda_tier1_hostname} | awk '/has address/ { print $4 }' | head -1 ) ;
done
echo "DONE" ;
echo ;
print_info "appabc_tier1_hostname (mgmt cluster): ${appabc_tier1_hostname}" ;
print_info "appabc_tier1_ip (mgmt cluster): ${appabc_tier1_ip}" ;
print_info "appdef_tier1_hostname (mgmt cluster): ${appdef_tier1_hostname}" ;
print_info "appdef_tier1_ip (mgmt cluster): ${appdef_tier1_ip}" ;
print_info "appghi_tier1_hostname (mgmt cluster): ${appghi_tier1_hostname}" ;
print_info "appghi_tier1_ip (mgmt cluster): ${appghi_tier1_ip}" ;
print_info "applambda_tier1_hostname (mgmt cluster): ${applambda_tier1_hostname}" ;
print_info "applambda_tier1_ip (mgmt cluster): ${applambda_tier1_ip}" ;
echo ;
echo ;
print_info "HTTP Traffic to Application ABC through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"abc.demo.tetrate.io:80:${appabc_tier1_ip}\" --url \"http://abc.demo.tetrate.io/proxy/app-b.ns-b/proxy/app-c.ns-c\"" ;
echo ;
print_info "HTTPS Traffic to Application ABC through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"abc-https.demo.tetrate.io:443:${appabc_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://abc-https.demo.tetrate.io/proxy/app-b.ns-b/proxy/app-c.ns-c\"" ;
echo ;
print_info "MTLS Traffic to Application ABC through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"abc-mtls.demo.tetrate.io:443:${appabc_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/abc-mtls/client.abc-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/abc-mtls/client.abc-mtls.demo.tetrate.io-key.pem --url \"https://abc-mtls.demo.tetrate.io/proxy/app-b.ns-b/proxy/app-c.ns-c\"" ;
echo ;
echo ;
print_info "HTTP Traffic to Application DEF through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def.demo.tetrate.io:80:${appdef_tier1_ip}\" --url \"http://def.demo.tetrate.io/proxy/app-e.ns-e/proxy/ifconfig.me\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def.demo.tetrate.io:80:${appdef_tier1_ip}\" --url \"http://def.demo.tetrate.io/proxy/app-f.ns-f/proxy/ifconfig.me\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def.demo.tetrate.io:80:${appdef_tier1_ip}\" --url \"http://def.demo.tetrate.io/proxy/app-e.ns-e/proxy/ipinfo.io\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def.demo.tetrate.io:80:${appdef_tier1_ip}\" --url \"http://def.demo.tetrate.io/proxy/app-f.ns-f/proxy/ipinfo.io\"" ;
echo ;
print_info "HTTPS Traffic to Application DEF through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def-https.demo.tetrate.io:443:${appdef_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://def-https.demo.tetrate.io/proxy/app-e.ns-e/proxy/ifconfig.me\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def-https.demo.tetrate.io:443:${appdef_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://def-https.demo.tetrate.io/proxy/app-f.ns-f/proxy/ifconfig.me\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def-https.demo.tetrate.io:443:${appdef_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://def-https.demo.tetrate.io/proxy/app-e.ns-e/proxy/ipinfo.io\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def-https.demo.tetrate.io:443:${appdef_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://def-https.demo.tetrate.io/proxy/app-f.ns-f/proxy/ipinfo.io\"" ;
echo ;
print_info "MTLS Traffic to Application DEF through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def-mtls.demo.tetrate.io:443:${appdef_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/def-mtls/client.def-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/def-mtls/client.def-mtls.demo.tetrate.io-key.pem --url \"https://def-mtls.demo.tetrate.io/proxy/app-e.ns-e/proxy/ifconfig.me\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def-mtls.demo.tetrate.io:443:${appdef_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/def-mtls/client.def-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/def-mtls/client.def-mtls.demo.tetrate.io-key.pem --url \"https://def-mtls.demo.tetrate.io/proxy/app-f.ns-f/proxy/ifconfig.me\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def-mtls.demo.tetrate.io:443:${appdef_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/def-mtls/client.def-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/def-mtls/client.def-mtls.demo.tetrate.io-key.pem --url \"https://def-mtls.demo.tetrate.io/proxy/app-e.ns-e/proxy/ipinfo.io\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"def-mtls.demo.tetrate.io:443:${appdef_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/def-mtls/client.def-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/def-mtls/client.def-mtls.demo.tetrate.io-key.pem --url \"https://def-mtls.demo.tetrate.io/proxy/app-f.ns-f/proxy/ipinfo.io\"" ;
echo ;
echo ;
print_info "HTTP Traffic to Application GHI through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"ghi.demo.tetrate.io:80:${appghi_tier1_ip}\" --url \"http://ghi.demo.tetrate.io/proxy/app-h.ns-h/proxy/app-i.ns-i\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --user "alice:password" --resolve \"ghi.demo.tetrate.io:80:${appghi_tier1_ip}\" --url \"http://ghi.demo.tetrate.io/proxy/app-h.ns-h/proxy/app-i.ns-i\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --user "bob:password" --resolve \"ghi.demo.tetrate.io:80:${appghi_tier1_ip}\" --url \"http://ghi.demo.tetrate.io/proxy/app-h.ns-h/proxy/app-i.ns-i\"" ;
echo ;
print_info "HTTPS Traffic to Application GHI through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"ghi-https.demo.tetrate.io:443:${appghi_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://ghi-https.demo.tetrate.io/proxy/app-h.ns-h/proxy/app-i.ns-i\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --user "alice:password" --resolve \"ghi-https.demo.tetrate.io:443:${appghi_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://ghi-https.demo.tetrate.io/proxy/app-h.ns-h/proxy/app-i.ns-i\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --user "bob:password" --resolve \"ghi-https.demo.tetrate.io:443:${appghi_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://ghi-https.demo.tetrate.io/proxy/app-h.ns-h/proxy/app-i.ns-i\"" ;
echo ;
print_info "MTLS Traffic to Application GHI through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"ghi-mtls.demo.tetrate.io:443:${appghi_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/ghi-mtls/client.ghi-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/ghi-mtls/client.ghi-mtls.demo.tetrate.io-key.pem --url \"https://ghi-mtls.demo.tetrate.io/proxy/app-h.ns-h/proxy/app-i.ns-i\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --user "alice:password" --resolve \"ghi-mtls.demo.tetrate.io:443:${appghi_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/ghi-mtls/client.ghi-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/ghi-mtls/client.ghi-mtls.demo.tetrate.io-key.pem --url \"https://ghi-mtls.demo.tetrate.io/proxy/app-h.ns-h/proxy/app-i.ns-i\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --user "bob:password" --resolve \"ghi-mtls.demo.tetrate.io:443:${appghi_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/ghi-mtls/client.ghi-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/ghi-mtls/client.ghi-mtls.demo.tetrate.io-key.pem --url \"https://ghi-mtls.demo.tetrate.io/proxy/app-h.ns-h/proxy/app-i.ns-i\"" ;
echo ;
echo ;
print_info "HTTP Traffic to Application Lambda through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"lambda.demo.tetrate.io:80:${applambda_tier1_ip}\" --url \"http://lambda.demo.tetrate.io/hello\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"lambda.demo.tetrate.io:80:${applambda_tier1_ip}\" --url \"http://lambda.demo.tetrate.io/greetings\"" ;
echo ;
print_info "HTTPS Traffic to Application Lambda through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"lambda-https.demo.tetrate.io:443:${applambda_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://lambda-https.demo.tetrate.io/hello\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"lambda-https.demo.tetrate.io:443:${applambda_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --url \"https://lambda-https.demo.tetrate.io/greetings\"" ;
echo ;
print_info "MTLS Traffic to Application Lambda through Tier1 in mgmt cluster" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"lambda-mtls.demo.tetrate.io:443:${applambda_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/lambda-mtls/client.lambda-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/lambda-mtls/client.lambda-mtls.demo.tetrate.io-key.pem --url \"https://lambda-mtls.demo.tetrate.io/hello\"" ;
print_command "curl -v -H \"X-B3-Sampled: 1\" --resolve \"lambda-mtls.demo.tetrate.io:443:${applambda_tier1_ip}\" --cacert ${certs_base_dir}/root-cert.pem --cert ${certs_base_dir}/lambda-mtls/client.lambda-mtls.demo.tetrate.io-cert.pem --key ${certs_base_dir}/lambda-mtls/client.lambda-mtls.demo.tetrate.io-key.pem --url \"https://lambda-mtls.demo.tetrate.io/greetings\"" ;
echo ;
exit 0 ;
fi
echo "Please specify correct action:" ;
echo " - deploy" ;
echo " - undeploy" ;
echo " - info" ;
exit 1 ;