-
Notifications
You must be signed in to change notification settings - Fork 0
/
50-{{ Service | toLower }}.dep.yml
136 lines (136 loc) · 4.56 KB
/
50-{{ Service | toLower }}.dep.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
124
125
126
127
128
129
130
131
132
133
134
135
136
---
# Generated by boilr at {{ time "Mon, 02 Jan 2006 15:04:05 MST" }}
apiVersion: "extensions/v1beta1"
kind: "Deployment"
metadata:
labels:
application: "{{ Application | toLower }}"
role: "{{ Role | toLower }}"
name: "{{ Service | toLower }}"
namespace: "{{ Namespace }}"
spec:
replicas: {{ Replicas }}
selector:
matchLabels:
application: "{{ Application | toLower }}"
role: "{{ Role | toLower }}"
strategy:
rollingUpdate:
maxSurge: {{ MaxSurge }}
maxUnavailable: {{ MaxUnavailable }}
type: "RollingUpdate"
template:
metadata:
labels:
application: "{{ Application | toLower }}"
role: "{{ Role | toLower }}"
spec:
# volumes:
# - name: "{{ Service | toLower }}-etc-conf-d"
# configMap:
# name: "{{ Service | toLower }}-etc-conf-d"
# - name: "{{ Service | toLower }}-data"
# hostPath:
# path: /data/{{ Service | toLower }}/
containers:
- name: "{{ Application | toLower }}"
# env:
# - name: "FOO"
# value: "BAR"
image: "{{ Image }}:{{ ImageVersion }}" # Todo: Update this
{{ if eq ImageVersion "latest" }}imagePullPolicy: "Always"{{ else }}imagePullPolicy: "IfNotPresent"{{ end }}
# args:
# - "command"
# - "line"
# - "arguments"
resources:
limits:
cpu: "{{ CpuLimit }}"
memory: "{{ MemoryLimit }}"
requests:
cpu: "{{ CpuRequest }}"
memory: "{{ MemoryRequest }}"
securityContext:
privileged: {{ Privileged }}
# capabilities:
# add:
# - SETPCAP
# - SYS_MODULE
# - SYS_RAWIO
# - SYS_PACCT
# - SYS_ADMIN
# - SYS_NICE
# - SYS_RESOURCE
# - SYS_TIME
# - SYS_TTY_CONFIG
# - MKNOD
# - AUDIT_WRITE
# - AUDIT_CONTROL
# - MAC_OVERRIDE
# - MAC_ADMIN
# - NET_ADMIN
# - SYSLOG
# - CHOWN
# - NET_RAW
# - DAC_OVERRIDE
# - FOWNER
# - DAC_READ_SEARCH
# - FSETID
# - KILL
# - SETGID
# - SETUID
# - LINUX_IMMUTABLE
# - NET_BIND_SERVICE
# - NET_BROADCAST
# - IPC_LOCK
# - IPC_OWNER
# - SYS_CHROOT
# - SYS_PTRACE
# - SYS_BOOT
# - LEASE
# - SETFCAP
# - WAKE_ALARM
# - BLOCK_SUSPEND
ports:
- containerPort: {{ ApplicationPort }}
protocol: "{{ ApplicationPortProtocol }}"
name: "{{ ApplicationPortName }}"
# volumeMounts:
# - name: "{{ Service | toLower }}-etc-conf-d"
# readOnly: true
# mountPath: "/etc/{{ Service | toLower }}/conf.d"
# - name: "{{ Service | toLower }}-data
# readOnly: false
# mountPath: "/data"
livenessProbe:
{{ if eq ProbeType "http" }}httpGet:
# Path to probe; should be cheap, but representative of typical behavior
path: "/healthz"
port: {{ ApplicationPort }}
httpHeaders:
- name: "Host"
value: "www.example.com" # Todo: Fix this
#- name: "X-Custom-Header"
# value: "Awesome"
initialDelaySeconds: {{ ApplicationBootTime }}
timeoutSeconds: {{ ApplicationHealthCheckPeriod }}{{ else if eq ProbeType "tcp"}}tcpSocket:
port: {{ ApplicationPort }}
initialDelaySeconds: {{ ApplicationBootTime }}
timeoutSeconds: {{ ApplicationHealthCheckPeriod }}{{ end }}
readinessProbe:
{{ if eq ProbeType "http" }}httpGet:
# Path to probe; akin to a status check.
path: "/healthz"
port: {{ ApplicationPortName }}
httpHeaders:
- name: "Host"
value: "www.example.com" # Todo: Fix this
#- name: "X-Custom-Header"
# value: "Awesome"
initialDelaySeconds: {{ ApplicationBootTime }}
timeoutSeconds: {{ ApplicationHealthCheckPeriod }}{{ else if eq ProbeType "tcp"}}tcpSocket:
port: {{ ApplicationPortName }}
initialDelaySeconds: {{ ApplicationBootTime }}
timeoutSeconds: {{ ApplicationHealthCheckPeriod }}{{ end }}
restartPolicy: "Always"
securityContext: {}