首页
直播
统计
壁纸
留言
友链
关于
Search
1
PVE开启硬件显卡直通功能
2,636 阅读
2
IPTV直播源分享地址
2,287 阅读
3
在k8s(kubernetes) 上安装 ingress V1.1.0
2,121 阅读
4
二进制安装Kubernetes(k8s) v1.24.0 IPv4/IPv6双栈
1,966 阅读
5
Ubuntu 通过 Netplan 配置网络教程
1,914 阅读
默认分类
登录
/
注册
Search
chenby
累计撰写
211
篇文章
累计收到
124
条评论
首页
栏目
默认分类
页面
直播
统计
壁纸
留言
友链
关于
搜索到
211
篇与
默认分类
的结果
2021-12-30
kubernetes核心实战(六)--- ConfigMap
8、ConfigMap抽取应用配置,并且可以自动更新创建配置文件[root@k8s-master-node1 ~/yaml/test]# vim configmap.yaml [root@k8s-master-node1 ~/yaml/test]# cat configmap.yaml apiVersion: v1 data: redis.conf: | appendonly yes kind: ConfigMap metadata: name: redis-conf namespace: default [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]# kubectl apply -f configmap.yaml configmap/redis-conf created [root@k8s-master-node1 ~/yaml/test]#查看配置[root@k8s-master-node1 ~/yaml/test]# kubectl get configmaps NAME DATA AGE kube-root-ca.crt 1 110m redis-conf 1 18s [root@k8s-master-node1 ~/yaml/test]#9、DaemonSetDaemonSet 确保全部(或者某些)节点上运行一个 Pod 的副本。当有节点加入集群时, 也会为他们新增一个 Pod 。当有节点从集群移除时,这些 Pod 也会被回收。删除 DaemonSet 将会删除它创建的所有 Pod。DaemonSet 的一些典型用法:在每个节点上运行集群存守护进程在每个节点上运行日志收集守护进程在每个节点上运行监控守护进程一种简单的用法是为每种类型的守护进程在所有的节点上都启动一个 DaemonSet。一个稍微复杂的用法是为同一种守护进程部署多个 DaemonSet;每个具有不同的标志, 并且对不同硬件类型具有不同的内存、CPU 要求。创建[root@k8s-master-node1 ~/yaml/test]# vim daemonset.yaml [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]# cat daemonset.yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: redis-app labels: k8s-app: redis-app spec: selector: matchLabels: name: fluentd-redis template: metadata: labels: name: fluentd-redis spec: tolerations: # this toleration is to have the daemonset runnable on master nodes # remove it if your masters can't run pods - key: node-role.kubernetes.io/master effect: NoSchedule containers: - name: fluentd-redis image: redis command: - redis-server - "/redis-master/redis.conf" #指的是redis容器内部的位置 ports: - containerPort: 6379 resources: limits: memory: 200Mi requests: cpu: 100m memory: 200Mi volumeMounts: - name: data mountPath: /data - name: config mountPath: /redis-master readOnly: true terminationGracePeriodSeconds: 30 volumes: - name: data emptyDir: {} - name: config configMap: name: redis-conf items: - key: redis.conf path: redis.conf [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]# kubectl apply -f daemonset.yaml daemonset.apps/redis-app created [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]#查看[root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]# kubectl get pod NAME READY STATUS RESTARTS AGE ingress-demo-app-694bf5d965-8rh7f 1/1 Running 0 130m ingress-demo-app-694bf5d965-swkpb 1/1 Running 0 130m nfs-client-provisioner-dc5789f74-5bznq 1/1 Running 0 114m redis-app-86g4q 1/1 Running 0 28s redis-app-rt92n 1/1 Running 0 28s redis-app-vkzft 1/1 Running 0 28s web-0 1/1 Running 0 64m web-1 1/1 Running 0 63m web-2 1/1 Running 0 63m [root@k8s-master-node1 ~/yaml/test]# kubectl get daemonsets.apps NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE redis-app 3 3 3 3 3 <none> 38s [root@k8s-master-node1 ~/yaml/test]#Linux运维交流社区Linux运维交流社区,互联网新闻以及技术交流。62篇原创内容公众号 https://blog.csdn.net/qq_33921750https://my.oschina.net/u/3981543https://www.zhihu.com/people/chen-bu-yun-2https://segmentfault.com/u/hppyvyv6/articleshttps://juejin.cn/user/3315782802482007https://space.bilibili.com/352476552/articlehttps://cloud.tencent.com/developer/column/93230知乎、CSDN、开源中国、思否、掘金、哔哩哔哩、腾讯云本文使用 文章同步助手 同步
2021年12月30日
832 阅读
0 评论
0 点赞
2021-12-30
kubernetes核心实战(七)--- job、CronJob、Secret
10、job任务使用perl,做pi的圆周率计算[root@k8s-master-node1 ~/yaml/test]# vim job.yaml [root@k8s-master-node1 ~/yaml/test]# cat job.yaml apiVersion: batch/v1 kind: Job metadata: name: pi spec: template: spec: containers: - name: pi image: perl command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] restartPolicy: Never backoffLimit: 4 [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]# kubectl apply -f job.yaml job.batch/pi created [root@k8s-master-node1 ~/yaml/test]#查看任务[root@k8s-master-node1 ~/yaml/test]# kubectl get pod NAME READY STATUS RESTARTS AGE ingress-demo-app-694bf5d965-8rh7f 1/1 Running 0 134m ingress-demo-app-694bf5d965-swkpb 1/1 Running 0 134m nfs-client-provisioner-dc5789f74-5bznq 1/1 Running 0 118m pi--1-k5cbq 0/1 Completed 0 115s redis-app-86g4q 1/1 Running 0 4m14s redis-app-rt92n 1/1 Running 0 4m14s redis-app-vkzft 1/1 Running 0 4m14s web-0 1/1 Running 0 67m web-1 1/1 Running 0 67m web-2 1/1 Running 0 67m [root@k8s-master-node1 ~/yaml/test]# kubectl get job NAME COMPLETIONS DURATION AGE pi 1/1 84s 2m [root@k8s-master-node1 ~/yaml/test]#查看计算结果[root@k8s-master-node1 ~/yaml/test]# kubectl logs pi--1-k5cbq 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632788659361533818279682303019520353018529689957736225994138912497217752834791315155748572424541506959508295331168617278558890750983817546374649393192550604009277016711390098488240128583616035637076601047101819429555961989467678374494482553797747268471040475346462080466842590694912933136770289891521047521620569660240580381501935112533824300355876402474964732639141992726042699227967823547816360093417216412199245863150302861829745557067498385054945885869269956909272107975093029553211653449872027559602364806654991198818347977535663698074265425278625518184175746728909777727938000816470600161452491921732172147723501414419735685481613611573525521334757418494684385233239073941433345477624168625189835694855620992192221842725502542568876717904946016534668049886272327917860857843838279679766814541009538837863609506800642251252051173929848960841284886269456042419652850222106611863067442786220391949450471237137869609563643719172874677646575739624138908658326459958133904780275901[root@k8s-master-node1 ~/yaml/test]#11、CronJobCronJobs 对于创建周期性的、反复重复的任务很有用,例如执行数据备份或者发送邮件。CronJobs 也可以用来计划在指定时间来执行的独立任务,例如计划当集群看起来很空闲时 执行某个 Job。创建任务[root@k8s-master-node1 ~/yaml/test]# vim cronjob.yaml [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]# cat cronjob.yaml apiVersion: batch/v1beta1 kind: CronJob metadata: name: hello spec: schedule: "*/1 * * * *" jobTemplate: spec: template: spec: containers: - name: hello image: busybox args: - /bin/sh - -c - date; echo Hello from the Kubernetes cluster restartPolicy: OnFailure [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]# kubectl apply -f cronjob.yaml Warning: batch/v1beta1 CronJob is deprecated in v1.21+, unavailable in v1.25+; use batch/v1 CronJob cronjob.batch/hello created [root@k8s-master-node1 ~/yaml/test]# kubectl get cronjobs.batch NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE hello */1 * * * * False 0 <none> 21s [root@k8s-master-node1 ~/yaml/test]# [root@k8s-master-node1 ~/yaml/test]#查看结果[root@k8s-master-node1 ~/yaml/test]# kubectl logs hello-27285668--1-zqg92 Wed Nov 17 09:08:18 UTC 2021 Hello from the Kubernetes cluster [root@k8s-master-node1 ~/yaml/test]#12、SecretSecret 对象类型用来保存敏感信息,例如密码、OAuth 令牌和 SSH 密钥。将这些信息放在 secret 中比放在 Pod 的定义或者 容器镜像 中来说更加安全和灵活。kubectl create secret docker-registry regcred \ --docker-server=<你的镜像仓库服务器> \ --docker-username=<你的用户名> \ --docker-password=<你的密码> \ --docker-email=<你的邮箱地址>apiVersion: v1 kind: Pod metadata: name: private-nginx spec: containers: - name: private-nginx image: chenbuyun/my-app:v1.0 imagePullSecrets: - name: regcred https://blog.csdn.net/qq_33921750https://my.oschina.net/u/3981543https://www.zhihu.com/people/chen-bu-yun-2https://segmentfault.com/u/hppyvyv6/articleshttps://juejin.cn/user/3315782802482007https://space.bilibili.com/352476552/articlehttps://cloud.tencent.com/developer/column/93230知乎、CSDN、开源中国、思否、掘金、哔哩哔哩、腾讯云本文使用 文章同步助手 同步
2021年12月30日
792 阅读
0 评论
0 点赞
2021-12-30
Kubernetes基础概念
Kubernetes基础概念kubernetes特性:- 服务发现和负载均衡Kubernetes 可以使用 DNS 名称或自己的 IP 地址公开容器,如果进入容器的流量很大, Kubernetes 可以负载均衡并分配网络流量,从而使部署稳定。- 存储编排Kubernetes 允许你自动挂载你选择的存储系统,例如本地存储、公共云提供商等。- 自动部署和回滚你可以使用 Kubernetes 描述已部署容器的所需状态,它可以以受控的速率将实际状态 更改为期望状态。例如,你可以自动化 Kubernetes 来为你的部署创建新容器, 删除现有容器并将它们的所有资源用于新容器。- 自动完成装箱计算Kubernetes 允许你指定每个容器所需 CPU 和内存(RAM)。当容器指定了资源请求时,Kubernetes 可以做出更好的决策来管理容器的资源。- 自我修复Kubernetes 重新启动失败的容器、替换容器、杀死不响应用户定义的 运行状况检查的容器,并且在准备好服务之前不将其通告给客户端。- 密钥与配置管理Kubernetes 允许你存储和管理敏感信息,例如密码、OAuth 令牌和 ssh 密钥。你可以在不重建容器镜像的情况下部署和更新密钥和应用程序配置,也无需在堆栈配置中暴露密钥。Kubernetes 为你提供了一个可弹性运行分布式系统的框架。Kubernetes 会满足你的扩展要求、故障转移、部署模式等。例如,Kubernetes 可以轻松管理系统的 Canary 部署。kubernetes组件结构与介绍1、控制平面组件(Control Plane Components)控制平面的组件对集群做出全局决策(比如调度),以及检测和响应集群事件(例如,当不满足部署的 replicas 字段时,启动新的 pod)。控制平面组件可以在集群中的任何节点上运行。然而,为了简单起见,设置脚本通常会在同一个计算机上启动所有控制平面组件, 并且不会在此计算机上运行用户容器。请参阅使用 kubeadm 构建高可用性集群 中关于多 VM 控制平面设置的示例。kube-apiserverAPI 服务器是 Kubernetes 控制面的组件, 该组件公开了 Kubernetes API。API 服务器是 Kubernetes 控制面的前端。Kubernetes API 服务器的主要实现是 kube-apiserver。kube-apiserver 设计上考虑了水平伸缩,也就是说,它可通过部署多个实例进行伸缩。你可以运行 kube-apiserver 的多个实例,并在这些实例之间平衡流量。etcdetcd 是兼具一致性和高可用性的键值数据库,可以作为保存 Kubernetes 所有集群数据的后台数据库。您的 Kubernetes 集群的 etcd 数据库通常需要有个备份计划。要了解 etcd 更深层次的信息,请参考 etcd 文档。kube-scheduler控制平面组件,负责监视新创建的、未指定运行节点(node)的 Pods,选择节点让 Pod 在上面运行。调度决策考虑的因素包括单个 Pod 和 Pod 集合的资源需求、硬件/软件/策略约束、亲和性和反亲和性规范、数据位置、工作负载间的干扰和最后时限。kube-controller-manager在主节点上运行 控制器 的组件。从逻辑上讲,每个控制器都是一个单独的进程, 但是为了降低复杂性,它们都被编译到同一个可执行文件,并在一个进程中运行。这些控制器包括:● 节点控制器(Node Controller): 负责在节点出现故障时进行通知和响应● 任务控制器(Job controller): 监测代表一次性任务的 Job 对象,然后创建 Pods 来运行这些任务直至完成● 端点控制器(Endpoints Controller): 填充端点(Endpoints)对象(即加入 Service 与 Pod)● 服务帐户和令牌控制器(Service Account & Token Controllers): 为新的命名空间创建默认帐户和 API 访问令牌cloud-controller-manager云控制器管理器是指嵌入特定云的控制逻辑的 控制平面组件。云控制器管理器允许您链接集群到云提供商的应用编程接口中, 并把和该云平台交互的组件与只和您的集群交互的组件分离开。cloud-controller-manager 仅运行特定于云平台的控制回路。如果你在自己的环境中运行 Kubernetes,或者在本地计算机中运行学习环境, 所部署的环境中不需要云控制器管理器。与 kube-controller-manager 类似,cloud-controller-manager 将若干逻辑上独立的 控制回路组合到同一个可执行文件中,供你以同一进程的方式运行。你可以对其执行水平扩容(运行不止一个副本)以提升性能或者增强容错能力。下面的控制器都包含对云平台驱动的依赖:● 节点控制器(Node Controller): 用于在节点终止响应后检查云提供商以确定节点是否已被删除● 路由控制器(Route Controller): 用于在底层云基础架构中设置路由● 服务控制器(Service Controller): 用于创建、更新和删除云提供商负载均衡器2、Node 组件节点组件在每个节点上运行,维护运行的 Pod 并提供 Kubernetes 运行环境。kubelet一个在集群中每个节点(node)上运行的代理。它保证容器(containers)都 运行在 Pod 中。kubelet 接收一组通过各类机制提供给它的 PodSpecs,确保这些 PodSpecs 中描述的容器处于运行状态且健康。kubelet 不会管理不是由 Kubernetes 创建的容器。kube-proxykube-proxy 是集群中每个节点上运行的网络代理, 实现 Kubernetes 服务(Service) 概念的一部分。kube-proxy 维护节点上的网络规则。这些网络规则允许从集群内部或外部的网络会话与 Pod 进行网络通信。如果操作系统提供了数据包过滤层并可用的话,kube-proxy 会通过它来实现网络规则。否则, kube-proxy 仅转发流量本身。3、集群安装使用脚本一键部署:https://github.com/lework/kainstallroot@hello:~# wget https://cdn.jsdelivr.net/gh/lework/kainstall@master/kainstall-ubuntu.sh --2021-11-17 02:56:26-- https://cdn.jsdelivr.net/gh/lework/kainstall@master/kainstall-ubuntu.sh Resolving cdn.jsdelivr.net (cdn.jsdelivr.net)... 117.12.41.16, 2408:8726:7000:5::10 Connecting to cdn.jsdelivr.net (cdn.jsdelivr.net)|117.12.41.16|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 128359 (125K) [application/x-sh] Saving to: ‘kainstall-ubuntu.sh’ kainstall-ubuntu.sh 100%[========================================================================>] 125.35K --.-KB/s in 0.006s 2021-11-17 02:56:26 (19.2 MB/s) - ‘kainstall-ubuntu.sh’ saved [128359/128359] root@hello:~# root@hello:~# chmod +x kainstall-ubuntu.sh root@hello:~# root@hello:~# kainstall-ubuntu.sh init \ > --master 192.168.1.100,192.168.1.101,192.168.1.102 \ > --worker 192.168.1.103,192.168.1.104,192.168.1.105,192.168.1.106 \ > --user root \ > --password 123456 \ > --version 1.20.6可参考:kubeadm 手动安装高可用:https://blog.csdn.net/qq_33921750/article/details/110298506kubeadm 手动安装单master集群:https://blog.csdn.net/qq_33921750/article/details/1036135994、部署dashboard参考:https://blog.csdn.net/qq_33921750/article/details/1210267995、命令自动补全(可选)参考:https://blog.csdn.net/qq_33921750/article/details/121173706Linux运维交流社区Linux运维交流社区,互联网新闻以及技术交流。55篇原创内容公众号 https://blog.csdn.net/qq_33921750https://my.oschina.net/u/3981543https://www.zhihu.com/people/chen-bu-yun-2https://segmentfault.com/u/hppyvyv6/articleshttps://juejin.cn/user/3315782802482007https://space.bilibili.com/352476552/articlehttps://cloud.tencent.com/developer/column/93230知乎、CSDN、开源中国、思否、掘金、哔哩哔哩、腾讯云本文使用 文章同步助手 同步
2021年12月30日
588 阅读
0 评论
0 点赞
2021-12-30
kubernetes核心实战(一)--- namespace
kubernetes核心实战1、资源创建方式命令行创建yaml文件创建2、namespace命名空间(namespace)是Kubernetes提供的组织机制,用于给集群中的任何对象组进行分类、筛选和管理。每一个添加到Kubernetes集群的工作负载必须放在一个命名空间中。命名空间为集群中的对象名称赋予作用域。虽然在命名空间中名称必须是唯一的,但是相同的名称可以在不同的命名空间中使用。这对于某些场景来说可能帮助很大。例如,如果使用命名空间来划分应用程序生命周期环境(如开发、staging、生产),则可以在每个环境中维护利用同样的名称维护相同对象的副本。命名空间还可以让用户轻松地将策略应用到集群的具体部分。你可以通过定义ResourceQuota对象来控制资源的使用,该对象在每个命名空间的基础上设置了使用资源的限制。类似地,当在集群上使用支持网络策略的CNI(容器网络接口)时,比如Calico或Canal(calico用于策略,flannel用于网络)。你可以将NetworkPolicy应用到命名空间,其中的规则定义了pod之间如何彼此通信。不同的命名空间可以有不同的策略。使用命名空间最大的好处之一是能够利用Kubernetes RBAC(基于角色的访问控制)。RBAC允许您在单个名称下开发角色,这样将权限或功能列表分组。ClusterRole对象用于定义集群规模的使用模式,而角色对象类型(Role object type)应用于具体的命名空间,从而提供更好的控制和粒度。在角色创建后,RoleBinding可以将定义的功能授予单个命名空间上下文中的具体具体用户或用户组。通过这种方式,命名空间可以使得集群操作者能够将相同的策略映射到组织好的资源集合。将命名空间映射到团队或项目上使用命名空间对生命周期环境进行分区使用命名空间隔离不同的使用者[root@k8s-master-node1 ~]# kubectl create namespace cby namespace/cby created [root@k8s-master-node1 ~]# [root@k8s-master-node1 ~]# kubectl get namespaces NAME STATUS AGE cby Active 2s default Active 21h ingress-nginx Active 21h kube-node-lease Active 21h kube-public Active 21h kube-system Active 21h kubernetes-dashboard Active 21h [root@k8s-master-node1 ~]# [root@k8s-master-node1 ~]# kubectl delete namespace cby namespace "cby" deleted [root@k8s-master-node1 ~]# [root@k8s-master-node1 ~]# [root@k8s-master-node1 ~]# kubectl get namespaces NAME STATUS AGE default Active 21h ingress-nginx Active 21h kube-node-lease Active 21h kube-public Active 21h kube-system Active 21h kubernetes-dashboard Active 21h [root@k8s-master-node1 ~]#查看yaml格式[root@k8s-master-node1 ~]# kubectl create namespace cby namespace/cby created [root@k8s-master-node1 ~]# [root@k8s-master-node1 ~]# kubectl get namespaces cby -o yaml apiVersion: v1 kind: Namespace metadata: creationTimestamp: "2021-11-17T03:08:10Z" labels: kubernetes.io/metadata.name: cby name: cby resourceVersion: "311903" uid: 63f2e47d-a2a5-4a67-8fd2-7ca29bfb02be spec: finalizers: - kubernetes status: phase: Active  **Linux运维交流社区** Linux运维交流社区,互联网新闻以及技术交流。 57篇原创内容 公众号  https://blog.csdn.net/qq_33921750 https://my.oschina.net/u/3981543 https://www.zhihu.com/people/chen-bu-yun-2 https://segmentfault.com/u/hppyvyv6/articles https://juejin.cn/user/3315782802482007 https://space.bilibili.com/352476552/article https://cloud.tencent.com/developer/column/93230 知乎、CSDN、开源中国、思否、掘金、哔哩哔哩、腾讯云
2021年12月30日
365 阅读
0 评论
0 点赞
2021-12-30
在 Linux 上以 All-in-One 模式安装 KubeSphere
在 Linux 上以 All-in-One 模式安装 KubeSphereInstall KubeSphere in All-in-One mode on Linux背景KubeSphere 是在Kubernetes 之上构建的面向云原生应用的分布式操作系统,完全开源,支持多云与多集群管理,提供全栈的IT 自动化运维能力,简化公司的DevOps 工作流。... 作为全栈的多租户容器平台,KubeSphere 提供了运维友好的向导式操作界面,帮助公司快速构建一个强大和功能丰富的容器云平台。KubeSphere is a distributed operating system for cloud-native applications built on Kubernetes. It is fully open source, supports multi-cloud and multi-cluster management, provides full-stack IT automated operation and maintenance capabilities, and simplifies the company's DevOps workflow. ... As a full-stack multi-tenant container platform, KubeSphere provides an operation and maintenance-friendly guided operation interface to help the company quickly build a powerful and feature-rich container cloud platform.一、安装 dockerOne, install dockerroot@hello:~# curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun ----略---- root@hello:~# docker -v Docker version 20.10.9, build c2ea9bc root@hello:~#二,下载安装 KubeKeySecond, download and install KubeKey从源代码生成二进制文件Generate binary files from source coderoot@hello:~# git clone https://github.com/kubesphere/kubekey.git Cloning into 'kubekey'... remote: Enumerating objects: 13438, done. remote: Counting objects: 100% (899/899), done. remote: Compressing objects: 100% (238/238), done. remote: Total 13438 (delta 745), reused 662 (delta 661), pack-reused 12539 Receiving objects: 100% (13438/13438), 34.95 MiB | 10.14 MiB/s, done. Resolving deltas: 100% (5424/5424), done. root@hello:~# root@hello:~# cd kubekey root@hello:~/kubekey# root@hello:~/kubekey# root@hello:~/kubekey# ./build.sh -p ----略----注意:Notice:在构建之前,需要先安装 Docker。如果无法访问 https://proxy.golang.org/,比如在墙内,请执行 build.sh -p。Before building, you need to install Docker.If you cannot access https://proxy.golang.org/, such as inside a firewall, please execute build.sh -p.三、 安装所需工具Three, Tools required for installationroot@hello:~# apt install sudo -y root@hello:~# apt install curl -y root@hello:~# apt install openssl -y root@hello:~# apt install ebtables -y root@hello:~# apt install socat -y root@hello:~# apt install ipset -y root@hello:~# apt install conntrack -y root@hello:~# apt install nfs-common -y四、创建集群Fourth, create a cluster同时安装 Kubernetes 和 KubeSphereInstall Kubernetes and KubeSphere at the same timeroot@hello:~# export KKZONE=cn root@hello:~# /root/kubekey/output/kk create cluster --with-kubernetes v1.20.4 --with-kubesphere v3.1.1 +-------+------+------+---------+----------+-------+-------+-----------+---------+------------+-------------+------------------+--------------+ | name | sudo | curl | openssl | ebtables | socat | ipset | conntrack | docker | nfs client | ceph client | glusterfs client | time | +-------+------+------+---------+----------+-------+-------+-----------+---------+------------+-------------+------------------+--------------+ | hello | y | y | y | y | y | y | y | 20.10.9 | y | | | UTC 02:50:57 | +-------+------+------+---------+----------+-------+-------+-----------+---------+------------+-------------+------------------+--------------+ This is a simple check of your environment. Before installation, you should ensure that your machines meet all requirements specified at https://github.com/kubesphere/kubekey#requirements-and-recommendations Continue this installation? [yes/no]: yes INFO[02:51:00 UTC] Downloading Installation Files INFO[02:51:00 UTC] Downloading kubeadm ... ----略----五、验证安装结果Five, verify the installation resultsroot@hello:~# kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f ----略---- ##################################################### ### Welcome to KubeSphere! ### ##################################################### Console: http://192.168.1.20:30880 Account: admin Password: P@88w0rd NOTES: 1. After you log into the console, please check the monitoring status of service components in "Cluster Management". If any service is not ready, please wait patiently until all components are up and running. 2. Please change the default password after login. ##################################################### https://kubesphere.io 2021-10-11 03:04:53 #####################################################注意:Notice:输出信息会显示 Web 控制台的 IP 地址和端口号,默认的 NodePort 是 30880。现在,您可以使用默认的帐户和密码 (admin/P@88w0rd) 通过 <NodeIP>:30880 访问控制台The output information will display the IP address and port number of the Web console. The default NodePort is 30880. Now you can use the default account and password (admin/P@88w0rd) to access the console via <NodeIP>:30880Linux运维交流社区Linux运维交流社区,互联网新闻以及技术交流。39篇原创内容公众号本文使用 文章同步助手 同步
2021年12月30日
836 阅读
0 评论
0 点赞
1
...
32
33
34
...
43