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

相关推荐
瑞雪兆丰年兮36 分钟前
Linux零基础快速入门-第二章 Linux基础命令
linux·运维·服务器
lambo mercy39 分钟前
01初识docker
运维·docker·容器
时间的拾荒人2 小时前
Docker 容器、仓库与数据管理实战
docker·容器·eureka
咋的啥名都用不了呢~3 小时前
Linux项目部署6(安装Elasticsearch)
linux
时间的拾荒人3 小时前
Docker 入门实战:从核心概念、安装配置到镜像操作与 Dockerfile 定制
运维·docker·容器·eureka
无奈笑天下4 小时前
银河麒麟桌面上USB打印机无法打印问题标准处理流程
linux·运维·网络协议
goyeer5 小时前
【Kubernetes】Kubernetes之CRI详解
java·容器·kubernetes
15Moonlight5 小时前
Linux 网络(11):IO 多路转接(select /poll/epoll)
linux·网络
wz97545 小时前
Kubernetes Pod 深度详解:K8s 最小调度单元
云原生·容器·kubernetes
wno7046 小时前
CentOS下FTP服务搭建
linux·运维·centos