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

相关推荐
leisoo80972 小时前
100GBA股股票数据怎么存ClickHouseRedisMySQLJSON完整对比
大数据·linux·服务器·开发语言·python
青瓦梦滋3 小时前
传输层UDP/TCP协议
linux·网络·c++·网络协议·tcp/ip·udp
ltl3 小时前
机密计算:SGX、SEV-SNP、TDX 与 ARM CCA
linux
ltl3 小时前
互联与网络:NVLink、InfiniBand、RoCE 与国产替代
linux
码上上班3 小时前
tengine知识点
linux·服务器·centos
雾时之林6 小时前
Linux--软件管理、源码包安装
linux·服务器·数据库
坐吃山猪8 小时前
Docker07-MySQL
mysql·docker·容器
Kismet_nvi8 小时前
《Kubernetes Service 进阶、kube-proxy 与 Ingress 实战精要》
云原生·容器·kubernetes
sxstj10 小时前
Ubuntu 完整安装并启用 Flatpak 教程
linux·运维·ubuntu
RisunJan10 小时前
Linux命令-sshd(SSH 服务器守护进程)
linux·服务器·ssh