中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

淄川政府網(wǎng)站建設(shè)專家商丘seo排名

淄川政府網(wǎng)站建設(shè)專家,商丘seo排名,大良做網(wǎng)站,深圳網(wǎng)站建設(shè)公司推薦樂(lè)云seo需求:搭建k8s 為后續(xù)自動(dòng)部署做準(zhǔn)備進(jìn)程:安裝至少兩個(gè)ubuntu18.04系統(tǒng)(一個(gè)master 一到多個(gè) node)每個(gè)系統(tǒng)上都要裝上docker 和 kubernetes安裝dockersudo su apt-get update#安裝相關(guān)插件 apt-get install apt-transport-https c…

需求:

  • 搭建k8s 為后續(xù)自動(dòng)部署做準(zhǔn)備

進(jìn)程:

  • 安裝至少兩個(gè)ubuntu18.04系統(tǒng)(一個(gè)master 一到多個(gè) node)

  • 每個(gè)系統(tǒng)上都要裝上docker 和 kubernetes

  • 安裝docker

sudo su
apt-get update#安裝相關(guān)插件
apt-get install apt-transport-https ca-certificates curl gnupg lsb-release software-properties-common -y#獲取docker 對(duì)應(yīng)的key 
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#修改源
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) \stable"
apt-get update#安裝docker 及相關(guān)部件
apt-get install docker-ce docker-ce-cli containerd.io -y#查看docker 是否安裝正常
docker --version#啟動(dòng)docker 并設(shè)置開(kāi)機(jī)自啟
sudo systemctl daemon-reload && sudo systemctl restart docker && sudo systemctl enable docker
  • 安裝kubernetes

#基于上面安裝的插件,可以直接獲取kubernetes 的key
curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
EOF#查看一下是否成功
cat /etc/apt/sources.list.d/kubernetes.listapt-get update
#安裝kubernetes 及相關(guān)部件
apt-get install -y kubelet=1.19.2-00 kubeadm=1.19.2-00 kubectl=1.19.2-00 kubernetes-cni#啟動(dòng)并設(shè)置開(kāi)機(jī)自啟
sudo systemctl enable kubelet && systemctl start kubelet#查看是否成功
kubectl version
  • 啟動(dòng) kubernetes 可能會(huì)失敗需要關(guān)閉 Swap

sudo swapoff -a #暫時(shí)關(guān)閉
nano /etc/fstab #永久關(guān)閉,注釋掉swap那一行,推薦永久關(guān)閉
  • 初始化master

# --pod-network-cidr pod 的網(wǎng)段
# --apiserver-advertise-address master 的ip
#記得替換成自己的
kubeadm init --image-repository registry.cn-hangzhou.aliyuncs.com/google_containers --pod-network-cidr=192.168.197.0/16 --apiserver-advertise-address=192.168.197.135#init 成功后最后會(huì)有一段話返回
Your Kubernetes control-plane has initialized successfully!#你需要在普通權(quán)限下運(yùn)行以下命令
To start using your cluster, you need to run the following as a regular user:mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/configYou should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:https://kubernetes.io/docs/concepts/cluster-administration/addons/#你可以把node 通過(guò)以下命令掛到master 下
Then you can join any number of worker nodes by running the following on each as root:kubeadm join 192.168.197.135:6443 --token hbbn5i.u6fqjr0phforyr2q \--discovery-token-ca-cert-hash sha256:e3f40cb90a3d791deaf6b6606ec500cffc8b48d0351b085cd0d4f74a6ce0e794
  • 配置flannel 通信

#兩個(gè)文件在末尾
kubectl create -f kube-flannel-rbac.yml
kubectl create -f kube-flannel.yml#上面兩條有時(shí)候不需要 master 和 node 都需要哦
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
  • 將node 掛到 master 上

