-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s-svc-mgr.yaml
55 lines (55 loc) · 1.68 KB
/
k8s-svc-mgr.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
---
apiVersion: apps/v1
kind: Deployment # Type of Kubernetes resource
metadata:
name: svc-mgr # Name of the Kubernetes resource
labels:
app.kubernetes.io/name: svc-mgr
spec:
replicas: 1 # Number of pods to run at any given time
selector:
matchLabels:
app: svc-mgr # This deployment applies to any Pods matching the specified label
template: # This deployment will create a set of pods using the configurations in this template
metadata:
labels: # The labels that will be applied to all of the pods in this deployment
app: svc-mgr
app.kubernetes.io/name: svc-mgr
spec: # Spec for the container which will run in the Pod
terminationGracePeriodSeconds: 5
containers:
- name: svc-mgr
image: svc-mgr
env:
- name: DB_CONNECTION_STRING
valueFrom:
secretKeyRef:
name: paaks-secret
key: dbConnStr
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: paaks-secret
key: secretKey
imagePullPolicy: IfNotPresent
ports:
- containerPort: 2000 # Should match the port number that the Go application listens on
volumeMounts:
- name: blockdisk01
mountPath: /tmp/storage
volumes:
- name: blockdisk01
persistentVolumeClaim:
claimName: pv-main-fs
---
apiVersion: v1
kind: Service
metadata:
name: svc-mgr
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: svc-mgr
ports:
- port: 80
targetPort: 3000