-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s-deployment.yml
80 lines (80 loc) · 1.75 KB
/
k8s-deployment.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
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: admiral-reader
rules:
- apiGroups:
- ""
resources:
- '*'
verbs:
- '*'
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: admiral-reader
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admiral-reader
subjects:
- kind: ServiceAccount
name: admiral-reader
namespace: default
roleRef:
kind: ClusterRole
name: admiral-reader
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: go-api-server
spec:
replicas: 1
selector:
matchLabels:
app: go-api-server
template:
metadata:
labels:
app: go-api-server
spec:
serviceAccountName: admiral-reader
containers:
- name: go-api-server
image: go-k8s
imagePullPolicy: Never
ports:
- containerPort: 8080
# livenessProbe:
# httpGet:
# path: /health
# port: 8080
# scheme: HTTP
# initialDelaySeconds: 5
# periodSeconds: 15
# timeoutSeconds: 5
# readinessProbe:
# httpGet:
# path: /readiness
# port: 8080
# scheme: HTTP
# initialDelaySeconds: 5
# timeoutSeconds: 1
---
apiVersion: v1
kind: Service # Type of kubernetes resource
metadata:
name: go-api-server-service # Name of the resource
spec:
type: LoadBalancer # A port is opened on each node in your cluster via Kube proxy.
ports: # Take incoming HTTP requests on port 9090 and forward them to the targetPort of 8080
- name: http
port: 9090
targetPort: 8080
selector:
app: go-api-server