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

相关推荐
暴力求解5 小时前
Linux---线程基础
linux·运维·服务器
JAVA面经实录9175 小时前
计算机基础(完整版·超详细可背诵)
java·linux·数据结构·算法
晚风_END5 小时前
Linux|操作系统|最新版openzfs编译记录
linux·运维·服务器·数据库·spring·中间件·个人开发
GanGanGanGan_5 小时前
Rocky Linux 9 + XFCE 编译安装 fcitx5 + Rime 教程
linux·centos
咖喱o6 小时前
QinQ/VLAN Stacking
linux·运维·服务器·网络
xiaoye-duck6 小时前
《Linux系统编程》Linux指令 (二):从零开始理解Linux基础指令
linux
月白风清江有声6 小时前
安装mingw 版 cmake
linux
呱呱巨基7 小时前
Linux 基础IO
linux·c++·笔记·学习
QFIUNE7 小时前
CD-HIT 详解:序列去冗余、安装使用与聚类结果解析
linux·服务器·机器学习·数据挖掘·conda·聚类
vortex58 小时前
XFCE 桌面环境组件详解:从面板到剪贴板管理
linux·xfce·桌面环境