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

95、k8s之rancher可视化

一、ranker 图形化界面

图形化界面进行k8s集群的管理

rancher自带监控----普罗米修斯

在这里插入图片描述

[root@master01 opt]# docker load -i rancher.tar   ##所有节点
[root@master01 opt]# docker pull rancher/rancher:v2.5.7      ##主节点[root@master01 opt]# vim /etc/docker/daemon.json {"registry-mirrors": ["https://hub-mirror.c.163.com","https://docker.m.daocloud.io","https://ghcr.io","https://mirror.baidubce.com","https://docker.nju.edu.cn","https://hub.littlediary.cn/","https://dockerproxy.cn"],"exec-opts": ["native.cgroupdriver=systemd"],"log-driver": "json-file","log-opts": {"max-size": "100m"}
}
~   
[root@master01 opt]# systemctl daemon-reload 
[root@master01 opt]# systemctl restart docker
[root@master01 opt]# docker pull rancher/rancher:v2.5.7
[root@master01 opt]# docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged --name rancher rancher/rancher:v2.5.7
95247bfb683e8008b249d237603ef520527b2ec00cc261b6d2ebfc6e51321207

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

[root@master01 opt]# curl --insecure -sfL https://192.168.168.81/v3/import/6pmp9w44gs678l24ln45r84frtcs2pl7txl6hcz57cqlclstlpsx6s_c-2bhzq.yaml | kubectl apply -f -
error: no objects passed to apply
[root@master01 opt]# curl --insecure -sfL https://192.168.168.81/v3/import/6pmp9w44gs678l24ln45r84frtcs2pl7txl6hcz57cqlclstlpsx6s_c-2bhzq.yaml | kubectl apply -f -
clusterrole.rbac.authorization.k8s.io/proxy-clusterrole-kubeapiserver created
clusterrolebinding.rbac.authorization.k8s.io/proxy-role-binding-kubernetes-master created
namespace/cattle-system created
serviceaccount/cattle created
clusterrolebinding.rbac.authorization.k8s.io/cattle-admin-binding created
secret/cattle-credentials-4134134 created
clusterrole.rbac.authorization.k8s.io/cattle-admin created
deployment.apps/cattle-cluster-agent created
[root@master01 opt]# kubectl get ns
NAME              STATUS   AGE
cattle-system     Active   119s
default           Active   18d
ingress-nginx     Active   41h
kube-node-lease   Active   18d
kube-public       Active   18d
kube-system       Active   18d
lucky-cloud       Active   22h
xy102             Active   47h
[root@master01 opt]# kubectl get pod -n cattle-system 
NAME                                  READY   STATUS    RESTARTS   AGE
cattle-cluster-agent-cf684455-bd8bs   1/1     Running   0          2m36s

在这里插入图片描述

在这里插入图片描述

nfs进行挂载----hostPath

在这里插入图片描述

1、声明挂载卷

在这里插入图片描述

2、健康检查

在这里插入图片描述

3、调度策略

在这里插入图片描述

4、扩缩容以及升级策略

在这里插入图片描述

5、

在这里插入图片描述

调度

在这里插入图片描述

在这里插入图片描述

Last login: Sat Sep 14 08:55:59 2024 from 192.168.168.168
[root@master01 ~]# kubectl get pod
NAME                        READY   STATUS    RESTARTS   AGE
hpa-test2-0                 1/1     Running   16         2d
nfs1-76f66b958-68wpl        1/1     Running   12         8d
test1-11-785f6847f9-mtdnw   1/1     Running   0          3m49s
[root@master01 ~]# kubectl get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   18d

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

[root@master01 ~]# kubectl get svc
NAME         TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
kubernetes   ClusterIP   10.96.0.1      <none>        443/TCP        18d
nginx1-11    NodePort    10.96.48.229   <none>        80:31000/TCP   41s

在这里插入图片描述

