This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathworkload.yaml
95 lines (92 loc) · 1.98 KB
/
workload.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: workload-certificate
namespace: default
spec:
secretName: workload-tls
subject:
organizations:
- Example Organization
dnsNames:
- workload.demo.example.com
issuerRef:
name: venafi-tpp-issuer
kind: Issuer
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx-workload
name: nginx-workload-deployment
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: nginx-workload
template:
metadata:
labels:
app: nginx-workload
spec:
containers:
- image: nginx:1.9.11
name: nginx-workload
volumeMounts:
- mountPath: "/etc/nginx/ssl"
name: workload-tls
readOnly: true
- mountPath: "/etc/nginx/conf.d"
name: workload-config
readOnly: true
ports:
- containerPort: 443
hostPort: 4430
name: https
volumes:
- name: workload-tls
secret:
secretName: workload-tls
- name: workload-config
configMap:
name: nginx-workload-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-workload-config
namespace: default
data:
default.conf: |
server {
listen 443 ssl default_server;
server_name workload.demo.cert-manager.io;
ssl_certificate /etc/nginx/ssl/tls.crt;
ssl_certificate_key /etc/nginx/ssl/tls.key;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
---
apiVersion: v1
kind: Service
metadata:
name: nginx-workload-service
namespace: default
spec:
type: NodePort
ports:
- name: https
port: 4430
protocol: TCP
targetPort: 4430
selector:
app: nginx-workload