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

相关推荐
张忠琳几秒前
【client-go v0.36.1】(store Part 1)Store 超深度分析 — 模块定位、接口层次、类结构、KeyFunc体系、构造初始化
云原生·kubernetes·informer·store·client-go
江湖有缘4 分钟前
Docker一键部署open-resume简历生成器
运维·docker·容器
丑过三八线10 分钟前
Runc 深度解析:从原理到实操
java·linux·开发语言·docker·容器·rpc
手可摘星辰的少年20 分钟前
Linux字符设备驱动的实现与QEMU验证
linux
手可摘星辰的少年20 分钟前
使用额外ext4磁盘镜像在QEMU中传递与加载内核模块
linux
hai31524754338 分钟前
libcore_final.c —— 九章数流矩阵系统
linux·运维·网络
zh路西法1 小时前
【RDKX5交叉编译】基于 QEMU 的 RDK X5 ARM64 rootfs 镜像定制与 chroot 开发环境搭建
linux
设计师小聂!1 小时前
Windows 系统 Docker 安装与配置指南
windows·docker·容器
2601_961845151 小时前
专升本资料哪个好|教材+真题+网课对比推荐PDF
考研·http·微服务·容器·visual studio
iRayCheung1 小时前
virtualbox安装的ubuntu系统跑numpy报错
linux·ubuntu·numpy