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

江门网站建设公司哪家好企业网站托管方式

江门网站建设公司哪家好,企业网站托管方式,找人做短视频网站,医疗网站建设策划书K8S简单集群搭建 前提条件 windos11电脑#xff0c;内存16g以上安装vmware虚拟机软件安装三个centos7虚拟机#xff0c;分配硬盘40g,内存4g,CPU4核心网络均采用NAT模式#xff08;新建虚拟机默认的模式#xff09; centos7镜像下载#xff1a;https://mirrors.tuna.tsi…K8S简单集群搭建 前提条件 windos11电脑内存16g以上安装vmware虚拟机软件安装三个centos7虚拟机分配硬盘40g,内存4g,CPU4核心网络均采用NAT模式新建虚拟机默认的模式 centos7镜像下载https://mirrors.tuna.tsinghua.edu.cn/centos/7/isos/x86_64/CentOS-7-x86_64-Everything-2207-02.iso 我电脑上三个centos7虚拟机均采用最小化安装IP如下 名称IP地址k8s-master1192.169.94.132k8s-node1192.168.94.133k8s-node2192.168.94.134 其中硬盘分配 /boot 1024Mswap 2048M/ 37G 系统准备 如下命令没有特殊说明则在三个节点上都要执行一次 关闭防火墙 systemctl stop firewalld systemctl disable firewalld关闭selinux sed -i s/enforcing/disabled/ /etc/selinux/config # 永久 setenforce 0 # 临时关闭swap swapoff -a # 临时 sed -ri s/.*swap.*/#/ /etc/fstab # 永久设置主机名 在master虚拟机上执行 hostnamectl set-hostname k8s-master1在node1虚拟机上执行 hostnamectl set-hostname k8s-node1在node2虚拟机上执行 hostnamectl set-hostname k8s-node2添加hosts 在master虚拟机上执行 cat /etc/hosts EOF 192.168.94.132 k8s-master1 192.168.94.133 k8s-node1 192.168.94.134 k8s-node2 EOF将桥接的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可能的问题 无法使用ifconfig 命令 需要安装net-tools: yum install net-tools​ k8s安装 k8s的默认容器运行时CRI为docker,因此要先安装docker docker安装 wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repoyum -y install docker-ce-18.06.1.ce-3.el7systemctl enable docker systemctl start docker验证docker是否安装好 docker --version如果下方出现了docker的版本则说明安装没问题。 设置docker的镜像拉取地址 cat /etc/docker/daemon.json EOF {registry-mirrors: [https://b9pmyelo.mirror.aliyuncs.com] } EOFkubeadm/kubelet/kubectl的安装 设置k8s的软件源 $ cat /etc/yum.repos.d/kubernetes.repo EOF [kubernetes] nameKubernetes baseurlhttps://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled1 gpgcheck0 repo_gpgcheck0 gpgkeyhttps://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg EOF安装 注意最好是指定版本因为坑已踩过 $ yum install -y kubelet-1.18.0 kubeadm-1.18.0 kubectl-1.18.0 $ systemctl enable kubelet初始化Master 在master1上执行集群的master节点初始化(指定阿里云镜像仓库) kubeadm init \--apiserver-advertise-address192.168.94.132 \--image-repository registry.aliyuncs.com/google_containers \--kubernetes-version v1.18.0 \--service-cidr10.96.0.0/12 \--pod-network-cidr10.244.0.0/16执行这句话之后控制台输出如下 [rootlocalhost ~]# kubeadm init \--apiserver-advertise-address192.168.94.132 \--image-repository registry.aliyuncs.com/google_containers \--kubernetes-version v1.18.0 \--service-cidr10.96.0.0/12 \--pod-network-cidr10.244.0.0/16 W1004 11:44:59.317714 70492 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io] [init] Using Kubernetes version: v1.18.0 [preflight] Running pre-flight checks[WARNING IsDockerSystemdCheck]: detected cgroupfs as the Docker cgroup driver. The recommended driver is systemd. Please follow the guide at https://kubernetes.io/docs/setup/cri/ [preflight] Pulling images required for setting up a Kubernetes cluster [preflight] This might take a minute or two, depending on the speed of your internet connection [preflight] You can also perform this action in beforehand using kubeadm config images pull [kubelet-start] Writing kubelet environment file with flags to file /var/lib/kubelet/kubeadm-flags.env [kubelet-start] Writing kubelet configuration to file /var/lib/kubelet/config.yaml [kubelet-start] Starting the kubelet [certs] Using certificateDir folder /etc/kubernetes/pki [certs] Generating ca certificate and key [certs] Generating apiserver certificate and key [certs] apiserver serving cert is signed for DNS names [k8s-master1 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.94.132] [certs] Generating apiserver-kubelet-client certificate and key [certs] Generating front-proxy-ca certificate and key [certs] Generating front-proxy-client certificate and key [certs] Generating etcd/ca certificate and key [certs] Generating etcd/server certificate and key [certs] etcd/server serving cert is signed for DNS names [k8s-master1 localhost] and IPs [192.168.94.132 127.0.0.1 ::1] [certs] Generating etcd/peer certificate and key [certs] etcd/peer serving cert is signed for DNS names [k8s-master1 localhost] and IPs [192.168.94.132 127.0.0.1 ::1] [certs] Generating etcd/healthcheck-client certificate and key [certs] Generating apiserver-etcd-client certificate and key [certs] Generating sa key and public key [kubeconfig] Using kubeconfig folder /etc/kubernetes [kubeconfig] Writing admin.conf kubeconfig file [kubeconfig] Writing kubelet.conf kubeconfig file [kubeconfig] Writing controller-manager.conf kubeconfig file [kubeconfig] Writing scheduler.conf kubeconfig file [control-plane] Using manifest folder /etc/kubernetes/manifests [control-plane] Creating static Pod manifest for kube-apiserver [control-plane] Creating static Pod manifest for kube-controller-manager W1004 11:45:44.142408 70492 manifests.go:225] the default kube-apiserver authorization-mode is Node,RBAC; using Node,RBAC [control-plane] Creating static Pod manifest for kube-scheduler W1004 11:45:44.143008 70492 manifests.go:225] the default kube-apiserver authorization-mode is Node,RBAC; using Node,RBAC [etcd] Creating static Pod manifest for local etcd in /etc/kubernetes/manifests [wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory /etc/kubernetes/manifests. This can take up to 4m0s [apiclient] All control plane components are healthy after 14.503883 seconds [upload-config] Storing the configuration used in ConfigMap kubeadm-config in the kube-system Namespace [kubelet] Creating a ConfigMap kubelet-config-1.18 in namespace kube-system with the configuration for the kubelets in the cluster [upload-certs] Skipping phase. Please see --upload-certs [mark-control-plane] Marking the node k8s-master1 as control-plane by adding the label node-role.kubernetes.io/master [mark-control-plane] Marking the node k8s-master1 as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule] [bootstrap-token] Using token: t6p6ko.ok8x7h1era4pq66e [bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles [bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to get nodes [bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials [bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token [bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster [bootstrap-token] Creating the cluster-info ConfigMap in the kube-public namespace [kubelet-finalize] Updating /etc/kubernetes/kubelet.conf to point to a rotatable kubelet client certificate and key [addons] Applied essential addon: CoreDNS [addons] Applied essential addon: kube-proxyYour Kubernetes control-plane has initialized successfully!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/Then you can join any number of worker nodes by running the following on each as root:kubeadm join 192.168.94.132:6443 --token t6p6ko.ok8x7h1era4pq66e \--discovery-token-ca-cert-hash sha256:c1b3fd084dac33494a27532c368c844181e6942c5c0d2007c2e683ac3ffea83a 注意最后这一句,这是初始化master几点生成的node加入时使用的token,默认为24小时,后面会用到 kubeadm join 192.168.94.132:6443 --token t6p6ko.ok8x7h1era4pq66e \--discovery-token-ca-cert-hash sha256:c1b3fd084dac33494a27532c368c844181e6942c5c0d2007c2e683ac3ffea83a当token过期后想其他的node节点加入可通过如下命令重新创建token: kubeadm token create --print-join-command部署CNI网络插件 在master节点上执行下载yml文件 wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml在master节点上应用文件 kubectl apply -f kube-fannel.yml可能出现问题拉取yml文件失败 wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml --2023-10-04 11:50:46-- https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml 正在解析主机 raw.githubusercontent.com (raw.githubusercontent.com)... ::1, 127.0.0.1 正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|::1|:443... 失败拒绝连接。 正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|127.0.0.1|:443... 失败拒绝连接。解决办法参考wget安装flannel插件-连接失败_Geray-zsg的博客-CSDN博客 在/etc/hosts 文件中添加如下解析 199.232.68.133 raw.githubusercontent.com再执行就可以正常下载了 k8s安装后测试 在k8s集群中创建一个pod: kubectl create deployment nginx --imagenginx暴露端口 kubectl expose deployment nginx --port80 --typeNodePort查看暴露的服务 [rootlocalhost etc]# kubectl get pod,svc NAME READY STATUS RESTARTS AGE pod/nginx-f89759699-hnhl9 1/1 Running 0 59mNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/kubernetes ClusterIP 10.96.0.1 none 443/TCP 67m service/nginx NodePort 10.96.178.17 none 80:32377/TCP 46m 验证访问 http://192.168.94.132:32377 http://192.168.94.133:32377 http://192.168.94.134:32377 如果都能访问代表k8s集群部署正常
http://www.tj-hxxt.cn/news/136178.html

