-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pragmagic/first-iteration
Add test scripts for results for Istio, Kuma, NSM
- Loading branch information
Showing
170 changed files
with
16,678 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
/private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
parent_path=$( cd "$(dirname "$0")" ; pwd -P ) || exit | ||
|
||
source "$parent_path"/private/aws-login.sh || exit | ||
|
||
AWS_CLUSTER_NAME=aws-msm-perf-test-1 | ||
|
||
sg=$(aws ec2 describe-security-groups --filter Name=tag:aws:eks:cluster-name,Values="${AWS_CLUSTER_NAME}" --region="us-east-1" --query 'SecurityGroups[0].GroupId' --output text) | ||
|
||
echo "security group is $sg" | ||
|
||
## Setup security group rules | ||
for i in {1..25} | ||
do | ||
if [[ -n $sg ]]; then | ||
break | ||
fi | ||
sleep 30 | ||
echo attempt "$i" has failed | ||
sg=$(aws ec2 describe-security-groups --filter Name=tag:aws:eks:cluster-name,Values="${AWS_CLUSTER_NAME}" --region="us-east-1" --query 'SecurityGroups[0].GroupId' --output text) | ||
done | ||
|
||
if [[ -z $sg ]]; then | ||
echo "Security group is not found" | ||
exit 1 | ||
fi | ||
|
||
### authorize wireguard | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 51820 --cidr 0.0.0.0/0 | cat | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol udp --port 51820 --cidr 0.0.0.0/0 | cat | ||
### authorize ipsec | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol udp --port 4500 --cidr 0.0.0.0/0 | cat | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol udp --port 500 --cidr 0.0.0.0/0 | cat | ||
### authorize vxlan | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 4789 --cidr 0.0.0.0/0 | cat | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol udp --port 4789 --cidr 0.0.0.0/0 | cat | ||
### authorize nsmgr-proxy | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 5004 --cidr 0.0.0.0/0 | cat | ||
### authorize registry | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 5002 --cidr 0.0.0.0/0 | cat | ||
### authorize vl3-ipam | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 5006 --cidr 0.0.0.0/0 | cat | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
parent_path=$( cd "$(dirname "$0")" ; pwd -P ) || exit | ||
|
||
source "$parent_path"/private/aws-login.sh || exit | ||
|
||
AWS_CLUSTER_NAME=aws-msm-perf-test-2 | ||
|
||
sg=$(aws ec2 describe-security-groups --filter Name=tag:aws:eks:cluster-name,Values="${AWS_CLUSTER_NAME}" --region="us-east-1" --query 'SecurityGroups[0].GroupId' --output text) | ||
|
||
echo "security group is $sg" | ||
|
||
## Setup security group rules | ||
for i in {1..25} | ||
do | ||
if [[ -n $sg ]]; then | ||
break | ||
fi | ||
sleep 30 | ||
echo attempt "$i" has failed | ||
sg=$(aws ec2 describe-security-groups --filter Name=tag:aws:eks:cluster-name,Values="${AWS_CLUSTER_NAME}" --region="us-east-1" --query 'SecurityGroups[0].GroupId' --output text) | ||
done | ||
|
||
if [[ -z $sg ]]; then | ||
echo "Security group is not found" | ||
exit 1 | ||
fi | ||
|
||
### authorize wireguard | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 51820 --cidr 0.0.0.0/0 | cat | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol udp --port 51820 --cidr 0.0.0.0/0 | cat | ||
### authorize vxlan | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 4789 --cidr 0.0.0.0/0 | cat | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol udp --port 4789 --cidr 0.0.0.0/0 | cat | ||
### authorize nsmgr-proxy | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 5004 --cidr 0.0.0.0/0 | cat | ||
### authorize registry | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 5002 --cidr 0.0.0.0/0 | cat | ||
### authorize vl3-ipam | ||
aws ec2 authorize-security-group-ingress --region="us-east-1" --group-id "$sg" --protocol tcp --port 5006 --cidr 0.0.0.0/0 | cat | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
apiVersion: eksctl.io/v1alpha5 | ||
kind: ClusterConfig | ||
|
||
metadata: | ||
name: aws-msm-perf-test-1 | ||
region: us-east-1 | ||
version: '1.27' | ||
|
||
kubernetesNetworkConfig: | ||
ipFamily: IPv4 | ||
|
||
addons: | ||
- name: vpc-cni | ||
- name: coredns | ||
- name: kube-proxy | ||
|
||
iam: | ||
withOIDC: true | ||
|
||
managedNodeGroups: | ||
- name: aws-msm-perf-test-1 | ||
instanceType: m5.2xlarge | ||
desiredCapacity: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
apiVersion: eksctl.io/v1alpha5 | ||
kind: ClusterConfig | ||
|
||
metadata: | ||
name: aws-msm-perf-test-2 | ||
region: us-east-1 | ||
version: '1.27' | ||
|
||
kubernetesNetworkConfig: | ||
ipFamily: IPv4 | ||
|
||
addons: | ||
- name: vpc-cni | ||
- name: coredns | ||
- name: kube-proxy | ||
|
||
iam: | ||
withOIDC: true | ||
|
||
managedNodeGroups: | ||
- name: aws-msm-perf-test-2 | ||
instanceType: m5.2xlarge | ||
desiredCapacity: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
parent_path=$( cd "$(dirname "$0")" ; pwd -P ) || exit | ||
|
||
source "$parent_path"/private/aws-login.sh || exit | ||
|
||
kube_config_dir=/tmp/kind-configs | ||
mkdir -p "$kube_config_dir" || exit | ||
|
||
aws_kubeconfig="$kube_config_dir"/kubeconfig-aws-1 | ||
KUBECONFIG="$aws_kubeconfig" eksctl create cluster -f "$parent_path"/aws-1.yaml || exit | ||
|
||
"$parent_path"/aws--setup-security-1.sh || exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
parent_path=$( cd "$(dirname "$0")" ; pwd -P ) || exit | ||
|
||
source "$parent_path"/private/aws-login.sh || exit | ||
|
||
kube_config_dir=/tmp/kind-configs | ||
mkdir -p "$kube_config_dir" || exit | ||
|
||
aws_kubeconfig="$kube_config_dir"/kubeconfig-aws-2 | ||
KUBECONFIG="$aws_kubeconfig" eksctl create cluster -f "$parent_path"/aws-2.yaml || exit | ||
|
||
"$parent_path"/aws--setup-security-2.sh || exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
parent_path=$( cd "$(dirname "$0")" ; pwd -P ) || exit | ||
|
||
source "$parent_path"/private/aws-login.sh || exit | ||
|
||
eksctl delete cluster -f "$parent_path"/aws-1.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
parent_path=$( cd "$(dirname "$0")" ; pwd -P ) || exit | ||
|
||
source "$parent_path"/private/aws-login.sh || exit | ||
|
||
eksctl delete cluster -f "$parent_path"/aws-2.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
function install_aws() { | ||
# check if aws is already installed | ||
aws --version && return | ||
|
||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" || exit | ||
unzip awscliv2.zip || exit | ||
sudo ./aws/install || exit | ||
rm -rf ./aws || exit | ||
rm -f awscliv2.zip || exit | ||
|
||
# verify aws works | ||
aws --version || exit | ||
} | ||
|
||
function install_eksctl() { | ||
# check if eksctl is already installed | ||
eksctl version && return | ||
|
||
ARCH=amd64 | ||
PLATFORM=$(uname -s)_$ARCH | ||
|
||
curl -sLO "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz" || exit | ||
|
||
# (Optional) Verify checksum | ||
curl -sL "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_checksums.txt" \ | ||
| grep $PLATFORM \ | ||
| sha256sum --check \ | ||
|| exit | ||
|
||
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp || exit | ||
rm eksctl_$PLATFORM.tar.gz || exit | ||
|
||
sudo mv /tmp/eksctl /usr/local/bin || exit | ||
|
||
# verify eksctl works | ||
eksctl version || exit | ||
} | ||
|
||
(install_aws && install_eksctl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
function install_aws() { | ||
# check if aws is already installed | ||
aws --version && return | ||
|
||
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" || exit | ||
sudo installer -pkg AWSCLIV2.pkg -target / || exit | ||
rm -f AWSCLIV2.pkg || exit | ||
|
||
# verify aws works | ||
aws --version || exit | ||
} | ||
|
||
function install_eksctl() { | ||
# check if eksctl is already installed | ||
eksctl version && return | ||
|
||
ARCH=amd64 | ||
PLATFORM=$(uname -s)_$ARCH | ||
|
||
curl -sLO "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz" || exit | ||
|
||
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp || exit | ||
rm eksctl_$PLATFORM.tar.gz || exit | ||
|
||
sudo mv /tmp/eksctl /usr/local/bin || exit | ||
|
||
# verify eksctl works | ||
eksctl version || exit | ||
} | ||
|
||
(install_aws && install_eksctl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
parent_path=$( cd "$(dirname "$0")" ; pwd -P ) || exit | ||
|
||
source "$parent_path"/private/aws-login.sh || exit | ||
|
||
aws eks list-clusters --region us-east-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
function install_clusterctl() { | ||
clusterctl version && return | ||
|
||
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.2/clusterctl-linux-amd64 -o clusterctl || exit | ||
sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl | ||
clusterctl version || exit | ||
} | ||
|
||
function install_metal() { | ||
metal --version && return | ||
|
||
go install github.com/equinix/metal-cli/cmd/metal@latest | ||
metal --version || exit | ||
} | ||
|
||
(install_clusterctl && install_metal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
function install_clusterctl() { | ||
clusterctl version && return | ||
|
||
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.2/clusterctl-darwin-amd64 -o clusterctl || exit | ||
chmod +x ./clusterctl || exit | ||
sudo mv ./clusterctl /usr/local/bin/clusterctl || exit | ||
clusterctl version || exit | ||
} | ||
|
||
function install_metal() { | ||
metal --version && return | ||
|
||
go install github.com/equinix/metal-cli/cmd/metal@latest | ||
metal --version || exit | ||
} | ||
|
||
(install_clusterctl && install_metal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env false "This script should be sourced in a shell, not executed directly" | ||
|
||
alias "k1=kubectl --kubeconfig=$KUBECONFIG1" | ||
alias "k2=kubectl --kubeconfig=$KUBECONFIG2" | ||
|
||
shellname=$(ps -cp "$$" -o command="") | ||
if [ "$shellname" = "bash" ]; then | ||
echo "set autocompletion for bash" | ||
source <(kubectl completion bash) || return || exit | ||
complete -o default -F __start_kubectl k1 || return || exit | ||
complete -o default -F __start_kubectl k2 || return || exit | ||
elif [ "$shellname" = "zsh" ]; then | ||
echo "set autocompletion for zsh" | ||
source <(kubectl completion zsh) || return || exit | ||
else | ||
echo "unsupported shell $shellname" | ||
return 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# ===== get script folder ===== | ||
shellname=$(ps -cp "$$" -o command="") | ||
if [ "$shellname" = "bash" ]; then | ||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P ) || return | ||
elif [ "$shellname" = "zsh" ]; then | ||
parent_path=$( cd "$(dirname "${(%):-%x}")" && pwd -P ) || return | ||
else | ||
echo "unsupported shell $shellname" | ||
return 1 | ||
fi | ||
# ===== ===== ===== | ||
|
||
kubeconfig="$1" | ||
cluster_name="$2" | ||
echo "place $cluster_name config into $kubeconfig" | ||
|
||
rm -f "$kubeconfig" && | ||
KUBECONFIG="$kubeconfig" aws eks update-kubeconfig --region us-east-1 --name "$cluster_name" |
Oops, something went wrong.