forked from linclin/go-gin-rest-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s-deploy.yaml
88 lines (86 loc) · 1.84 KB
/
k8s-deploy.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
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: go-gin-rest-api
namespace: default
labels:
name: go-gin-rest-api
spec:
replicas: 1
selector:
matchLabels:
name: go-gin-rest-api
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
name: go-gin-rest-api
spec:
restartPolicy: Always
containers:
- name: go-gin-rest-api
image: "registry.cn-shenzhen.aliyuncs.com/dev-ops/go-gin-rest-api:1.0.1"
imagePullPolicy: Always
securityContext:
privileged: true
ports:
- containerPort: 8080
name: http-port
env:
- name: RunMode
value: 'se'
resources:
limits:
cpu: 2
memory: 4096Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: localtime
mountPath: /etc/localtime
readOnly: true
terminationGracePeriodSeconds: 60
volumes:
- name: localtime
hostPath:
path: /etc/localtime
---
apiVersion: v1
kind: Service
metadata:
name: go-gin-rest-api
namespace: default
labels:
name: go-gin-rest-api
spec:
type: ClusterIP
selector:
name: go-gin-rest-api
ports:
- name: go-gin-rest-api
port: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: go-gin-rest-api
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx-ingress
rules:
- host: "foo.bar.com"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: go-gin-rest-api
port:
number: 8080