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

(二十六)、Kuboard 部署网络问题 k8s 使用本地镜像 k8s使用 register本地镜像站 综合应用

Kuboard 部署网络问题&k8s 使用本地镜像&k8s使用 register本地镜像站

文章目录

  • 1、k8s 命令
  • 2、拉取指定tag:版本镜像
    • 2.1、查看本地镜像
  • 3、删除本地镜像
  • 4、本地对镜像进行重命名(docker tag)
  • 5、本地拉取局域网镜像站
  • 6、k8s(minikube场景) 直接可以引用本地镜像
  • 7、执行 kubectl apply -f kuboard-k8s.yaml
  • 8、如果使用官方镜像站,只要保证本地有对应名字和版本号即可
  • 9、查看部署情况
  • 10、查看 kuboard 运行情况
  • 11、设计端口映射访问
  • 12、访问 http://127.0.0.1:63366/dashboard

register 如果只是 ip 的话,k8s 中是由于必须使用 https 导致没有办法,因此可以采取先手动把镜像下载到k8s 所在的机器的 docker 本地镜像中,通过 eval $(minikube docker-env) 命令之后,执行

1、k8s 命令

删除 namespace
kubectl delete namespace kuboard
新建 namespace
kubectl create namespace kuboard

2、拉取指定tag:版本镜像

国内
docker pull swr.cn-east-2.myhuaweicloud.com/kuboard/kuboard:v3
VPN不稳定
docker pull kuboard/kuboard:v3

2.1、查看本地镜像

docker images

3、删除本地镜像

docker rmi <镜像ID或镜像名称:标签>

4、本地对镜像进行重命名(docker tag)

docker tag mynginx:latest DiyTag:DiyVersion

5、本地拉取局域网镜像站

192.168.0.116:5001 为局域网镜像站 ip:端口,mynginx:latest 是对应tag 和版本
docker pull 192.168.0.116:5001/mynginx:latest
在这里插入图片描述

6、k8s(minikube场景) 直接可以引用本地镜像

从查询顺序来说,k8s 会优先从本地找,下面的命令可以让 minukube 中的 k8s 直接识别docker本地的镜像

eval $(minikube docker-env)

7、执行 kubectl apply -f kuboard-k8s.yaml

此时执行,yaml 就会优先从本地寻找对应 tag和版本的镜像了
注意俩参数
namespace: kuboard
image: eipwork/kuboard:latest

apiVersion: apps/v1
kind: Deployment
metadata:name: kuboardnamespace: kuboardlabels:k8s.kuboard.cn/name: kuboardk8s.kuboard.cn/layer: monitor
spec:replicas: 1selector:matchLabels:k8s.kuboard.cn/name: kuboardk8s.kuboard.cn/layer: monitortemplate:metadata:labels:k8s.kuboard.cn/name: kuboardk8s.kuboard.cn/layer: monitorspec:containers:- name: kuboardimage: eipwork/kuboard:latestimagePullPolicy: IfNotPresentports:- containerPort: 80resources:limits:cpu: 500mmemory: 512Mirequests:cpu: 100mmemory: 128Mitolerations:- key: node-role.kubernetes.io/masteroperator: Existseffect: NoSchedule
---
apiVersion: v1
kind: Service
metadata:name: kuboardnamespace: kuboard
spec:type: NodePortports:- name: httpport: 80targetPort: 80#nodePort: 32567selector:k8s.kuboard.cn/name: kuboardk8s.kuboard.cn/layer: monitor

8、如果使用官方镜像站,只要保证本地有对应名字和版本号即可

kubectl apply -f https://kuboard.cn/install-script/kuboard.yaml
eipwork/kuboard:latest

9、查看部署情况

kubectl get pods -n kuboard

10、查看 kuboard 运行情况

➜ Kuboard git:(master) ✗ kubectl get svc -n kuboard
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kuboard NodePort 10.110.101.148 80:31623/TCP 2m4s

11、设计端口映射访问

➜ Kuboard git:(master) ✗ minikube service kuboard -n kuboard
┌───── ┬──── ┬────── ┬───────────── ┐
│ NAMESPACE │ NAME │ TARGET PORT │ URL │
├───── ┼──── ┼────── ┼───────────── ┤
│ kuboard │ kuboard │ http/80 │ http://192.168.49.2:31623 │
└───── ┴──── ┴────── ┴───────────── ┘
🏃 为服务 kuboard 启动隧道。/┌───── ┬──── ┬────── ┬────────────┐
│ NAMESPACE │ NAME │ TARGET PORT │ URL │
├───── ┼──── ┼────── ┼────────────┤
│ kuboard │ kuboard │ │ http://127.0.0.1:63366 │
└───── ┴──── ┴────── ┴────────────┘
🏃 为服务 kuboard 启动隧道。
🎉 正通过默认浏览器打开服务 kuboard/kuboard…
❗ 因为你正在使用 darwin 上的 Docker 驱动程序,所以需要打开终端才能运行它。

12、访问 http://127.0.0.1:63366/dashboard

获取 token
https://www.kuboard.cn/install/install-dashboard.html#%E8%8E%B7%E5%8F%96token

# 如果您参考 www.kuboard.cn 提供的文档安装 Kuberenetes,可在第一个 Master 节点上执行此命令
echo $(kubectl -n kube-system get secret $(kubectl -n kube-system get secret | grep ^kuboard-user | awk '{print $1}') -o go-template='{{.data.token}}' | base64 -d)
http://www.dtcms.com/a/418753.html

相关文章:

  • 腾讯云上TKE集群中通过clb-ingress公网访问到后端服务
  • 信阳做网站公司编程培训机构加盟怎样
  • vps空间如何做网站备份如何提高网站的搜索
  • 广州免费自助建站开发建设工程什么意思
  • Apache Doris 4.0 AI 能力揭秘(二):为企业级应用而生的 AI 函数设计与实践
  • 用deepseek部署全自动的机器人--bytebot
  • 网站开发者模式下怎么保存图片建设网站空间
  • 兰州新区建站07073游戏网
  • 营销型网站建站教程wordpress edit lock
  • 如何将华为手机的照片转移到电脑
  • 云手机的主要核心是什么
  • 三防手机是什么?有哪些值得购入的三防手机?
  • 网站的文件夹上海网站备案在哪里查询
  • 秋招算法记录 | 排序算法整理 | 直接选择、直接插入、冒泡、快排、希尔排序
  • Docker 容器如何实现隔离
  • ThinkPHP8学习篇(八):数据库(四)
  • 专业商城网站设计制作wordpress用户中心制作
  • 加强住房公积金网站建设搜索推广的优势
  • 【BTC】比特币脚本
  • 人工智能吉他教学研究:基于Liberlive与TemPolor的产品与教学思考[特殊字符]
  • 电脑开机显示屏显示无信号怎么办 原因及解决方法
  • 怎么攻击织梦网站网站发布 图片看不到
  • ROS1 go2 vlp16 局部避障--3 篇
  • 【奇怪的bug】lua的nil不报错
  • 有哪些做短租的网站好浙江省建设厅网站查询
  • 南宁网站建设优势吉林省软环境建设办公室网站
  • 【数据结构】二叉树-图解深度优先搜索(递归法、迭代法)
  • 邯郸企业网站建设报价接收新网站如何做诊断
  • 做体力活的网站上海网站制作公司哪
  • Jenkins运维之路(Jenkins使用Mysql作为信息存储)