访问(http://192.168.168.81:31000/)

[root@k8s5 k8s]# rm -rf *
[root@k8s5 k8s]# ls
[root@k8s5 k8s]# echo 123 > index.html
[root@k8s5 k8s]# 

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

[root@master01 k8s-yaml]# kubectl get pod -n cattle-prometheus 
NAME                                                       READY   STATUS                  RESTARTS   AGE
exporter-kube-state-cluster-monitoring-79c667fdc9-ds9jr    0/1     ErrImagePull            0          5m13s
exporter-node-cluster-monitoring-2xrgh                     0/1     ImagePullBackOff        0          5m13s
exporter-node-cluster-monitoring-8knvz                     1/1     Running                 0          5m13s
exporter-node-cluster-monitoring-92rkf                     0/1     ImagePullBackOff        0          5m13s
grafana-cluster-monitoring-575d64fcf-2c4xg                 0/2     Init:ImagePullBackOff   0          5m13s
operator-init-cluster-monitoring-2pv7x                     0/1     ContainerCreating       0          5m13s
operator-init-monitoring-operator-tw9zm                    0/1     ImagePullBackOff        0          5m15s
prometheus-operator-monitoring-operator-6dd84ddd49-b9scc   0/1     ImagePullBackOff        0          5m15s
[root@master01 k8s-yaml]# kubectl describe pod -n cattle-prometheus exporter-node-cluster-monitoring-92rkf 
##查看镜像拉不下来的原因,注意在哪一个节点,然后去节点上拉取[root@node01 ~]# vim /etc/docker/daemon.json {"registry-mirrors": ["https://hub-mirror.c.163.com","https://docker.m.daocloud.io","https://ghcr.io","https://mirror.baidubce.com","https://docker.nju.edu.cn""https://hub.littlediary.cn/","https://dockerproxy.cn"],"exec-opts": ["native.cgroupdriver=systemd"],"log-driver": "json-file","log-opts": {"max-size": "100m"}
}
[root@node01 ~]# systemctl daemon-reload
[root@node01 ~]# systemctl restart docker[root@node01 ~]# docker pull rancher/prom-node-exporter:v1.0.1
v1.0.1: Pulling from rancher/prom-node-exporter
86fa074c6765: Pull complete 
ed1cd1c6cd7a: Pull complete 
ff1bb132ce7b: Pull complete 
Digest: sha256:ae4d849cc4b14c15dcd7dc47621b577ae14767444ed62add3fe0d9b3b9e032f8
Status: Downloaded newer image for rancher/prom-node-exporter:v1.0.1
docker.io/rancher/prom-node-exporter:v1.0.1[root@master01 k8s-yaml]# kubectl get pod -n cattle-prometheus 
NAME                                                       READY   STATUS                  RESTARTS   AGE
exporter-kube-state-cluster-monitoring-79c667fdc9-ds9jr    0/1     ImagePullBackOff        0          6m21s
exporter-node-cluster-monitoring-2xrgh                     0/1     ImagePullBackOff        0          6m21s
exporter-node-cluster-monitoring-8knvz                     1/1     Running                 0          6m21s
exporter-node-cluster-monitoring-92rkf                     0/1     ImagePullBackOff        0          6m21s
grafana-cluster-monitoring-575d64fcf-2c4xg                 0/2     Init:ImagePullBackOff   0          6m21s
operator-init-cluster-monitoring-xgsn9                     1/1     Running                 0          46s[root@master01 opt]# kubectl describe pod -n cattle-prometheus operator-init-monitoring-operator-tw9zm 
Name:         operator-init-monitoring-operator-tw9zm
Namespace:    cattle-prometheus
Priority:     0
Node:         node01/192.168.168.82[root@node01 ~]# docker pull rancher/istio-kubectl:1.5.10[root@master01 k8s-yaml]# kubectl describe pod -n cattle-prometheus grafana-cluster-monitoring-575d64fcf-2c4xg [root@node01 ~]# docker pull rancher/grafana-grafana:7.1.5[root@master01 opt]# kubectl describe pod -n cattle-prometheus exporter-node-cluster-monitoring-2xrgh 
Name:         exporter-node-cluster-monitoring-2xrgh
Namespace:    cattle-prometheus
Priority:     0
Node:         node02/192.168.168.83[root@node02 ~]# docker pull rancher/prom-node-exporter:v1.0.1[root@node02 ~]# vim /etc/docker/daemon.json{"registry-mirrors": ["https://hub-mirror.c.163.com","https://docker.m.daocloud.io","https://ghcr.io","https://mirror.baidubce.com","https://docker.nju.edu.cn","https://hub.littlediary.cn/","https://dockerproxy.cn"],"exec-opts": ["native.cgroupdriver=systemd"],"log-driver": "json-file","log-opts": {"max-size": "100m"}
}[root@node02 ~]# systemctl daemon-reload
[root@node02 ~]# systemctl restart docker
[root@node02 ~]# docker pull rancher/prom-node-exporter:v1.0.1[root@master01 opt]# kubectl get pod -n cattle-prometheus
NAME                                                       READY   STATUS    RESTARTS   AGE
exporter-kube-state-cluster-monitoring-79c667fdc9-ds9jr    1/1     Running   0          49m
exporter-node-cluster-monitoring-2xrgh                     1/1     Running   0          49m
exporter-node-cluster-monitoring-8knvz                     1/1     Running   0          49m
exporter-node-cluster-monitoring-92rkf                     1/1     Running   0          49m
grafana-cluster-monitoring-575d64fcf-2c4xg                 2/2     Running   0          49m
prometheus-cluster-monitoring-0                            5/5     Running   1          33m
prometheus-operator-monitoring-operator-6dd84ddd49-b9scc   1/1     Running   0          49m

