-
Notifications
You must be signed in to change notification settings - Fork 0
/
pki-demo.yaml.sed
102 lines (102 loc) · 2.25 KB
/
pki-demo.yaml.sed
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
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-example
annotations:
kubernetes.io/ingress.class: nginx
spec:
tls:
- hosts:
- pkidemo.default.example.com
secretName: pkidemo.default.example.com
rules:
- host: pkidemo.default.example.com
http:
paths:
- path: /
backend:
serviceName: echoserver
servicePort: 8080
---
apiVersion: batch/v1
kind: Job
metadata:
name: vault-secret-pki
spec:
template:
spec:
containers:
- name: getsecretfromvault
image: arykalin/getsecretfromvault:latest
imagePullPolicy: IfNotPresent
command: ["bash", "-c", "/go/src/app/getSecretFromVault"]
env:
- name: VAULT_ADDR
value: "http://vault-vault:8200"
- name: CERT_NAME
value: "pkidemo.default.example.com"
- name: ROLE_NAME
value: "example-dot-com"
- name: VAULT_TOKEN
value: "__ROOT_TOKEN__"
restartPolicy: Never
backoffLimit: 4
#---
#apiVersion: batch/v1beta1
#kind: CronJob
#metadata:
# name: vault-secret-pki
#spec:
# schedule: "*/1 * * * *"
# jobTemplate:
# spec:
# template:
# spec:
# containers:
# - name: getsecretfromvault
# image: arykalin/getsecretfromvault:latest
# command: ["/bin/sleep", "200000"]
# env:
# - name: VAULT_ADDR
# value: "vault-vault:8200"
# - name: CERT_NAME
# value: "pkidemo.default.example.com"
# - name: ROLE_NAME
# value: "example-dot-com"
# - name: VAULT_TOKEN
# value: "__ROOT_TOKEN__"
# restartPolicy: OnFailure
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: echoserver
spec:
replicas: 3
template:
metadata:
labels:
app: echoserver
spec:
containers:
- name: echoserver
image: gcr.io/google_containers/echoserver:1.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: echoserver
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
run: echoserver
sessionAffinity: None
type: NodePort
status:
loadBalancer: {}