Skip to content

Commit

Permalink
for demo install support if istio use revision install (#213)
Browse files Browse the repository at this point in the history
* for demo install support  if istio use revision install

* add license header

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: zhaohuabing <zhaohuabing@gmail.com>
  • Loading branch information
3 people authored May 12, 2022
1 parent cc1e2f4 commit 8d27bb5
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 15 deletions.
37 changes: 37 additions & 0 deletions demo/common_func.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------

#set -x

function LabelIstioInjectLabel()
{
ns=$1
echo $ns
label=`kubectl get po -n istio-system |grep istiod | awk '{print $1}' |xargs kubectl get po -o yaml -n istio-system |grep -A 1 REVIS |grep value: |awk '{print $2}'`
echo $label
if [ $label != "" ];then
kubectl label namespace $ns istio.io/rev=$label --overwrite
else
kubectl label namespace $ns istio-injection=enabled --overwrite=true
fi
return 0;
}

6 changes: 4 additions & 2 deletions demo/dubbo/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
# limitations under the License.

BASEDIR=$(dirname "$0")
source $BASEDIR/../common_func.sh


kubectl create ns dubbo
kubectl label namespace dubbo istio-injection=enabled --overwrite=true
LabelIstioInjectLabel dubbo
kubectl apply -f $BASEDIR/dubbo-sample.yaml -n dubbo
kubectl apply -f $BASEDIR/serviceentry.yaml -n dubbo
kubectl apply -f $BASEDIR/destinationrule.yaml -n dubbo
kubectl apply -f $BASEDIR/virtualservice-traffic-splitting.yaml -n dubbo
kubectl apply -f $BASEDIR/virtualservice-traffic-splitting.yaml -n dubbo
4 changes: 3 additions & 1 deletion demo/kafka/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
# limitations under the License.

BASEDIR=$(dirname "$0")
source $BASEDIR/../common_func.sh


kubectl create ns kafka
kubectl label namespace kafka istio-injection=enabled --overwrite=true
LabelIstioInjectLabel kafka
helm repo add zhaohuabing https://zhaohuabing.github.io/helm-repo
helm repo update
helm install my-release --set persistence.enabled=false --set zookeeper.persistence.enabled=false zhaohuabing/kafka -n kafka
Expand Down
6 changes: 4 additions & 2 deletions demo/metaprotocol-dubbo/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
# limitations under the License.

BASEDIR=$(dirname "$0")
source $BASEDIR/../common_func.sh


kubectl create ns meta-dubbo
kubectl label namespace meta-dubbo istio-injection=enabled --overwrite=true
LabelIstioInjectLabel meta-dubbo
kubectl apply -f $BASEDIR/../../k8s/aeraki-bootstrap-config.yaml -n meta-dubbo
kubectl apply -f $BASEDIR/dubbo-sample.yaml -n meta-dubbo
kubectl apply -f $BASEDIR/serviceentry.yaml -n meta-dubbo
kubectl apply -f $BASEDIR/destinationrule.yaml -n meta-dubbo
kubectl apply -f $BASEDIR/destinationrule.yaml -n meta-dubbo
6 changes: 4 additions & 2 deletions demo/metaprotocol-qza/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
# limitations under the License.

BASEDIR=$(dirname "$0")
source $BASEDIR/../common_func.sh


kubectl create ns meta-qza
kubectl label namespace meta-qza istio-injection=enabled --overwrite=true
LabelIstioInjectLabel meta-qza
kubectl apply -f $BASEDIR/qza-protocol.yaml -n istio-system
kubectl apply -f $BASEDIR/../../k8s/aeraki-bootstrap-config.yaml -n meta-qza
kubectl apply -f $BASEDIR/qza-sample.yaml -n meta-qza
kubectl apply -f $BASEDIR/destinationrule.yaml -n meta-qza
kubectl apply -f $BASEDIR/destinationrule.yaml -n meta-qza
6 changes: 4 additions & 2 deletions demo/metaprotocol-thrift/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
# limitations under the License.

BASEDIR=$(dirname "$0")
source $BASEDIR/../common_func.sh


kubectl create ns meta-thrift
kubectl label namespace meta-thrift istio-injection=enabled --overwrite=true
LabelIstioInjectLabel meta-thrift
kubectl apply -f $BASEDIR/../../k8s/aeraki-bootstrap-config.yaml -n meta-thrift
kubectl apply -f $BASEDIR/thrift-sample.yaml -n meta-thrift
kubectl apply -f $BASEDIR/destinationrule.yaml -n meta-thrift
kubectl create cm rate-limit-config -n meta-thrift --from-file $BASEDIR/rate-limit-server/config.yaml
kubectl apply -f $BASEDIR/rate-limit-server/rate-limit-server.yaml -n meta-thrift
kubectl apply -f $BASEDIR/rate-limit-server/rate-limit-server.yaml -n meta-thrift
6 changes: 4 additions & 2 deletions demo/metaprotocol-trpc/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
# limitations under the License.

BASEDIR=$(dirname "$0")
source $BASEDIR/../common_func.sh


kubectl create ns meta-trpc
kubectl label namespace meta-trpc istio-injection=enabled --overwrite=true
LabelIstioInjectLabel meta-trpc
kubectl apply -f $BASEDIR/trpc-protocol.yaml -n istio-system
kubectl apply -f $BASEDIR/../../k8s/aeraki-bootstrap-config.yaml -n meta-trpc
kubectl apply -f $BASEDIR/trpc-sample.yaml -n meta-trpc
kubectl apply -f $BASEDIR/destinationrule.yaml -n meta-trpc
kubectl apply -f $BASEDIR/destinationrule.yaml -n meta-trpc
6 changes: 4 additions & 2 deletions demo/metaprotocol-videopacket/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
# limitations under the License.

BASEDIR=$(dirname "$0")
source $BASEDIR/../common_func.sh


kubectl create ns meta-videopacket
kubectl label namespace meta-videopacket istio-injection=enabled --overwrite=true
LabelIstioInjectLabel meta-videopacket
kubectl apply -f $BASEDIR/videopacket-protocol.yaml -n istio-system
kubectl apply -f $BASEDIR/../../k8s/aeraki-bootstrap-config.yaml -n meta-videopacket
kubectl apply -f $BASEDIR/videopacket-sample.yaml -n meta-videopacket
kubectl apply -f $BASEDIR/destinationrule.yaml -n meta-videopacket
kubectl apply -f $BASEDIR/destinationrule.yaml -n meta-videopacket
6 changes: 4 additions & 2 deletions demo/thrift/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
# limitations under the License.

BASEDIR=$(dirname "$0")
source $BASEDIR/../common_func.sh


kubectl create ns thrift
kubectl label namespace thrift istio-injection=enabled --overwrite=true
LabelIstioInjectLabel thrift
kubectl apply -f $BASEDIR/thrift-sample.yaml -n thrift
kubectl apply -f $BASEDIR/destinationrule.yaml -n thrift
kubectl apply -f $BASEDIR/virtualservice-traffic-splitting.yaml -n thrift
kubectl apply -f $BASEDIR/virtualservice-traffic-splitting.yaml -n thrift

0 comments on commit 8d27bb5

Please sign in to comment.