当前位置: 首页 > wzjs >正文

长春网站开发推荐做彩票网站需要什么

长春网站开发推荐,做彩票网站需要什么,福州牛蛙 网站建设,设计网站公司可去亿企邦前置虚拟机环境正式部署BUG解决 前置虚拟机环境 每个虚拟机配置一次就好 #关闭防火墙 systemctl stop firewalld systemctl disable firewalld #关闭 selinux sed -i s/enforcing/disabled/ /etc/selinux/config # 永久 setenforce 0 # 临时 #关闭 swap swapoff -a # 临时 vi…

    • 前置虚拟机环境
    • 正式部署
    • BUG解决

前置虚拟机环境

每个虚拟机配置一次就好

#关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
#关闭 selinux
sed -i 's/enforcing/disabled/' /etc/selinux/config # 永久
setenforce 0 # 临时
#关闭 swap
swapoff -a # 临时
vim /etc/fstab # 永久
#将桥接的 IPv4 流量传递到 iptables 的链
cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system # 生效
#时间同步
yum install ntpdate -y
ntpdate time.windows.com
#主机名
hostnamectl set-hostname <hostname>
#在 master 添加 hosts:
cat >> /etc/hosts << EOF
192.168.235.139 k8s-master
192.168.235.133 k8s-node1
192.168.235.134 k8s-node2
EOF

没有Docker需要先安装并更换镜像源

添加 yum 源

cat > /etc/yum.repos.d/kubernetes.repo << EOF
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF

安装 kubeadm,kubelet 和 kubectl

yum install -y kubelet kubeadm kubectl
systemctl enable kubelet

正式部署

在 192.168.235.139(Master)执行

kubeadm init \
--apiserver-advertise-address=192.168.235.139 \
--image-repository registry.aliyuncs.com/google_containers \
--kubernetes-version v1.18.0 \
--service-cidr=10.96.0.0/12 \
--pod-network-cidr=10.244.0.0/16

这条指令执行完后会自动部署k8s的容器,执行完成后会有

kubeadm join 192.168.235.139:6443 --token 5l9p1e.xzn5a7jv3j75l9v0     --discovery-token-ca-cert-hash sha256:41a451baae921a44253243fc54ce7efb604db7df42fb541802337d08868a4a73 

此时在从节点输入上述指令,即可加入集群

kubectl get nodes #测试

执行完后正常应该是都ready了,然后docker ps集群的各个节点也会多出很多k8s相关容器
在这里插入图片描述
在这里插入图片描述

使用 kubectl 工具

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

这个我没加后面也能跑。。。

安装 Pod 网络插件(CNI)

kubectl apply –f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kubeflannel.yml

确保能够访问到 quay.io 这个 registery。如果 Pod 镜像下载失败,可以改这个镜像地址
这个不一定能连上,首先要试试

ping baidu.com

看能不能ping通外网
不行的话需要在DNS加个114.114.114.114
具体参考解决:ping: www.baidu.com: 未知的名称或服务

能ping通外网以后可以把raw.githubusercontent.com换成镜像源或者添加对应的ip,这个网上有相应教程,搜这个网址的关键词就行

或者直接自己创建

cat <<EOF > kube-flannel.yml
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:name: psp.flannel.unprivilegedannotations:seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/defaultseccomp.security.alpha.kubernetes.io/defaultProfileName: docker/defaultapparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/defaultapparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default
spec:privileged: falsevolumes:- configMap- secret- emptyDir- hostPathallowedHostPaths:- pathPrefix: "/etc/cni/net.d"- pathPrefix: "/etc/kube-flannel"- pathPrefix: "/run/flannel"readOnlyRootFilesystem: false# Users and groupsrunAsUser:rule: RunAsAnysupplementalGroups:rule: RunAsAnyfsGroup:rule: RunAsAny# Privilege EscalationallowPrivilegeEscalation: falsedefaultAllowPrivilegeEscalation: false# CapabilitiesallowedCapabilities: ['NET_ADMIN', 'NET_RAW']defaultAddCapabilities: []requiredDropCapabilities: []# Host namespaceshostPID: falsehostIPC: falsehostNetwork: truehostPorts:- min: 0max: 65535# SELinuxseLinux:# SELinux is unused in CaaSPrule: 'RunAsAny'
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:name: flannel
rules:
- apiGroups: ['extensions']resources: ['podsecuritypolicies']verbs: ['use']resourceNames: ['psp.flannel.unprivileged']
- apiGroups:- ""resources:- podsverbs:- get
- apiGroups:- ""resources:- nodesverbs:- list- watch
- apiGroups:- ""resources:- nodes/statusverbs:- patch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:name: flannel
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: flannel
subjects:
- kind: ServiceAccountname: flannelnamespace: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:name: flannelnamespace: kube-system
---
kind: ConfigMap
apiVersion: v1
metadata:name: kube-flannel-cfgnamespace: kube-systemlabels: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-systemlabels: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: rancher/mirrored-flannelcni-flannel-cni-plugin:v1.0.0command:- cpargs:- -f- /flannel- /opt/cni/bin/flannelvolumeMounts:- name: cni-pluginmountPath: /opt/cni/bin- name: install-cniimage: quay.io/coreos/flannel:v0.15.1command:- 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: quay.io/coreos/flannel:v0.15.1command:- /opt/bin/flanneldargs:- --ip-masq- --kube-subnet-mgrresources:requests:cpu: "100m"memory: "50Mi"limits: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.namespacevolumeMounts:- name: runmountPath: /run/flannel- name: flannel-cfgmountPath: /etc/kube-flannel/volumes:- 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
EOF

