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

相关推荐
SLD_Allen2 小时前
NVIDIA KAI Scheduler深度解析——Kubernetes原生AI调度器的架构、原理与实践
人工智能·架构·kubernetes
三言老师3 小时前
K8s集群运行时自动化运维全覆盖落地实操(下)
linux·运维·服务器·网络
艾伦_耶格宇4 小时前
【DOCKER进阶】-3 cgroups
docker·容器·eureka
ltl4 小时前
nodeSelector 与节点放置:Filter、亲和性与拓扑打散
kubernetes
ltl4 小时前
HAProxy HTX 与 HTTP 路径:内部表示、改写落点与协议分叉
linux
ltl4 小时前
Envoy Gateway 排障:未 Accepted、空 IR、xDS NACK 与旧快照
kubernetes
ltl4 小时前
可拆分 OS:CXL 内存池化如何动摇本地 DRAM 假设
linux
ltl4 小时前
Envoy Gateway 南北向全景:附着、IR、xDS 与东西向交界
kubernetes
ltl4 小时前
Tetragon 强制执行:Override 与 SIGKILL 各自保证什么
linux
ltl4 小时前
Tetragon 运行时安全全景:缺口、五轴坐标系与阅读路线
kubernetes