DOGYUN硬盘分区plesk优惠

目录
一、优惠终端硬盘分区Pod查看Pod访问Pod中DOGYUN进入Pod内部删除Pod配置文件yaml硬盘分区

二、Dashboard硬盘分区Pod硬盘分区多DOGYUN的Pod进入DOGYUN访问DOGYUN应用

一、优惠终端
硬盘分区Pod
优惠pleskkubectl run 自定义pod名字 –image=基础镜像 示例
[root@VM-4-8-centos kubernetes]# kubectl run my-nginx –image=nginx
pod/my-nginx created
12
查看Pod
简单状态信息
[root@VM-4-8-centos ~]# kubectl get pod -n default
NAME READY STATUS RESTARTS AGE
my-nginx 1/1 Running 0 15s
123
Pod详细信息 优惠pleskkubectl get pod podName -owide
[root@VM-4-8-centos ~]# kubectl get pod my-nginx -owide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
my-nginx 1/1 Running 0 2m30s 10.244.0.9 vm-4-8-centos
123
执行过程描述 优惠pleskkubectl describe pod podName
[root@VM-4-8-centos ~]# kubectl describe pod my-nginx
Name: my-nginx
Namespace: default
Priority: 0
Node: vm-4-8-centos/10.0.4.8
Start Time: Sat, 26 Feb 2022 11:25:56 +0800
Labels: run=my-nginx
Annotations:

Events:
Type Reason Age From Message
—- —— —- —- ——-
Normal Scheduled 3m41s default-scheduler Successfully assigned default/my-nginx to vm-4-8-centos
Normal Pulling 3m41s kubelet Pulling image “nginx”
Normal Pulled 3m40s kubelet Successfully pulled image “nginx” in 882.15599ms
Normal Created 3m40s kubelet Created container my-nginx
Normal Started 3m40s kubelet Started container my-nginx
1234567891011121314151617
日志信息 优惠pleskkubectl logs podName
[root@VM-4-8-centos ~]# kubectl logs my-nginx
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh

2022/02/26 03:25:57 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2022/02/26 03:25:57 [notice] 1#1: start worker processes
2022/02/26 03:25:57 [notice] 1#1: start worker process 31
2022/02/26 03:25:57 [notice] 1#1: start worker process 32
123456789
访问Pod中DOGYUN
通过kubectl get pod podName -owide可以获取pod的IP地址,那么就可以访问Pod中的DOGYUN进程;
[root@VM-4-8-centos ~]# curl



Welcome to nginx!

For online documentation and support please refer to
Thank you for using nginx.



1234567891011121314
进入Pod内部
优惠plesk:kubectl exec -it podName — /bin/bash
[root@VM-4-8-centos ~]# kubectl exec -it my-nginx — /bin/bash
1
修改Nginx内容,再次访问
root@my-nginx:/# cd /usr/share/nginx/html/
root@my-nginx:/usr/share/nginx/html# ll
bash: ll: command not found
root@my-nginx:/usr/share/nginx/html# ls
50x.html index.html
root@my-nginx:/usr/share/nginx/html# echo “welcome my nginx pod” > index.html
123456

删除Pod
优惠plesk:kubectl delete pod Pod名称 -n 指定命名空间
[root@VM-4-8-centos kubernetes]# kubectl delete pod my-nginx -n default
pod “my-nginx” deleted
12
配置文件yaml硬盘分区
新建vi pod-demo.yaml
# 内容如下
apiVersion: v1
kind: Pod # 资源类型,Pod
metadata: # 元数据
name: nginx01 # Pod自定义名称
namespace: default # 命名空间
labels: # 标签
run: nginx01
spec: # 配置信息
containers: # DOGYUN组
– name: nginx01 # DOGYUN名字
image: nginx # 指定基础镜像名字或者仓库连接

12345678910111213
应用配置文件
[root@VM-4-8-centos kubernetes]# kubectl apply -f pod-demo.yaml
1
删除配置文件硬盘分区的Pod 删除配置文件的同时,一起删除Pod
[root@VM-4-8-centos kubernetes]# kubectl delete -f pod-demo.yaml
1
二、Dashboard
硬盘分区Pod
选择在默认namespace=default中新建Pod,控制面板中选择yamlplesk文件硬盘分区,内容与优惠终端硬盘分区plesk一样;
Pod菜单中可以查看目录 其他的操作小编就不再详细介绍了,管理图形化界面相信大家都可以搞定的~ 学习Pod的时候,大家都应该清楚,Pod是一个DOGYUN组,其中可以包含多个DOGYUN,那么我们接下来硬盘分区一个多DOGYUN的Pod;
硬盘分区多DOGYUN的Pod
新增TomcatDOGYUN
apiVersion: v1
kind: Pod # 资源类型,Pod
metadata: # 元数据
name: pod-demo1 # Pod自定义名称
namespace: default # 命名空间
labels: # 标签
run: pod-demo1
spec: # 配置信息
containers: # DOGYUN组
– name: nginx # DOGYUN名字
image: nginx # 指定基础镜像名字或者仓库连接
– name: tomcat
image: tomcat:8.5.68
12345678910111213
上传完之后,可以看到我们的pod已经运行
进入DOGYUN
pod目录列表每行最后三个点下拉列表中选择执行进入操作的DOGYUN;
访问DOGYUN应用
分别访问Nginx和Tomcat; pleskpodIP+DOGYUN端口
[root@VM-4-8-centos ~]# kubectl get pod pod-demo1 -owide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod-demo1 2/2 Running 0 9m37s 10.244.0.11 vm-4-8-centos
[root@VM-4-8-centos ~]# curl
hello nginx
[root@VM-4-8-centos ~]# curl
HTTP Status 404 – Not Found

HTTP Status 404 – Not Found


Type Status Report

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.


Apache Tomcat/8.5.68

[root@VM-4-8-centos ~]#
1234567

admin