在这里插入图片描述

在这里插入图片描述

http://www.lryc.cn/news/443108.html

相关文章:

  • 简单生活的快乐
  • 【JAVA开源】基于Vue和SpringBoot的在线文档管理系统
  • 大数据新视界 --大数据大厂之数据驱动决策:如何利用大数据提升企业竞争力
  • 【Linux】生产者消费者模型:基于阻塞队列,使用互斥锁和条件变量维护互斥与同步关系
  • 多层感知机paddle
  • linux-网络管理-网络服务管理 17 / 100
  • Docker上安装mysql
  • 【秋招笔试-支持在线评测】8.28华为秋招(已改编)-三语言题解
  • 基于python上门维修预约服务数据分析系统
  • React基础教程(10):React Hooks
  • JVM 调优篇9 调优案例6- cpu使用过载解决办法【超赞】
  • Spring8-事务
  • 在Python中,类是用于定义对象的蓝图或模板,而对象则是根据类创建的具体实例
  • 【小波去噪】【matlab】基于小波分析的一维信号滤波(对照组:中值滤波、均值滤波、高斯滤波)
  • CentOS 7官方源停服,配置本机光盘yum源
  • 2024年汉字小达人区级自由报名备考冲刺:2024官方模拟题练一练(续)
  • 实战Redis与MySQL双写一致性的缓存模式
  • KVM环境下制作ubuntu qcow2格式镜像
  • 基于SpringBoot+Vue的高校竞赛管理系统
  • PHP发邮件教程:配置SMTP服务器发送邮件?
  • SpringBootWeb增删改查入门案例
  • pytorch实现RNN网络
  • 智能工厂的软件设计 “程序program”表达式,即 接口模型的代理模式表达式
  • leetcode 难度【简单模式】标签【数据库】题型整理大全
  • 利士策分享,自我和解:通往赚钱与内心富足的和谐之道
  • 【物联网】深入解析时序数据库TDengine及其Java应用实践
  • 2023北华大学程序设计新生赛部分题解
  • PPP的配置
  • 回溯算法总结篇
  • 机器学习-点击率预估-论文速读-20240916