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

相关推荐
CoderYanger7 分钟前
Java EE 进阶:15. Linux基本使用和程序部署(第二弹):部署 Web 项目到 Linux
linux·服务器·数据库·spring boot·spring·阿里云·java-ee
1024+8 分钟前
Ubuntu 系统设置虚拟内存
linux·运维·ubuntu
飞花漫卷,情随岁迁41 分钟前
Linux 排障与性能监控
linux·运维·服务器·网络·数据库·mysql·oracle
有风听风有雨看雨2 小时前
MinIO 单节点Docker(密码放配置文件)
运维·docker·容器
长不大的杨瑞杰2 小时前
Kubernetes CrashLoopBackOff 排障全流程:OOM、探针、应用退出与依赖故障定责
docker·云原生·容器·kubernetes·devops·oomkilled
JoyCong19982 小时前
从一张空白设备列表开始,ToDesk新版本增添无设备引导,远程管理更友好
linux·运维·服务器·网络·远程工作
东城居士2 小时前
理解Linux下UART的驱动框架
linux·嵌入式系统
车软学堂2 小时前
Docker在隔离什么:namespace、cgroup、chroot三道墙
linux·python·docker·容器·车载系统·汽车·测试用例
Meaauf3 小时前
Ubuntu部署Kubernetes 1.32集群
linux·ubuntu·kubernetes