forked from SAP-samples/multi-cloud-html5-apps-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yaml
198 lines (190 loc) · 4.77 KB
/
deployment.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
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
186
187
188
189
190
191
192
193
194
195
196
197
198
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
labels:
app: backend
spec:
replicas: 1
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- image: ghcr.io/sap-samples/kyma-simple-backend:latest
imagePullPolicy: Always
name: backend
volumeMounts:
- name: xsuaa-volume
mountPath: /etc/secrets/sapcp/xsuaa/kyma-xsuaa-instance
readOnly: true
volumes:
- name: xsuaa-volume
secret:
secretName: kyma-xsuaa-binding
---
apiVersion: v1
kind: Service
metadata:
labels:
app: backend
name: backend-svc
spec:
type: NodePort
ports:
- port: 5000
selector:
app: backend
---
apiVersion: gateway.kyma-project.io/v1beta1
kind: APIRule
metadata:
labels:
app: backend
name: backend
spec:
gateway: kyma-system/kyma-gateway
host: backend
service:
name: backend-svc
port: 5000
rules:
- path: /.*
methods: ["GET", "POST"]
accessStrategies:
- handler: noop
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: html5appdeployer
labels:
app: html5appdeployer
spec:
replicas: 1
selector:
matchLabels:
app: html5appdeployer
template:
metadata:
labels:
app: html5appdeployer
spec:
containers:
- image: ghcr.io/sap-samples/kyma-html5-app-deployer:latest
imagePullPolicy: Always
name: html5appdeployer
volumeMounts:
- name: html5-repo-app-host-volume
mountPath: /etc/secrets/sapcp/html5-apps-repo/kyma-app-host-instance
readOnly: true
- name: xsuaa-volume
mountPath: /etc/secrets/sapcp/xsuaa/kyma-xsuaa-instance
readOnly: true
- name: destination-volume
mountPath: /etc/secrets/sapcp/destination/kyma-destination-instance
readOnly: true
env:
- name: SAP_CLOUD_SERVICE
value: "business.service"
- name: BACKEND_DESTINATIONS
value: "[{
\"Name\":\"token-service\",
\"Description\":\"my kyma backend\",
\"Type\":\"HTTP\",
\"ProxyType\":\"Internet\",
\"URL\":\"https://backend.<clusterId>.stage.kyma.ondemand.com\",
\"Authentication\":\"NoAuthentication\",
\"HTML5.forwardAuthToken\": true}]"
volumes:
- name: html5-repo-app-host-volume
secret:
secretName: kyma-app-host-binding
- name: xsuaa-volume
secret:
secretName: kyma-xsuaa-binding
- name: destination-volume
secret:
secretName: kyma-destination-binding
---
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: kyma-xsuaa-instance
spec:
serviceOfferingName: xsuaa
servicePlanName: application
parameters:
xsappname: kyma-app
tenant-mode: shared
scopes:
- name: "$XSAPPNAME.Callback"
description: "With this scope set, the callbacks for tenant onboarding, offboarding and getDependencies can be called."
grant-as-authority-to-apps :
- $XSAPPNAME(application,sap-provisioning,tenant-onboarding)
role-templates:
- name: TOKEN_EXCHANGE
description: Token exchange
scope-references:
- uaa.user
- name: "MultitenancyCallbackRoleTemplate"
description: "Call callback-services of applications"
scope-references:
- "$XSAPPNAME.Callback"
oauth2-configuration:
grant-types:
- authorization_code
- client_credentials
- password
- refresh_token
- urn:ietf:params:oauth:grant-type:saml2-bearer
- user_token
- client_x509
- urn:ietf:params:oauth:grant-type:jwt-bearer
redirect-uris:
- https://*/**
---
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
name: kyma-xsuaa-binding
spec:
serviceInstanceName: kyma-xsuaa-instance
---
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: kyma-app-host-instance
spec:
serviceOfferingName: html5-apps-repo
servicePlanName: app-host
---
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
name: kyma-app-host-binding
spec:
serviceInstanceName: kyma-app-host-instance
---
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: kyma-destination-instance
spec:
serviceOfferingName: destination
servicePlanName: lite
parameters:
HTML5Runtime_enabled: true
version: "1.0.0"
---
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
name: kyma-destination-binding
spec:
serviceInstanceName: kyma-destination-instance