k8s实践

1.简单yml

apiVersion: v1

kind: Pod

metadata:

name: nginx-pod

labels:

name: nginx-pod

spec:

containers:

  • name: nginx-container

image: nginx

2.加入replicasyml

apiVersion: apps/v1

kind: ReplicaSet

metadata:

name: nginx-deployment

spec:

replicas: 4

selector:

matchLabels:

app: nginx

template:

metadata:

labels:

app: nginx

spec:

containers:

  • name: nginx-container

image: nginx

3.deployment yml

apiVersion: apps/v1

kind: Deployment

metadata:

name: nginx-deployment

labels:

name: nginx-deploy

spec:

replicas: 4

selector:

matchLabels:

app: nginx

template:

metadata:

labels:

app: nginx

spec:

containers:

  • name: nginx-container

image: nginx

4.service yml

apiVersion: v1

kind: Service

metadata:

name: nginx-service

spec:

type: NodePort

selector:

app: nginx

ports:

  • port: 80

targetPort: 80

nodePort: 30008

内容来源:【入门篇】Kubernetes的核心概念以及在本地部署多种资源_哔哩哔哩_bilibili

另外个人网站数字证书https,可参考下面网址
Nginx实战 - 配置HTTPS | 数字证书和私钥 | Docker Compose容器_哔哩哔哩_bilibili

相关推荐
LCG元4 分钟前
Linux 性能优化实战:当服务器负载飙升1000%时,我做了什么?
linux
众俗16 分钟前
Linux+Docker+SpringBoot 简单部署
linux·spring boot·docker
染指秃头32 分钟前
VM虚拟机共享宿主机代理(Ubuntu24.04)
linux·运维·服务器
Wang's Blog33 分钟前
Linux小课堂: Squid代理缓存服务器部署与访问控制实战指南
linux·服务器·缓存
梁正雄1 小时前
7-linux命令-用户管理
linux
江公望1 小时前
磁盘分区方案GPT和MBR的区别浅谈
linux
cc20229281 小时前
ingress概念和实际运用
容器·kubernetes·k8s
---学无止境---1 小时前
Linux中动态修改页面映射属性函数change_page_attr的实现
linux
gfdgd xi2 小时前
GXDE OS 25.2.1 更新了!引入 dtk6,修复系统 bug 若干
linux·运维·ubuntu·操作系统·bug·移植·桌面
qing222222222 小时前
Ubuntu:设置程序开机自启动
linux·运维·ubuntu