forked from SAP/cloud-security-services-integration-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yml
185 lines (181 loc) · 4.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---
### SERVICE INSTANCE CONFIGURATION ###
# Xsuaa instance
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: xsuaa-authn
spec:
serviceOfferingName: xsuaa
servicePlanName: application
parameters:
xsappname: spring-security-hybrid-usage
tenant-mode: dedicated
oauth2-configuration:
credential-types:
- x509
scopes:
- name: "$XSAPPNAME.Read"
description: Read Permissions.
role-templates:
- name: Viewer
description: View Data
scope-references:
- "$XSAPPNAME.Read"
role-collections:
- name: XSUAA-Viewer
description: Viewer (read)
role-template-references:
- "$XSAPPNAME.Viewer"
---
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
name: xsuaa-authn-binding
spec:
serviceInstanceName: xsuaa-authn
---
#Xsuaa Broker instance (Optional)
#apiVersion: services.cloud.sap.com/v1
#kind: ServiceInstance
#metadata:
# name: xsuaa-broker
#spec:
# serviceOfferingName: xsuaa
# servicePlanName: application
# parameters:
# xsappname: spring-security-hybrid-usage
# tenant-mode: dedicated
# oauth2-configuration:
# credential-types:
# - x509
# scopes:
# - name: "$XSAPPNAME.Read"
# description: Read Permissions.
# role-templates:
# - name: Viewer
# description: View Data
# scope-references:
# - "$XSAPPNAME.Read"
# role-collections:
# - name: XSUAA-Viewer
# description: Viewer (read)
# role-template-references:
# - "$XSAPPNAME.Viewer"
#---
#apiVersion: services.cloud.sap.com/v1
#kind: ServiceBinding
#metadata:
# name: xsuaa-broker-binding
#spec:
# serviceInstanceName: xsuaa-broker
---
# IAS instance
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: ias-authn
spec:
serviceOfferingName: identity
servicePlanName: application
parameters:
credential-type: "X509_GENERATED"
---
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
name: ias-service-binding
spec:
serviceInstanceName: ias-authn
parameters:
credential-type: "X509_GENERATED"
---
### APPLICATION CONFIGURATION ###
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: spring-security-hybrid-usage
kyma-grafana: enabled
name: spring-security-hybrid-usage
spec:
replicas: 1
selector:
matchLabels:
app: spring-security-hybrid-usage
template:
metadata:
labels:
app: spring-security-hybrid-usage
kyma-grafana: enabled
spec:
containers:
- image: <YOUR IMAGE REPOSITORY>
env:
- name: SERVICE_BINDING_ROOT
value: "/bindings"
imagePullPolicy: Always
name: spring-security-hybrid-usage
ports:
- name: http
containerPort: 8080
volumeMounts:
- name: xsuaa
mountPath: "/bindings/xsuaa-authn"
readOnly: true
# - name: xsuaa-broker
# mountPath: "/bindings/xsuaa-broker"
# readOnly: true
- name: ias-authn
mountPath: "/bindings/ias-authn"
readOnly: true
volumes:
- name: xsuaa
secret:
secretName: xsuaa-authn-binding
# - name: xsuaa-broker
# secret:
# secretName: xsuaa-broker-binding
- name: ias-authn
secret:
secretName: ias-service-binding
---
apiVersion: v1
kind: Service
metadata:
labels:
app: spring-security-hybrid-usage
name: spring-security-hybrid-usage
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 8080
selector:
app: spring-security-hybrid-usage
---
apiVersion: gateway.kyma-project.io/v1beta1
kind: APIRule
metadata:
name: spring-security-hybrid-api
labels:
app: spring-security-hybrid-usage
spec:
gateway: kyma-gateway.kyma-system.svc.cluster.local
host: spring-security-hybrid-api
rules:
- accessStrategies:
- config: {}
handler: allow
methods:
- GET
- POST
- PUT
- PATCH
- DELETE
- HEAD
path: /.*
service:
name: spring-security-hybrid-usage
port: 80