相关文章:

  • 七初SEO网站建设珠海做网站的
  • 经营地址怎么在国税网站做更改怎样开通微信小商店
  • 网站开发获取用户微信号登录亚马逊网站做外贸
  • 株洲专业做网站设计的进入百度知道首页
  • 北京新机场建设指挥部网站外网资源
  • 怎么找网站的根目录佛山网红打卡地
  • 山东建设银行招聘网站小程序云开发费用
  • 企业网站样板制作同行抄袭公司网站
  • 番禺建网站南宁建设网站
  • 深圳物流公司网站公司网站备案需要哪些资料
  • WordPress网站修改做基因表达热图的网站
  • 网站建设科技公司外部环境分析创新型的顺的网站制作
  • 国内做轮胎网站哪家好怎么安装百度
  • 重庆网站建设搜外杭州公司注册费用
  • 做五金奖牌进什么网站湛江赤坎孵化器网站建设招聘
  • 网站建设自己建设工程合同在性质上属于什么合同
  • 手机搞笑网站模板下载安装中国建筑人事部大全
  • 在线考试网站模板网站seo方案
  • 做设计的地图网站有哪些十大景观设计公司排名
  • 网站设计不需要考虑怎样做淘宝联盟网站
  • 外贸网站建设入门建设食品网站
  • 哪个小说网站版权做的好处wordpress插件video playe
  • 南通免费网站建设织梦大气婚纱影楼网站源码
  • 怎么才能把网站优化做好服装设计个人工作室
  • 织梦做网站主页容易吗娱乐城网站开发
  • 优秀企业网站建设哪家服务好网站建设社团活动宗旨
  • 大悟建设局网站怎么以公司名义注册邮箱
  • 个人网站怎么做支付微信上wordpress
  • 软件网站建设基本流程图网站建设毕业设计报告书
  • 梯子seo网络优化师招聘