-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubernetes.yml
150 lines (150 loc) · 2.67 KB
/
kubernetes.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
apiVersion: v1
kind: ConfigMap
metadata:
name: pw-cm
namespace: pw
data:
PW_PORT: "8080"
PW_LOG_LEVEL: "info"
PW_MESSAGE_MAX_LENGTH: "4096"
PW_ENCRYPTED_MESSAGE_MAX_LENGTH: "15000"
PW_LOCALE_ID: "en"
PW_REDIS_URL: "redis://pw-redis-svc:6379/"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pw
namespace: pw
spec:
replicas: 1
selector:
matchLabels:
app: pw
template:
metadata:
labels:
app: pw
spec:
containers:
- name: pw
image: tinyops/pw:1.7.0
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: pw-cm
volumeMounts:
- name: tz-config
mountPath: /etc/localtime
readOnly: true
volumes:
- name: tz-config
hostPath:
path: /etc/localtime
---
apiVersion: v1
kind: Service
metadata:
name: pw-svc
namespace: pw
spec:
selector:
app: pw
ports:
- protocol: TCP
port: 8080
targetPort: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: pw-ingress
namespace: pw
spec:
ingressClassName: nginx
rules:
- host: pw.company.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: pw-svc
port:
number: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pw-redis
namespace: pw
spec:
replicas: 1
selector:
matchLabels:
app: pw-redis
template:
metadata:
labels:
app: pw-redis
spec:
containers:
- name: pw-redis
image: redis:7.4.0-alpine3.20
args:
[
"redis-server",
"--save",
"",
"--appendonly",
"no",
"--maxmemory",
"128mb",
]
---
apiVersion: v1
kind: Service
metadata:
name: pw-redis-service
namespace: pw
spec:
selector:
app: pw-redis
ports:
- protocol: TCP
port: 6379
targetPort: 6379
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nfs-pvc-pw-claim
namespace: pw
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-pv-pw
namespace: pw
annotations:
volume.beta.kubernetes.io/mount-options: vers=4,port=0,hard,proto=tcp,local_lock=none,async
spec:
persistentVolumeReclaimPolicy: Retain
claimRef:
namespace: pw
name: nfs-pvc-pw-claim
capacity:
storage: 100MB
accessModes:
- ReadWriteMany
nfs:
server: 192.168.1.200
path: /opt/pw/