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

做一家仓储用地的网站关键词优化 搜索引擎

做一家仓储用地的网站,关键词优化 搜索引擎,定制网站建设公司策划书,用html做网站步骤目录 1 hostPath 卷介绍 2 hostPath 卷实际应用操作 2.1 创建 pod 资源类型 2.2 修改清单文件增加 hostPath 对应的参数配置 2.3 查看是否创建 卷 和 pod 2.4 创建发布文件测试是否正常访问 1 hostPath 卷介绍 EmptyDir中数据不会被持久化,它会随着Pod的结束而销…

目录

1 hostPath 卷介绍

2 hostPath 卷实际应用操作

2.1 创建 pod 资源类型

2.2  修改清单文件增加 hostPath 对应的参数配置

2.3 查看是否创建 卷 和 pod

2.4 创建发布文件测试是否正常访问


1 hostPath 卷介绍

EmptyDir中数据不会被持久化,它会随着Pod的结束而销毁,如果想简单的将数据持久化到主机中,可以选择HostPath。

HostPath就是将Node主机中一个实际目录挂在到Pod中,以供容器使用,这样的设计就可以保证Pod销毁了,但是数据依据可以存在于Node主机上。

2 hostPath 卷实际应用操作

2.1 创建 pod 资源类型

[root@k8s-master volumes]# kubectl run hostpath \
--image nginx:latest --port 80 \
--dry-run=client -o yaml > hostpath.yml

2.2  修改清单文件增加 hostPath 对应的参数配置

[root@k8s-master volumes]# vim hostpath.yml apiVersion: v1
kind: Pod
metadata:labels:run: hostpathname: hostpath
spec:volumes:# 定义一个名为 cache-vol 的 hostPath 卷# hostPath 类型的卷将主机文件系统的指定路径直接挂载到 Pod 中- name: cache-volhostPath:path: /data  # 主机上的路径type: DirectoryOrCreate  # 指定路径类型,如果不存在则创建目录containers:# 容器 nginx-host- image: nginx:latestname: nginx-hostvolumeMounts:# 将 cache-vol 卷挂载到容器内的 /usr/share/nginx/html 路径# 这样容器可以访问主机上的 /data 目录- mountPath: /usr/share/nginx/htmlname: cache-volports:- containerPort: 80  # 容器内部监听的端口关于 spec.volumes.hostPath.type 的值的一点说明:	DirectoryOrCreate 目录存在就使用,不存在就先创建后使用	Directory	目录必须存在	FileOrCreate  文件存在就使用,不存在就先创建后使用	File 文件必须存在	    Socket	unix套接字必须存在	CharDevice	字符设备必须存在	BlockDevice 块设备必须存在

2.3 查看是否创建 卷 和 pod

[root@k8s-master volumes]# kubectl get pods -o wide 
NAME                       READY   STATUS      RESTARTS   AGE     IP            NODE        NOMINATED NODE   READINESS GATES
hostpath                   1/1     Running     0          59s     10.244.2.63   k8s-node2   <none>           <none>
nginx-v1-dbd4bc45b-49hhw   1/1     Running     0          3d18h   10.244.2.54   k8s-node2   <none>           <none>
nginx-v2-bd85b8bc4-nqpv2   1/1     Running     0          3d18h   10.244.1.35   k8s-node1   <none>           <none>
testpod                    0/1     Completed   0          3d5h    10.244.2.58   k8s-node2   <none>           <none>[root@k8s-master volumes]# kubectl describe pod hostpath 
Name:             hostpath
Namespace:        default
Priority:         0
Service Account:  default
Node:             k8s-node2/192.168.239.120
Start Time:       Sun, 06 Oct 2024 17:05:19 +0800
Labels:           run=hostpath
Annotations:      <none>
Status:           Running
IP:               10.244.2.63
IPs:IP:  10.244.2.63
Containers:nginx-host:Container ID:   docker://416d1c3dfe66633c1c23519ddaa65f77d8157127c3583a79b47e57eca5913756Image:          nginx:latestImage ID:       docker-pullable://nginx@sha256:127262f8c4c716652d0e7863bba3b8c45bc9214a57d13786c854272102f7c945Port:           80/TCPHost Port:      0/TCPState:          RunningStarted:      Sun, 06 Oct 2024 17:05:20 +0800Ready:          TrueRestart Count:  0Environment:    <none>Mounts:/usr/share/nginx/html from cache-vol (rw)/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-64rsp (ro)
Conditions:Type                        StatusPodReadyToStartContainers   True Initialized                 True Ready                       True ContainersReady             True PodScheduled                True 
Volumes:cache-vol:Type:          HostPath (bare host directory volume)Path:          /dataHostPathType:  DirectoryOrCreatekube-api-access-64rsp:Type:                    Projected (a volume that contains injected data from multiple sources)TokenExpirationSeconds:  3607ConfigMapName:           kube-root-ca.crtConfigMapOptional:       <nil>DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300snode.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:Type    Reason     Age   From               Message----    ------     ----  ----               -------Normal  Scheduled  15m   default-scheduler  Successfully assigned default/hostpath to k8s-node2Normal  Pulling    15m   kubelet            Pulling image "nginx:latest"Normal  Pulled     15m   kubelet            Successfully pulled image "nginx:latest" in 89ms (89ms including waiting). Image size: 187694648 bytes.Normal  Created    15m   kubelet            Created container nginx-hostNormal  Started    15m   kubelet            Started container nginx-host# 测试发现找不到数据,这是因为在 node-2 主机中的/data 目录中没有index.html
[root@k8s-master volumes]# curl 10.244.2.63
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.27.1</center>
</body>
</html>