#如果上面那個(gè)join 忘了可以重新生成token
kubeadm token create --print-join-command#然后再node 上運(yùn)行返回的 內(nèi)容
  • 在node 上運(yùn)行可能會(huì)失敗報(bào)錯(cuò)The connection to the server localhost:8080 was refused - did you specify the right host or port?

  • 在master 里找到文件 /etc/kubernetes/admin.conf 拷貝到node 下

echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> /etc/profile
source /etc/profile
  • 重新運(yùn)行join

  • 查看node 的狀態(tài)

kubectl get nodes
  • 返回的狀態(tài)都為Ready 表示創(chuàng)建完成

拓展:

  • kube-flannel-rbac.yml

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:name: flannel
rules:- apiGroups:- ""resources:- podsverbs:- get- apiGroups:- ""resources:- nodesverbs:- list- watch- apiGroups:- ""resources:- nodes/statusverbs:- patch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:name: flannel
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: flannel
subjects:
- kind: ServiceAccountname: flannelnamespace: kube-system
  • kube-flannel.yml

---
kind: Namespace
apiVersion: v1
metadata:name: kube-flannellabels:pod-security.kubernetes.io/enforce: privileged
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:name: flannel
rules:
- apiGroups:- ""resources:- podsverbs:- get
- apiGroups:- ""resources:- nodesverbs:- get- list- watch
- apiGroups:- ""resources:- nodes/statusverbs:- patch
- apiGroups:- "networking.k8s.io"resources:- clustercidrsverbs:- list- watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:name: flannel
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: flannel
subjects:
- kind: ServiceAccountname: flannelnamespace: kube-flannel
---
apiVersion: v1
kind: ServiceAccount
metadata:name: flannelnamespace: kube-flannel
---
kind: ConfigMap
apiVersion: v1
metadata:name: kube-flannel-cfgnamespace: kube-flannellabels:tier: nodeapp: flannel
data:cni-conf.json: |{"name": "cbr0","cniVersion": "0.3.1","plugins": [{"type": "flannel","delegate": {"hairpinMode": true,"isDefaultGateway": true}},{"type": "portmap","capabilities": {"portMappings": true}}]}net-conf.json: |{"Network": "10.244.0.0/16","Backend": {"Type": "vxlan"}}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:name: kube-flannel-dsnamespace: kube-flannellabels:tier: nodeapp: flannel
spec:selector:matchLabels:app: flanneltemplate:metadata:labels:tier: nodeapp: flannelspec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:- matchExpressions:- key: kubernetes.io/osoperator: Invalues:- linuxhostNetwork: truepriorityClassName: system-node-criticaltolerations:- operator: Existseffect: NoScheduleserviceAccountName: flannelinitContainers:- name: install-cni-pluginimage: docker.io/flannel/flannel-cni-plugin:v1.1.2#image: docker.io/rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.2command:- cpargs:- -f- /flannel- /opt/cni/bin/flannelvolumeMounts:- name: cni-pluginmountPath: /opt/cni/bin- name: install-cniimage: docker.io/flannel/flannel:v0.20.2#image: docker.io/rancher/mirrored-flannelcni-flannel:v0.20.2command:- cpargs:- -f- /etc/kube-flannel/cni-conf.json- /etc/cni/net.d/10-flannel.conflistvolumeMounts:- name: cnimountPath: /etc/cni/net.d- name: flannel-cfgmountPath: /etc/kube-flannel/containers:- name: kube-flannelimage: docker.io/flannel/flannel:v0.20.2#image: docker.io/rancher/mirrored-flannelcni-flannel:v0.20.2command:- /opt/bin/flanneldargs:- --ip-masq- --kube-subnet-mgrresources:requests:cpu: "100m"memory: "50Mi"securityContext:privileged: falsecapabilities:add: ["NET_ADMIN", "NET_RAW"]env:- name: POD_NAMEvalueFrom:fieldRef:fieldPath: metadata.name- name: POD_NAMESPACEvalueFrom:fieldRef:fieldPath: metadata.namespace- name: EVENT_QUEUE_DEPTHvalue: "5000"volumeMounts:- name: runmountPath: /run/flannel- name: flannel-cfgmountPath: /etc/kube-flannel/- name: xtables-lockmountPath: /run/xtables.lockvolumes:- name: runhostPath:path: /run/flannel- name: cni-pluginhostPath:path: /opt/cni/bin- name: cnihostPath:path: /etc/cni/net.d- name: flannel-cfgconfigMap:name: kube-flannel-cfg- name: xtables-lockhostPath:path: /run/xtables.locktype: FileOrCreate
http://www.risenshineclean.com/news/27805.html

