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

相关推荐
Java陈序员3 小时前
轻量强大!一款现代化的 Kubernetes 集群管理与监控工具!
云原生·容器·kubernetes
Yogurt_cry4 小时前
[树莓派4B] 闲置近10年的爱普生 L310 打印机爆改无线打印机
linux·物联网·树莓派
Johny_Zhao1 天前
OpenClaw中级到高级教程
linux·人工智能·信息安全·kubernetes·云计算·yum源·系统运维·openclaw
Sheffield2 天前
Docker的跨主机服务与其对应的优缺点
linux·网络协议·docker
Sheffield2 天前
Alpine是什么,为什么是Docker首选?
linux·docker·容器
Johny_Zhao3 天前
centos7安装部署openclaw
linux·人工智能·信息安全·云计算·yum源·系统运维·openclaw
haibindev3 天前
在 Windows+WSL2 上部署 OpenClaw AI员工的实践与踩坑
linux·wsl2·openclaw
0xDevNull4 天前
Linux切换JDK版本详细教程
linux
进击的丸子4 天前
虹软人脸服务器版SDK(Linux/ARM Pro)多线程调用及性能优化
linux·数据库·后端