This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 398
/
gopub-kubernetes.yml
123 lines (121 loc) · 2.85 KB
/
gopub-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
apiVersion: apps/v1
kind: Deployment
metadata:
name: gopub
namespace: default
labels:
name: gopub
spec:
replicas: 1
selector:
matchLabels:
name: gopub
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
name: gopub
spec:
restartPolicy: Always
hostAliases:
- ip: "192.168.162.66"
hostnames:
- "gitlab.example.org"
- "packagist.example.org"
- "toran.example.org"
- ip: "192.168.143.41"
hostnames:
- "jenkins.example.org"
- ip: "127.0.0.1"
hostnames:
- "mysql"
containers:
- name: gopub
image: "lc13579443/gopub:latest"
imagePullPolicy: Always
securityContext:
privileged: true
ports:
- containerPort: 8192
name: http-port
env:
- name: MYSQL_HOST
value: '127.0.0.1'
- name: MYSQL_PORT
value: '3306'
- name: MYSQL_USER
value: 'root'
- name: MYSQL_PASS
value: '123456'
- name: MYSQL_DB
value: 'walle'
resources:
limits:
cpu: 2
memory: 4096Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: localtime
mountPath: /etc/localtime
readOnly: true
- name: cgroup
mountPath: /sys/fs/cgroup
readOnly: true
- name: mysql
image: "mysql:5.7"
imagePullPolicy: Always
env:
- name: MYSQL_ROOT_PASSWORD
value: '123456'
ports:
- containerPort: 3306
name: mysql-port
resources:
limits:
cpu: 2
memory: 4096Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: localtime
mountPath: /etc/localtime
readOnly: true
- name: cgroup
mountPath: /sys/fs/cgroup
readOnly: true
- name: mysql-data
mountPath: /var/lib/mysql
terminationGracePeriodSeconds: 30
volumes:
- name: localtime
hostPath:
path: /etc/localtime
- name: cgroup
hostPath:
path: /sys/fs/cgroup
- name: mysql-data
hostPath:
path: /data/gopub-mysql
---
apiVersion: v1
kind: Service
metadata:
name: gopub
namespace: default
labels:
name: gopub
spec:
type: NodePort
selector:
name: gopub
ports:
- name: gopub
port: 8192
nodePort: 8192