-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcreate
More file actions
executable file
·24 lines (17 loc) · 838 Bytes
/
create
File metadata and controls
executable file
·24 lines (17 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
gcloud deployment-manager deployments create gke-with-nat --config gke-with-nat-route.yml
gcloud container clusters get-credentials nat-gke-cluster
kubectl apply -f kubernetes/nginx-pod.yml
echo "waiting for 10 seconds for pod to start"
sleep 10
POD=$(kubectl get pods | grep frontend | awk '{print $1}')
echo "installing curl on container"
kubectl exec -it $POD -- apt-get update
kubectl exec -it $POD -- apt-get install -y curl
echo "Making request to facebook to test connectivity through container"
kubectl exec -it $POD curl https://www.facebook.com > facebook-curl.html
echo "Copying packet captures from nat locally."
## YOU CAN UNCOMMENT THIS IF YOU WANT BUT THE PCAP FILE IS QUITE LARGE ##
#gcloud compute copy-files nat-vm:/tmp/nat.pcap nat.pcap
##
gcloud compute copy-files nat-vm:/tmp/nat.txt nat.txt