Skip to content

Commit d147183

Browse files
committed
asm patch changes
1 parent 2c6c0db commit d147183

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

examples/simple_regional_with_asm/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module "gke" {
3333
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3434
regional = true
3535
#TESTING
36-
kubernetes_version = "1.15.11-gke.12"
36+
release_channel = "REGULAR"
3737
region = var.region
3838
network = var.network
3939
subnetwork = var.subnetwork
@@ -45,7 +45,7 @@ module "gke" {
4545
{
4646
name = "asm-node-pool"
4747
machine_type = "n1-standard-4"
48-
min_count = 2
48+
min_count = 6
4949
},
5050
]
5151
}

modules/asm/scripts/install_asm.sh

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,25 @@ PROJECT_ID=$1
2424
CLUSTER_NAME=$2
2525
CLUSTER_LOCATION=$3
2626
ASM_CHANNEL=$4
27-
28-
if [[ -d ./asm ]]; then
29-
echo "Removing kpt asm directory"
30-
rm -rf ./asm
31-
fi
27+
ASM_RESOURCES="asm-dir"
28+
BASE_DIR="asm-base-dir"
29+
mkdir -p $ASM_RESOURCES
30+
pushd $ASM_RESOURCES
3231
gcloud config set project ${PROJECT_ID}
33-
# gcloud auth list
34-
gcloud services enable meshca.googleapis.com
35-
kpt pkg get https://github.com/GoogleCloudPlatform/anthos-service-mesh-packages.git/asm .
36-
kpt cfg set asm gcloud.core.project ${PROJECT_ID}
37-
kpt cfg set asm cluster-name ${CLUSTER_NAME}
38-
kpt cfg set asm gcloud.compute.zone ${CLUSTER_LOCATION}
39-
kpt cfg set asm gcloud.container.cluster.releaseChannel ${ASM_CHANNEL}
40-
anthoscli apply -f asm
32+
if [[ -d ./asm-patch ]]; then
33+
echo "ASM patch directory exists. Skipping download..."
34+
else
35+
echo "Downloading ASM patch"
36+
kpt pkg get https://github.com/GoogleCloudPlatform/anthos-service-mesh-packages.git/[email protected] .
37+
fi
38+
anthoscli export -c ${CLUSTER_NAME} -o ${BASE_DIR} -p ${PROJECT_ID} -l ${CLUSTER_LOCATION}
39+
kpt cfg set asm-patch/ base-dir ../${BASE_DIR}
40+
kpt cfg set asm-patch/ gcloud.core.project ${PROJECT_ID}
41+
kpt cfg set asm-patch/ gcloud.container.cluster ${CLUSTER_NAME}
42+
kpt cfg set asm-patch/ gcloud.compute.location ${CLUSTER_LOCATION}
43+
kpt cfg list-setters asm-patch/
44+
pushd ${BASE_DIR} && kustomize create --autodetect --namespace ${PROJECT_ID} && popd
45+
pushd asm-patch && kustomize build -o ../${BASE_DIR}/all.yaml && popd
46+
kpt fn source ${BASE_DIR} | kpt fn run --image gcr.io/kustomize-functions/validate-asm:v0.1.0
47+
anthoscli apply -f ${BASE_DIR}
4148
kubectl wait --for=condition=available --timeout=600s deployment --all -n istio-system

0 commit comments

Comments
 (0)