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

相关推荐
VirusVIP2 小时前
Windows CMD通过adb检查触摸屏Linux驱动是否被编译
linux·运维·adb
chennalC#c.h.JA Ptho2 小时前
ubuntu studio 系统详解
linux·运维·服务器·经验分享·ubuntu·系统安全
hwj运维之路6 小时前
k8s监控方案实践(三):部署与配置Grafana可视化平台
云原生·kubernetes·grafana
yt948326 小时前
Docker-基础(数据卷、自定义镜像、Compose)
运维·docker·容器
Hfc.6 小时前
docker-daemon.json
docker·容器·json
和计算机搏斗的每一天6 小时前
k8s之探针
云原生·容器·kubernetes
丢丢丢丢丢丢~9 小时前
apache2的默认html修改
linux·运维·服务器
wusam9 小时前
Linux系统管理与编程20:Apache
linux·运维·服务器·apache·shell编程
我不想当小卡拉米9 小时前
【Linux】操作系统入门:冯诺依曼体系结构
linux·开发语言·网络·c++
ChironW9 小时前
Ubuntu 24.04 LTS系统上配置国内时间同步
linux·运维·服务器·ubuntu