2020-07-14 15:58:14 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
|
2021-03-26 16:34:43 +00:00
|
|
|
export ISTIO_VERSION=1.9.2
|
2020-07-14 15:58:14 +00:00
|
|
|
|
2020-10-02 17:38:09 +00:00
|
|
|
if [ ! -d istio-$ISTIO_VERSION ]; then
|
|
|
|
NAME="istio-$ISTIO_VERSION"
|
|
|
|
URL="https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/istio-${ISTIO_VERSION}-linux-amd64.tar.gz"
|
2020-07-14 15:58:14 +00:00
|
|
|
|
2020-10-02 17:38:09 +00:00
|
|
|
curl -sL "$URL" | tar xz
|
|
|
|
fi
|
2020-07-14 15:58:14 +00:00
|
|
|
|
2020-12-16 11:40:14 +00:00
|
|
|
# Extract control plane charts
|
2020-11-24 14:44:57 +00:00
|
|
|
rm -rf charts/base charts/istio-*
|
|
|
|
cp -r istio-${ISTIO_VERSION}/manifests/charts/base charts/
|
|
|
|
cp -r istio-${ISTIO_VERSION}/manifests/charts/istio-control/istio-discovery charts/
|
|
|
|
|
|
|
|
# Patch for istiod to control plane
|
2021-02-25 22:44:33 +00:00
|
|
|
patch -p3 -i istio-discovery.patch --no-backup-if-mismatch
|
2020-11-21 12:24:57 +00:00
|
|
|
|
2020-12-16 11:40:14 +00:00
|
|
|
# remove unused old telemetry filters
|
2021-02-25 22:44:33 +00:00
|
|
|
rm -f charts/istio-discovery/templates/telemetryv2_1.[678].yaml
|
2020-07-14 15:58:14 +00:00
|
|
|
|
2020-11-24 14:44:57 +00:00
|
|
|
# Ingress charts
|
|
|
|
rm -rf ../kubezero-istio-ingress/charts/istio-*
|
|
|
|
cp -r istio-${ISTIO_VERSION}/manifests/charts/gateways/istio-ingress ../kubezero-istio-ingress/charts/
|
|
|
|
cp -r istio-${ISTIO_VERSION}/manifests/charts/gateways/istio-ingress ../kubezero-istio-ingress/charts/istio-private-ingress
|
2020-07-22 15:01:36 +00:00
|
|
|
|
2020-11-24 14:44:57 +00:00
|
|
|
# Rename private chart
|
|
|
|
sed -i -e 's/name: istio-ingress/name: istio-private-ingress/' ../kubezero-istio-ingress/charts/istio-private-ingress/Chart.yaml
|
|
|
|
|
2020-12-16 11:40:14 +00:00
|
|
|
# Patch for ingress for extended termination grace period
|
2021-02-25 22:44:33 +00:00
|
|
|
patch -i ingress-terminationgraceperiod.patch ../kubezero-istio-ingress/charts/istio-ingress/templates/deployment.yaml --no-backup-if-mismatch
|
|
|
|
patch -i ingress-terminationgraceperiod.patch ../kubezero-istio-ingress/charts/istio-private-ingress/templates/deployment.yaml --no-backup-if-mismatch
|
2020-12-16 11:40:14 +00:00
|
|
|
|
2020-11-24 14:44:57 +00:00
|
|
|
# Get matching istioctl
|
2020-11-28 23:01:20 +00:00
|
|
|
[ -x istioctl ] && [ "$(./istioctl version --remote=false)" == $ISTIO_VERSION ] || { curl -sL https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/istioctl-${ISTIO_VERSION}-linux-amd64.tar.gz | tar xz; chmod +x istioctl; }
|