banner
Hi my new friend!

部署Nginx

Scroll down

本文作者:丁辉

部署Nginx

编写 Yaml 文件

1
vi nginx.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: default
name: nginx
labels:
app: nginx
spec:
progressDeadlineSeconds: 200
replicas: 1
revisionHistoryLimit: 10
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
#hostNetwork: true #使用本地网络
containers:
- name: nginx
image: nginx:latest
imagePullPolicy: IfNotPresent
#env:
#- name: $1
#value: $2
ports:
- containerPort: 80
protocol: TCP
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 3
successThreshold: 1
tcpSocket:
port: 80
timeoutSeconds: 10
resources:
limits:
memory: 128Mi
1
kubectl apply -f nginx.yaml

I'm so cute. Please give me money.

其他文章
cover
Chatgpt-Pandora
  • 23/11/28
  • 14:48
  • 未分类
cover
Docker私有registry仓库部署
  • 23/11/28
  • 14:48
  • 未分类
请输入关键词进行搜索