2.4 创建发布文件测试是否正常访问

# 查询 pod 调度到了哪台node上 
[root@k8s-master volumes]# kubectl get pods -o wide 
NAME                       READY   STATUS      RESTARTS   AGE     IP            NODE        NOMINATED NODE   READINESS GATES
hostpath                   1/1     Running     0          59s     10.244.2.63   k8s-node2   <none>           <none>
nginx-v1-dbd4bc45b-49hhw   1/1     Running     0          3d18h   10.244.2.54   k8s-node2   <none>           <none>
nginx-v2-bd85b8bc4-nqpv2   1/1     Running     0          3d18h   10.244.1.35   k8s-node1   <none>           <none>
testpod                    0/1     Completed   0          3d5h    10.244.2.58   k8s-node2   <none>           <none># 在调度的 node 上增加发布文件
[root@k8s-node2 ~]# echo this is node-2 hostpath > /data/index.html# 访问 pod 测试
[root@k8s-master volumes]# curl 10.244.2.63
this is node-2 hostpath

http://www.tj-hxxt.cn/news/32963.html

相关文章:

  • 网站主机设置方法seo提升排名技巧
  • 快递网站怎么做的网站推广优化流程
  • 做PS的赚钱的网站企业网络推广技巧
  • 产品网站建设aso优化渠道
  • 怎么做网站运营编辑的简历seo职位招聘
  • 怎么把自己做的网站放在榜单优化
  • 揭阳模板建站开发公司域名交易域名出售
  • 中国临沂网站优化深圳十大教育培训机构排名
  • 公司的宣传网站应该怎么做新品上市的营销方案
  • 最好的开发网站建设论坛seo招聘
  • 手把手教你用动易做网站手机网页制作软件
  • 安庆网站建设为南昌seo数据监控
  • 如何建站网站seo免费诊断电话
  • 长沙房产交易中心官网郑州seo外包顾问热狗
  • 网站制作 武汉我想做app推广代理
  • 做网站前期创建文件夹游戏推广合作
  • 哪些网站是用响应式布局做的五合一网站建设
  • 建设银行网站怎么下载地址百度网站介绍
  • wordpress主题 know how百度seo排名优化公司推荐
  • 遵义网站开发制作公司培训学校机构有哪些
  • 自己建网站 怎么做后台信息流广告投放渠道
  • 网站流程优化中国楼市最新消息
  • 昌平区做网站搜索引擎的工作原理分为
  • 淘客怎么用网站做seo关键词seo排名公司
  • 网站设计的介绍模板外包客服平台
  • 河南建设工程信息网一体化seo怎么快速提高排名
  • wordpress 公园主题seo属于什么职业部门
  • 宁波做外贸网站建设南宁排名seo公司
  • 做网站和做java的区别自己做网站制作流程
  • 山东电商网站建设今日重要新闻