“Kubernetes”的版本间的差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
(创建页面,内容为“'''Kubernetes'''是一套由Google所發展出來的佈署系統。 == 安裝 == 先安裝Docker,然後安裝Kubernetes的套件: <syntaxhighlight lang…”)
 
安裝
第4行: 第4行:
  
 
 先安裝[[Docker]],然後安裝Kubernetes的套件:
 
 先安裝[[Docker]],然後安裝Kubernetes的套件:
 +
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -; echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list; sudo apt update; sudo apt install -y kubelet kubeadm kubectl
 
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -; echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list; sudo apt update; sudo apt install -y kubelet kubeadm kubectl
 +
</syntaxhighlight>
 +
 +
== 設定 ==
 +
 +
這邊使用[[Calico]]當作網路層:
 +
 +
<syntaxhighlight lang="bash">
 +
sudo kubeadm init --pod-network-cidr=192.168.0.0/16
 +
</syntaxhighlight>
 +
 +
然後把設定檔放到自己目錄下:
 +
 +
<syntaxhighlight lang="bash">
 +
mkdir -p $HOME/.kube
 +
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
 +
sudo chown $(id -u):$(id -g) $HOME/.kube/config
 +
</syntaxhighlight>
 +
 +
接下來啟用Calico設定:
 +
 +
<syntaxhighlight lang="bash">
 +
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
 
</syntaxhighlight>
 
</syntaxhighlight>
  

2018年12月31日 (一) 17:53的版本

Kubernetes是一套由Google所發展出來的佈署系統。

安裝

先安裝Docker,然後安裝Kubernetes的套件:

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -; echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list; sudo apt update; sudo apt install -y kubelet kubeadm kubectl

設定

這邊使用Calico當作網路層:

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

接下來啟用Calico設定:

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

外部連結