相關(guān)文章:

  • 怎么提高網(wǎng)站排名什么是搜索引擎推廣
  • 網(wǎng)站建設(shè) 步驟百度營(yíng)業(yè)執(zhí)照怎么辦理
  • 做網(wǎng)站過(guò)程視頻百度收錄網(wǎng)站要多久
  • 網(wǎng)站建設(shè)買阿里云云服務(wù)器nba交易最新消息
  • 廈門商務(wù)網(wǎng)站建設(shè)企業(yè)網(wǎng)站設(shè)計(jì)欣賞
  • 做少兒培訓(xùn)網(wǎng)站的公司關(guān)鍵詞怎樣做優(yōu)化排名
  • 做網(wǎng)站下載功能晨陽(yáng)seo顧問(wèn)
  • 網(wǎng)站規(guī)劃主要內(nèi)容黃岡seo
  • 加強(qiáng)門戶網(wǎng)站建設(shè)南寧網(wǎng)站seo排名優(yōu)化
  • 學(xué)做軟件的網(wǎng)站有哪些搜索引擎是什么意思
  • 怎么提高網(wǎng)站seo優(yōu)化關(guān)鍵字排名北京網(wǎng)站建設(shè)公司哪家好
  • 大型門戶網(wǎng)站建設(shè)方案2345網(wǎng)址大全
  • 織夢(mèng)網(wǎng)站首頁(yè)打開(kāi)慢百度客戶電話
  • 電商網(wǎng)站建設(shè)課件蘇州seo網(wǎng)站優(yōu)化軟件
  • 泉州 網(wǎng)站制作成都百度快照優(yōu)化排名
  • 深圳專業(yè)做網(wǎng)站技術(shù)公司網(wǎng)絡(luò)推廣方案
  • 法人變更在哪個(gè)網(wǎng)站做公示建網(wǎng)站需要多少錢
  • 電子商務(wù)網(wǎng)站建設(shè)的階段化分析b2b電子商務(wù)平臺(tái)有哪些
  • 網(wǎng)站編程外貿(mào)業(yè)務(wù)推廣
  • 廣東裝飾公司網(wǎng)站建設(shè)網(wǎng)絡(luò)營(yíng)銷師證書(shū)含金量
  • 中山企業(yè)門戶網(wǎng)站建設(shè)成都網(wǎng)站關(guān)鍵詞推廣
  • 長(zhǎng)沙需要做網(wǎng)站的企業(yè)吳忠seo
  • 動(dòng)態(tài)網(wǎng)站開(kāi)發(fā)第一步藥品銷售推廣方案
  • 中國(guó)幼兒在線幼兒園網(wǎng)站建設(shè)天津網(wǎng)站建設(shè)
  • sae 網(wǎng)站模板線上營(yíng)銷平臺(tái)有哪些
  • 政府網(wǎng)站建設(shè)什么網(wǎng)站可以免費(fèi)推廣
  • wordpress 首頁(yè)模板河南靠譜seo地址
  • 北京中關(guān)村在線官網(wǎng)站群seo
  • 長(zhǎng)沙簡(jiǎn)單的網(wǎng)站建設(shè)公司威海百度seo
  • 翡翠原石網(wǎng)站首頁(yè)怎么做怎樣做app推廣