forked from kelseyhightower/certificate-init-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tls-app.yaml
76 lines (76 loc) · 1.91 KB
/
tls-app.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
apiVersion: v1
kind: ServiceAccount
metadata:
name: certificate-init
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: certificate-init
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
subjects:
- kind: ServiceAccount
name: certificate-init
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: tls-app
labels:
app: tls-app
spec:
replicas: 1
template:
metadata:
labels:
app: tls-app
spec:
serviceAccountName: certificate-init
initContainers:
- name: certificate-init-container
image: gcr.io/hightowerlabs/certificate-init-container:0.0.1
imagePullPolicy: Always
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
args:
- "-additional-dnsnames=example.com"
- "-cert-dir=/etc/tls"
- "-namespace=$(NAMESPACE)"
- "-pod-ip=$(POD_IP)"
- "-pod-name=$(POD_NAME)"
- "-service-names=tls-app"
volumeMounts:
- name: tls
mountPath: /etc/tls
containers:
- name: tls-app
image: gcr.io/hightowerlabs/tls-app:1.0.0
imagePullPolicy: Always
args:
- "-tls-cert=/etc/tls/tls.crt"
- "-tls-key=/etc/tls/tls.key"
ports:
- containerPort: 443
resources:
limits:
memory: "50Mi"
cpu: "100m"
volumeMounts:
- name: tls
mountPath: /etc/tls
volumes:
- name: tls
emptyDir: {}