常见的K8S的存储服务:GlusterFS、NFS、CephFS1、Pod使用共享存储(NFS)在各个节点上安装yuminstallynfsutils在master上启动NFS服务root@masterecho"/nfs/data/(insecure,rw,sync,no_root_squash)"/etc/exportsroot@mastermkdirp/nfs/data/root@master
Service:Pod的服务发现与负载均衡1、配置现有deployment的service(clusterIP)root@masterserverkubectlgetdeployNAMEREADYUPTODATEAVAILABLEAGEmynginx3/33326mroot@masterserverkubectlexposedeploy/mynginxport=8000targetport=80—
1、kubectl修改podnginx默认页面命令行进入podroot@masterserverkubectlrunmynginximage=nginxpod/mynginxcreatedroot@masterserverkubectlgetpodowideNAMEREADYSTATUSRESTARTSAGEIPNODENOMINATEDNODEREADINESSGATESmynginx1/1Ru
1、命名空间管理创建root@masterkubectlcreatensleohengnamespace/leohengcreated删除root@masterkubectldeletensleohengnamespace"leoheng"deleted2、管理指定命名空间资源创建root@masterservervimleoheng.yamlapiVersion:v1kind:Namespace
1、主机基础信息!WX202204130001382x.png(https://s2.51cto.com/images/20220413/1649779325291218.png?xossprocess=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmF
1、集群组成Kubernetes,一般由Master和WorkerNode组成,Master主要集群信息调度(人的脑),WorkerNode主要负责运行容器实例的运行(人的手脚)。!K8S集群组成.png(https://s2.51cto.com/images/20220410/1649601170261299.png?xossprocess=image/watermark,size_14,tex
创建新的加入集群的命令1、在Master节点上输入kubeadmtokencreateprintjoincommand
1、拉取redis镜像,并配置redis启动外部挂载文件root@dockerdockerpullredisroot@dockermkdir/server/redisroot@dockercd/server/redis/root@dockerredisvimredis.confroot@dockerrediscatredis.confappendonlyyes2、启动redis容器dockerru
1、创建Dockerfile文件root@dockercd/server/root@dockerservermkdirfileroot@dockerservercdfile/root@dockerfilevimDockerfileroot@dockerfilecatDockerfile构建容器的基础镜像FROMcentos:centos7.7.1908容器镜像作者信息MAINTAINERleohe
说明:jenkins依赖JDK环境,部署Jenkins之前一定要安装JDK环境。1.安装jenkinssudowgetO/etc/yum.repos.d/jenkins.repohttps://pkg.jenkins.io/redhatstable/jenkins.reposudorpmimporthttps://pkg.jenkins.io/redhatstable/jenkins.io.key
1、下载扩展包root@lpsourcegitclonehttps://github.com/nicolasff/phpredisCloninginto'phpredis'...remote:Enumeratingobjects:29,done.remote:Countingobjects:100%(29/29),done.remote:Compressingobjects:100%(22/22)
手动安装最新的docker环境
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号