Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit 4781a55

Browse files
authored
disable imdsv1 in canary (#209)
1 parent b223741 commit 4781a55

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tests/codebuild/run_canarytest.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,14 @@ cluster_name="sagemaker-k8s-canary-"$(date '+%Y-%m-%d-%H-%M-%S')""
5353

5454
if [ -z "${USE_EXISTING_CLUSTER}" ]
5555
then
56-
eksctl_args=( --nodes 1 --node-type=c5.xlarge --timeout=40m --region "${CLUSTER_REGION}" --auto-kubeconfig --version "${CLUSTER_VERSION}" )
56+
eksctl_args=( --nodes 1 --node-type=c5.xlarge --region "${CLUSTER_REGION}" --version "${CLUSTER_VERSION}" )
5757
[ "${CLUSTER_PUBLIC_SUBNETS}" != "" ] && eksctl_args+=( --vpc-public-subnets="${CLUSTER_PUBLIC_SUBNETS}" )
5858
[ "${CLUSTER_PRIVATE_SUBNETS}" != "" ] && eksctl_args+=( --vpc-private-subnets="${CLUSTER_PRIVATE_SUBNETS}" )
59+
60+
eksctl create cluster "${cluster_name}" "${eksctl_args[@]}" --dry-run > generated-cluster.yaml
61+
yq -i ".managedNodeGroups[0].disableIMDSv1 = true" generated-cluster.yaml
5962

60-
eksctl create cluster "${cluster_name}" "${eksctl_args[@]}" --enable-ssm
63+
eksctl create cluster -f generated-cluster.yaml --auto-kubeconfig --timeout=40m
6164

6265
echo "Setting kubeconfig"
6366
export KUBECONFIG="/root/.kube/eksctl/clusters/${cluster_name}"

tests/codebuild/run_canarytest_china.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ function download_installer_china(){
5757
}
5858

5959
function create_eks_cluster() {
60-
eksctl_args=( --managed --nodes 1 --node-type=c5.xlarge --timeout=30m --region "$CLUSTER_REGION" --auto-kubeconfig )
60+
eksctl_args=( --managed --nodes 1 --node-type=c5.xlarge --region "$CLUSTER_REGION" )
6161
[ ! -z "${USE_EXISTING_SUBNET}" ] && eksctl_args+=( --vpc-public-subnets="${EKS_PUBLIC_SUBNET_1},${EKS_PUBLIC_SUBNET_2}" )
6262
[ ! -z "${USE_EXISTING_SUBNET}" ] && eksctl_args+=( --vpc-private-subnets="${EKS_PRIVATE_SUBNET_1},${EKS_PRIVATE_SUBNET_2}" )
63+
64+
eksctl create cluster "${CLUSTER_NAME}" "${eksctl_args[@]}" --dry-run > generated-cluster.yaml
65+
yq -i ".managedNodeGroups[0].disableIMDSv1 = true" generated-cluster.yaml
6366

64-
eksctl create cluster "$CLUSTER_NAME" "${eksctl_args[@]}" --enable-ssm
67+
eksctl create cluster -f generated-cluster.yaml --auto-kubeconfig --timeout=40m
6568
}
6669

6770
function install_k8s_operators() {

0 commit comments

Comments
 (0)