Skip to content

Instantly share code, notes, and snippets.

@elfgzp
Last active April 28, 2020 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elfgzp/02485648297823060a7d8ddbafebf140 to your computer and use it in GitHub Desktop.
Save elfgzp/02485648297823060a7d8ddbafebf140 to your computer and use it in GitHub Desktop.
#!/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
#!/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
#!/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
#!/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
#!/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
#!/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
#!/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