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

相关推荐
CodeYp20192 小时前
第14讲:mmap 实现文件 LRU 缓存
linux·lru·mmap
程序开发阿元2 小时前
一台 20G 的 VPS 被日志吃掉一半:我按这个顺序查了二十分钟
linux·ssh
weirong2 小时前
图解 client-go Informer:手写一个 mini-Informer 才敢说懂
kubernetes
.冰块.3 小时前
流量大了自动加 Pod!K8s HPA 扩缩容与 ResourceQuota/LimitRange 资源管控实战
linux·云原生·容器·kubernetes·hpa·quota·limitrange
承渊政道3 小时前
Linux网络学习【深入理解多路转接select、poll的代码改写】
linux·ubuntu·select·多路转接·poll
雪落漂泊3 小时前
Linux进程(四)概念:命令行参数和环境变量篇
linux·运维·服务器
方便面不加香菜3 小时前
Docker Container -- 容器命令详解
运维·docker·容器
qq_377572773 小时前
linux x86 arm loongarch
linux
Dragon~Snow4 小时前
Centos Stream10 安装 MySQL-9.7.2-linux-glibc2.28-x86_64.tar
linux·mysql·centos
say_fall4 小时前
【Linux系统编程】Linux进程信号:从“外卖到了“到内核里的一张位图
linux·运维·服务器·车载系统·智能硬件