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

相关推荐
Andy杨21 分钟前
20250712-1-Kubernetes 监控与日志管理-K8s日志管理与维护_笔记
笔记·容器·kubernetes
Mr_Orangechen23 分钟前
Linux 下使用 VS Code 远程 GDB 调试 ARM 程序
linux·运维·arm开发
lilian1291 小时前
linux系统mysql性能优化
linux·运维·mysql
共享家95272 小时前
linux_线程概念
linux·开发语言·jvm
乌云暮年2 小时前
Linux常用命令
linux·服务器·ssh·php
weixin_516023072 小时前
Geant4 安装---Ubuntu
linux·运维·ubuntu
稀液蟹-plus2 小时前
zynq-PS篇——bperez77中DMA驱动注意事项
linux·fpga
brave_zhao3 小时前
JavaBeanUtils javaBean转map, 实体类转map,实体集合转List<Map>
linux·windows·python
KKKingWei4 小时前
Kubernetes Dashboard UI 部署安装
云原生·容器·kubernetes
egoist20234 小时前
【Linux仓库】虚拟地址空间【进程·陆】
linux·运维·服务器·操作系统·进程·虚拟地址空间·fork