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

相关推荐
丰锋ff25 分钟前
用户管理命令
linux·运维·服务器
刚入门的大一新生1 小时前
Linux-线程概念
linux·jvm
H.莓飛1 小时前
【数据结构】排序总结与规模实测
linux·服务器·开发语言·数据结构·visual studio·1024程序员节
xianyuCcCcCCCcc1 小时前
Kubernetes :健康检查、认证授权与可视化面板
运维·云原生·kubernetes·dashboard
Zenova EdgeOS2 小时前
Linux 日志实战:用 journalctl 精准检索与治理工业边缘日志
linux·运维·chrome
fb_123452 小时前
K8s调度实战全景-Pod调度与资源管控
云原生·容器·kubernetes
Dxy12393102162 小时前
Linux 压缩解压相关命令介绍
linux·运维·服务器
eleven_4u2 小时前
QPS如何计算,如何部署架构
java·linux·运维·jvm·中间件
东城居士3 小时前
理解Linux RTC驱动
linux·嵌入式系统
吴声子夜歌3 小时前
Kubernetes权威指南——Kubernetes安装配置指南(二进制文件安装)
容器·kubernetes