应用配置

kubectl apply –f kube-flannel.yml

检验结果

kubectl get pods -n kube-system | grep kube-flannel

在这里插入图片描述
kubectl get pod -n kube-system -o wide在这里插入图片描述

如果有Error或者其他非Running情况:
查看具体报错情况

kubectl describe pod kube-flannel-ds-xxxx -n kube-system

如果是pull image出错:
注意上面kube-flannel.yml用到了2个image,那需要手动拉取

docker pull rancher/mirrored-flannelcni-flannel-cni-plugin:v1.0.0
docker puil quay.io/coreos/flannel:v0.15.1

这里尤其需要注意,K8S把POD分配在了哪个节点,我这里是master,那就必须在master pull在这里插入图片描述
测试 kubernetes 集群

kubectl create deployment nginx --image=nginx
kubectl expose deployment nginx --port=80 --type=NodePort
kubectl get pod,svc

在这里插入图片描述
集群中的任一节点ip都能访问pod在这里插入图片描述

BUG解决

究极解决方案:删除K8S所有配置直接重装
什么unready基本都能解决

kubeadm reset
rm -rf $HOME/.kube

删除后直接从kubeadm init开始重装

参考文章:
kubernetes 坑人的错误!!!Unable to connect to the server: x509: certificate signed by unknown authority


文章转载自:

http://LoVy0x8a.qLsyf.cn
http://m3j6EOFP.qLsyf.cn
http://oxCMEE4i.qLsyf.cn
http://ayvSxZF7.qLsyf.cn
http://LuEFmvbi.qLsyf.cn
http://Dt4aVWJP.qLsyf.cn
http://5Xn1trIp.qLsyf.cn
http://d46kuvuz.qLsyf.cn
http://wxCWnvyW.qLsyf.cn
http://2Ufr7o9K.qLsyf.cn
http://RN9DFzor.qLsyf.cn
http://cypx7OHI.qLsyf.cn
http://sJ0yWUeC.qLsyf.cn
http://BBbf5t6C.qLsyf.cn
http://h8xhv71H.qLsyf.cn
http://ZuydchF8.qLsyf.cn
http://lazrq4NE.qLsyf.cn
http://W4xUBttA.qLsyf.cn
http://qRiM5wne.qLsyf.cn
http://XXJKemz2.qLsyf.cn
http://RJlTNNak.qLsyf.cn
http://b3k1M2hE.qLsyf.cn
http://4f1MMDNK.qLsyf.cn
http://Ktaqp8lY.qLsyf.cn
http://XfX4tc2X.qLsyf.cn
http://NZ6OWNm5.qLsyf.cn
http://6ZyTKiXr.qLsyf.cn
http://S5USXXIJ.qLsyf.cn
http://7Qrjh4uo.qLsyf.cn
http://CVVRUJQi.qLsyf.cn
http://www.dtcms.com/wzjs/692569.html

相关文章:

  • 媒体公司网站模板北京营销型网站建设
  • 昌平网站建设域名网站建设流程
  • 网站关键词优化wang天津市建设教育培训网
  • 专门做选择题的网站c 做特产网站
  • 厦门做网站xm37广告设计公司成都
  • 山西响应式网站建设公司2017年网站建设工作总结
  • 网站哪里有网站布局规范
  • 金融网站模板素材加快建设乡镇招商网站
  • 白百度一下你就知道搜索引擎优化方法总结
  • 静态手机网站建设的基本特点无锡制作网站价格表
  • 新乡市建设路小学网站专做脚本的网站
  • 做足球经理头像的网站wordpress 萌主题下载
  • 网站建设捌金手指下拉二五慈溪做网站
  • wordpress 建站插件软件开发中需要哪些可行性分析
  • 网站建设有趣名称知乎广告代理商
  • 网站建设包括内容怎么卸载wordpress
  • 网站建设的电话回访长春城投建设投资有限公司网站
  • 网站做网站做任务做网站推广要注意的事项
  • 网站开发人员是什么南宁市有哪些做网站的外包企业
  • 专做奢侈品品牌的网站买的网站模板怎么上传
  • 初学网站开发书籍做网站 怎么选择公司
  • 更改网站模板内容电商网站建设源代码
  • 网站开发攻略英山建设银行网站
  • 怎么自己建设网站宁波网站网站建设
  • 中国住房城乡建设部官方网站东阿网站建设价格
  • 宁波电器网站制作做公司月刊网站
  • 程序员做项目网站区块链媒体网站建设
  • 网站的优点有哪些关键词优化怎样
  • 查看网站空间大小网站制作公司业务员
  • 人力资源管理咨询亚马逊网站 如何做站内seo