-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yml
152 lines (143 loc) · 3.2 KB
/
deployment.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
kind: Deployment
apiVersion: apps/v1
metadata:
name: keycloak-db
namespace: namespace-name
spec:
selector:
matchLabels:
service: keycloak-db
template:
metadata:
labels:
service: keycloak-db
spec:
nodeSelector:
storageaccess: direct
volumes:
- name: keycloak-db
hostPath:
path: "/cluster/namespace-name/keycloak/db"
type: "DirectoryOrCreate"
containers:
- name: "keycloak-db"
image: "postgres:10-alpine"
env:
- name: POSTGRES_DATABASE
value: keycloak
- name: POSTGRES_USER
value: keycloak
- name: POSTGRES_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: keycloak-secrets
key: dbpwroot
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: keycloak-secrets
key: dbpw
volumeMounts:
- mountPath: "/var/lib/postgresql/data"
name: keycloak-db
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: keycloak
namespace: namespace-name
spec:
selector:
matchLabels:
service: keycloak
template:
metadata:
labels:
service: keycloak
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: performance
operator: In
values:
- high
containers:
- name: "keycloak"
image: "jboss/keycloak:9.0.2"
args:
- -b 0.0.0.0
- -Dkeycloak.profile.feature.docker=enabled
env:
- name: KEYCLOAK_LOGLEVEL
value: ALL
- name: PROXY_ADDRESS_FORWARDING
value: 'true'
- name: KEYCLOAK_USER
value: administrator
- name: KEYCLOAK_PASSWORD
valueFrom:
secretKeyRef:
name: keycloak-secrets
key: adminpw
- name: DB_VENDOR
value: postgres
- name: DB_ADDR
value: keycloak-db
- name: DB_USER
value: keycloak
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: keycloak-secrets
key: dbpw
ports:
- name: http
containerPort: 8080
---
kind: Service
apiVersion: v1
metadata:
name: keycloak-db
namespace: namespace-name
spec:
selector:
service: keycloak-db
ports:
- protocol: TCP
port: 5432
name: db
---
kind: Service
apiVersion: v1
metadata:
name: keycloak
namespace: namespace-name
spec:
selector:
service: keycloak
ports:
- protocol: TCP
port: 8080
name: http
---
kind: Ingress
apiVersion: networking.k8s.io/v1beta1
metadata:
name: keycloak
namespace: namespace-name
annotations:
kubernetes.io/ingress.class: traefik
traefik.frontend.passHostHeader: "false"
spec:
rules:
- host: keycloak.domain.tld
http:
paths:
- path: /
backend:
serviceName: keycloak
servicePort: http