Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwxn committed Mar 25, 2020
1 parent 6310087 commit 60e4e91
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 67 deletions.
5 changes: 4 additions & 1 deletion perf/istio-install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ Below commands will setup istio with corresponding release using [default perfor
1. To setup Istio with prerelease candidates, run `DNS_DOMAIN=your-example-domain ./setup_istio_release.sh 1.5.0-alpha.0 pre-release`
To provide extra override via set or yaml file, run with EXTRA_ARGS, for example: `EXTRA_ARGS="--set values.grafana.enabled=true -f overlay.yaml" DNS_DOMAIN=your-example-domain ./setup_istio_release.sh 1.5.0`
1. To replace default overlay with other [predefined overlay files](https://github.com/istio/tools/blob/master/perf/istio-install/istioctl_profiles),
run `export CR_FILENAME="automtls.yaml" && DNS_DOMAIN=your-example-domain ./setup_istio_release.sh 1.5.0`
1. To provide extra override via set or self defined yaml file, run with EXTRA_ARGS, for example: `EXTRA_ARGS="--set values.grafana.enabled=true -f overlay.yaml" DNS_DOMAIN=your-example-domain ./setup_istio_release.sh 1.5.0`
70 changes: 5 additions & 65 deletions perf/istio-install/setup_istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,74 +76,12 @@ function setup_admin_binding() {
--user=$(gcloud config get-value core/account) || true
}

function install_istio_with_helm() {
kubectl create ns istio-system || true

if [[ -z "${DRY_RUN}" ]];then
# apply CRD files for istio kinds
if [[ -f "${DIRNAME}/${release}/istio/templates/crds.yaml" ]];then
kubectl apply -f "${DIRNAME}/${release}/istio/templates/crds.yaml"
kubectl wait --for=condition=Established -f "${DIRNAME}/${release}/istio/templates/crds.yaml"
else
kubectl apply -f "${DIRNAME}/${release}/istio-init/files/"
kubectl wait --for=condition=Established -f "${DIRNAME}/${release}/istio-init/files/"
fi
fi

local FILENAME="${DIRNAME}/${release}.yml"

# cluster_name=gke_mixologist-142215_us-central1-a_cls1401 --> remove
local cluster_name
cluster_name=$(kubectl config get-contexts "$(kubectl config current-context)" --no-headers | awk '{print $3}')
local meshID
meshID=$(echo "${cluster_name}" | awk -F "_" '{printf "%s/%s/%s", $2, $3, $4}')
opts+=" --set global.meshID=${meshID}"

# if release_url is not overridden then daily builds require
# tag and hub overrides
if [[ -z "${RELEASE_URL}" ]];then
opts+=" --set global.tag=${release}"
opts+=" --set global.hub=gcr.io/istio-release"
fi

if [[ -n "${MIXERLESS}" ]]; then
opts+=" --set mixer.telemetry.enabled=false"
opts+=" --set mixer.policy.enabled=false"
fi

local values=${VALUES:-values.yaml}
local extravalues=${EXTRA_VALUES:-""}
if [[ ${extravalues} != "" ]]; then
extravalues="--values ${extravalues}"
fi

# shellcheck disable=SC2086
helm template --name istio --namespace istio-system \
${opts} \
--values ${values} \
${extravalues} \
"${DIRNAME}/${release}/istio" > "${FILENAME}"

if [[ -z "${DRY_RUN}" ]];then
kubectl apply -f "${FILENAME}"
if [[ -z "${SKIP_PROMETHEUS}" ]];then
# shellcheck disable=SC2086
"$WD/setup_prometheus.sh" ${DIRNAME}
fi
if [[ -n "${MIXERLESS}" ]]; then
kubectl -n istio-system apply -f https://raw.githubusercontent.com/istio/proxy/master/extensions/stats/testdata/istio/metadata-exchange_filter.yaml
kubectl -n istio-system apply -f https://raw.githubusercontent.com/istio/proxy/master/extensions/stats/testdata/istio/stats_filter.yaml
fi
fi

echo "Wrote file ${FILENAME}"
}

# install istio with default IstioControlPlane CR yaml using istioctl.
function install_istio_with_istioctl() {
local CR_PATH="${WD}/istioctl_profiles/${CR_FILENAME}"
pushd "${ISTIOCTL_PATH}"
./istioctl manifest apply -f "${CR_PATH}" --set "${SET_OVERLAY}" ${EXTRA_ARGS} --wait --force=true
# shellcheck disable=SC2086
./istioctl manifest apply -f "${CR_PATH}" --set "${SET_OVERLAY}" ${EXTRA_ARGS} --wait
popd
}

Expand Down Expand Up @@ -189,7 +127,9 @@ function install_istio() {
else
echo "start installing istio using istioctl"
export SET_OVERLAY="meshConfig.rootNamespace=istio-system"
export CR_FILENAME="default.yaml"
if [[ -z "${CR_FILENAME}" ]]; then
CR_FILENAME="default.yaml"
fi
install_istio_with_istioctl
fi
}
Expand Down
2 changes: 1 addition & 1 deletion perf/load/auto-mtls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The service graph consists of two groups of services

```bash
pushd ../../istio-install
export OPERATOR_PROFILE="automtls.yaml" && ./setup_istio_operator.sh
export CR_FILENAME="automtls.yaml" && DNS_DOMAIN=your-example-domain ./setup_istio_release.sh 1.5.0
popd
```

Expand Down

0 comments on commit 60e4e91

Please sign in to comment.