Last active
April 28, 2020 11:01
-
-
Save elfgzp/02485648297823060a7d8ddbafebf140 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
kubectl label namespace default istio-injection=enabled | |
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml | |
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml | |
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}') | |
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}') | |
export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o jsonpath='{.items[0].status.hostIP}') | |
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT | |
echo $GATEWAY_URL | |
kubectl apply -f samples/bookinfo/networking/destination-rule-all.yaml | |
kubectl apply -f samples/bookinfo/networking/destination-rule-all-mtls.yaml | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -L https://istio.io/downloadIstio | sh - | |
echo 'export PATH=$PATH:/root/istio-1.5.1/bin' >> ~/.bashrc | |
. ~/.bashrc | |
istioctl verify-install | |
istioctl manifest apply --set profile=demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 配置 yum 源 | |
cat <<EOF > /etc/yum.repos.d/kubernetes.repo | |
[kubernetes] | |
name=Kubernetes | |
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 | |
enabled=1 | |
gpgcheck=1 | |
repo_gpgcheck=1 | |
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg | |
EOF | |
# 安装 kubelet kubeadm kubectl | |
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes | |
# 启动 kubelet | |
systemctl enable --now kubelet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 配置 yum 源 | |
cat <<EOF > /etc/yum.repos.d/kubernetes.repo | |
[kubernetes] | |
name=Kubernetes | |
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 | |
enabled=1 | |
gpgcheck=1 | |
repo_gpgcheck=1 | |
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg | |
EOF | |
# 安装 kubelet kubeadm kubectl | |
yum install -y kubelet-1.15.9-0 kubeadm-1.15.9-0 kubectl-1.15.9-0 --disableexcludes=kubernetes | |
# 启动 kubelet | |
systemctl enable --now kubelet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Prepare | |
yum install -y net-tools git vim | |
systemctl disable firewalld && systemctl stop firewalld | |
setenforce 0 | |
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config | |
swapoff -a | |
cat <<EOF > /etc/sysctl.d/k8s.conf | |
net.bridge.bridge-nf-call-ip6tables = 1 | |
net.bridge.bridge-nf-call-iptables = 1 | |
EOF | |
sysctl --system | |
modprobe br_netfilter | |
lsmod | grep br_netfilter | |
yum install -y docker | |
systemctl enable docker && systemctl start docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl https://gist.githubusercontent.com/elfgzp/02485648297823060a7d8ddbafebf140/raw/824da553ebd72d3327a3526e163adf895ef11349/vultr_k8s_prepare.sh | sh | |
curl https://gist.githubusercontent.com/elfgzp/02485648297823060a7d8ddbafebf140/raw/824da553ebd72d3327a3526e163adf895ef11349/vultr_k8s_install_kubeadm.sh | sh | |
curl https://gist.githubusercontent.com/elfgzp/02485648297823060a7d8ddbafebf140/raw/824da553ebd72d3327a3526e163adf895ef11349/vultr_Istio_prepare.sh | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl https://gist.githubusercontent.com/elfgzp/02485648297823060a7d8ddbafebf140/raw/824da553ebd72d3327a3526e163adf895ef11349/vultr_k8s_prepare.sh | sh | |
curl https://gist.githubusercontent.com/elfgzp/02485648297823060a7d8ddbafebf140/raw/fd15314aeda76218f4020e1f95025df7eede431e/vultr_k8s_install_kubeadm_1_15.sh | sh | |
curl https://gist.githubusercontent.com/elfgzp/02485648297823060a7d8ddbafebf140/raw/824da553ebd72d3327a3526e163adf895ef11349/vultr_Istio_prepare.sh | sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment