From 03fb22c78e36fc0eb22d8c0d296d5e98d215d892 Mon Sep 17 00:00:00 2001 From: Areslight <1039411614@qq.com> Date: Tue, 13 Oct 2020 14:40:18 +0800 Subject: [PATCH 1/2] local_proxy_version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 国内网络环境本地设置代理的方式 --- install_k8s.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ install_xos.sh | 12 +++++++++ 2 files changed, 80 insertions(+) create mode 100644 install_k8s.sh create mode 100644 install_xos.sh diff --git a/install_k8s.sh b/install_k8s.sh new file mode 100644 index 0000000..c37b1dd --- /dev/null +++ b/install_k8s.sh @@ -0,0 +1,68 @@ +echo "Installing docker..." +sudo apt-get update +sudo apt-get install -y software-properties-common + +echo "add apt proxy" +sudo bash -c "cat>/etc/apt/apt.conf" << EOF +Acquire::https::proxy "http://172.18.218.123:10809/"; +Acquire::http::proxy "http://172.18.218.123:10809/"; +EOF + +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 0EBFCD88 +sudo add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) \ + stable" +sudo apt-get update +sudo apt-get install -y "docker-ce=17.06*" + +echo "Installing kubeadm..." +sudo apt-get update +sudo apt-get install -y ebtables ethtool apt-transport-https curl + +export http_proxy=http://172.18.218.123:10809/ +export https_proxy=http://172.18.218.123:10809/ + +curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - +sudo bash -c "cat >/tmp/kubernetes.list"</etc/systemd/system/docker.service.d/http-proxy.conf +[Service] +Environment="HTTP_PROXY=http://172.18.218.123:10809/" +Environment="HTTPS_PROXY=http://172.18.218.123:10809/" +EOF +sudo systemctl daemon-reload +sudo systemctl restart docker + +sudo kubeadm init --pod-network-cidr=192.168.0.0/16 +mkdir -p $HOME/.kube +sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config +sudo chown $(id -u):$(id -g) $HOME/.kube/config + + +kubectl taint nodes --all node-role.kubernetes.io/master- + +kubectl apply -f \ + https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml +kubectl apply -f \ + https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml + +echo "Installing helm..." +curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > install-helm.sh +bash install-helm.sh -v v2.12.1 +kubectl create serviceaccount --namespace kube-system tiller +kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller +helm init --service-account tiller \ No newline at end of file diff --git a/install_xos.sh b/install_xos.sh new file mode 100644 index 0000000..d23500f --- /dev/null +++ b/install_xos.sh @@ -0,0 +1,12 @@ +mkdir -p cord +cd cord +git clone https://gerrit.opencord.org/helm-charts + +cd ~/cord/helm-charts + +helm repo add incubator https://charts.opencord.org +helm dep update xos-core +helm install -n xos-core xos-core + +helm dep update xos-profiles/base-kubernetes +helm install -n base-kubernetes xos-profiles/base-kubernetes \ No newline at end of file From 986c8fe9f960af2b69f3ced720efb01e6eab9675 Mon Sep 17 00:00:00 2001 From: Areslight <1039411614@qq.com> Date: Thu, 22 Oct 2020 19:43:35 +0800 Subject: [PATCH 2/2] Update install_k8s.sh --- install_k8s.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install_k8s.sh b/install_k8s.sh index c37b1dd..736eb48 100644 --- a/install_k8s.sh +++ b/install_k8s.sh @@ -1,3 +1,5 @@ +#!/bin/bash + echo "Installing docker..." sudo apt-get update sudo apt-get install -y software-properties-common @@ -39,7 +41,8 @@ sudo swapoff -a echo "docker proxy" sudo mkdir -p /etc/systemd/system/docker.service.d -cat</etc/systemd/system/docker.service.d/http-proxy.conf +sudo touch /etc/systemd/system/docker.service.d/http-proxy.conf +sudo bash -c "cat >/etc/systemd/system/docker.service.d/http-proxy.conf" < inst bash install-helm.sh -v v2.12.1 kubectl create serviceaccount --namespace kube-system tiller kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller -helm init --service-account tiller \ No newline at end of file +helm init --service-account tiller