-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.yaml
More file actions
162 lines (162 loc) · 3.65 KB
/
deployment.yaml
File metadata and controls
162 lines (162 loc) · 3.65 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
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
151
152
153
154
155
156
157
158
159
160
161
162
apiVersion: apps/v1
kind: Deployment
metadata:
name: hazelcast-demo
namespace: hazelcast-demo-dev
labels:
app: hazelcast-demo
version: v1.1.0
spec:
replicas: 2
selector:
matchLabels:
app: hazelcast-demo
template:
metadata:
labels:
app: hazelcast-demo
version: v1.1.0
spec:
serviceAccountName: hazelcast-service-account
containers:
- name: hazelcast-demo
image: hazelcast-demo:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
name: http
- containerPort: 5701
name: hazelcast
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
startupProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 12
env:
- name: SPRING_PROFILES_ACTIVE
value: "openshift-local"
- name: SERVER_PORT
value: "8080"
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: DB_HOST
value: "postgresql"
- name: DB_PORT
value: "5432"
- name: DB_NAME
value: "hazelcastdb"
- name: DB_USERNAME
value: "hazelcast"
- name: DB_PASSWORD
value: "hazelcast123"
- name: HAZELCAST_SERVICE_NAME
value: "hazelcast-demo-service"
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "500m"
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1001
capabilities:
drop:
- ALL
---
apiVersion: v1
kind: Service
metadata:
name: hazelcast-demo-service
namespace: hazelcast-demo-dev
labels:
app: hazelcast-demo
spec:
selector:
app: hazelcast-demo
ports:
- port: 8080
targetPort: 8080
protocol: TCP
name: http
- port: 5701
targetPort: 5701
protocol: TCP
name: hazelcast
type: ClusterIP
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: hazelcast-service-account
namespace: hazelcast-demo-dev
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: hazelcast-role
namespace: hazelcast-demo-dev
rules:
- apiGroups: [""]
resources: ["pods", "endpoints", "services"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: hazelcast-role-binding
namespace: hazelcast-demo-dev
subjects:
- kind: ServiceAccount
name: hazelcast-service-account
namespace: hazelcast-demo-dev
roleRef:
kind: Role
name: hazelcast-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: hazelcast-demo-route
namespace: hazelcast-demo-dev
labels:
app: hazelcast-demo
spec:
to:
kind: Service
name: hazelcast-demo-service
weight: 100
port:
targetPort: http
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
wildcardPolicy: None