-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.yml
More file actions
85 lines (84 loc) · 2.1 KB
/
Copy pathdeploy.yml
File metadata and controls
85 lines (84 loc) · 2.1 KB
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
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: naberius-deployment #
namespace: magicdog # 同一namespace可以互相调用资源
labels:
k8s-app: naberius # 在定义service时用到
spec:
replicas: 1 # 定义需要多少个pod
selector:
matchLabels:
k8s-app: naberius # 给k8s用的
template:
metadata:
labels:
k8s-app: naberius # 跟上边保持一致
spec:
containers:
- name: naberius #
image: yukimir/naberius # 部署时用的docker镜像
env:
- name: MONGO_HOST
value: mongo-service
- name: MONGO_PORT
value: '27017'
- name: MONGO_DATABASE
value: aigis
- name: FILES_ROOT_DIR
value: /root/naberius-files
ports:
- containerPort: 4000
volumeMounts:
- name: util-pv
mountPath: /root/naberius-files
subPath: naberius-files
volumes:
- name: util-pv
persistentVolumeClaim:
claimName: util-pv-claim
nodeSelector:
kubernetes.io/hostname: node-us
---
kind: Service
apiVersion: v1
metadata:
name: naberius-service #
namespace: magicdog #
spec:
selector:
k8s-app: naberius # 跟deployment里保持一致
ports:
- port: 4000 # 用80就可以了
targetPort: 4000 # 上边容器开启的端口
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: naberius-ingress #
namespace: magicdog #
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: aigisapi.pigtv.moe #
http:
paths:
- backend:
serviceName: naberius-service # 上边定义的service名字
servicePort: 4000 # 上边service使用的端口
tls:
- secretName: aigisapi-pigtv-moe-tls
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: aigisapi-pigtv-moe-tls
namespace: magicdog
spec:
secretName: aigisapi-pigtv-moe-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- aigisapi-pigtv-moe-tls