apiVersion: services.cloud.sap.com/v1alpha1
kind: ServiceInstance
metadata:
name: garouter-uaa
namespace: <your namespace>
spec:
serviceOfferingName: xsuaa
servicePlanName: application
externalName: garouter-uaa
parameters:
xsappname: <id>-garouter
tenant-mode: dedicated
oauth2-configuration:
redirect-uris:
- "https://<cluster domain>/login/callback"
scopes:
- name: "$XSAPPNAME.admin"
description: Admin
role-templates:
- name: admin
description: Admin
scope-references:
- "$XSAPPNAME.admin"
role-collections:
- name: Approuterkyma
description: kyma approuter role
role-template-references:
- "$XSAPPNAME.admin"
apiVersion: services.cloud.sap.com/v1alpha1
kind: ServiceBinding
metadata:
name: routerauth-binding
spec:
serviceInstanceName: garouter-uaa
secretName: routerauth-binding
externalName: garouter-uaa
{
"welcomeFile": "index.html",
"authenticationMethod": "route",
"routes": [
{
"source": "^/user-api(.*)",
"target": "$1",
"service": "sap-approuter-userapi",
"authenticationType": "xsuaa",
"scope": "$XSAPPNAME.Admin"
},
{
"source": "^/(.*)",
"authenticationType": "xsuaa",
"localDir": "resources"
}
]
}
FROM node:lts-alpine
ENV NODE_ENV=production
WORKDIR /usr/src/app
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
RUN npm install
COPY . .
EXPOSE 5000
RUN chown -R node /usr/src/app
USER node
CMD ["npm", "start"]
docker build --rm -f "Dockerfile" -t <your docker repo>/approuterinkyma:latest "." --no-cache
/etc/
/secrets/
/sapcp/
/hana/
| /hanaInst1/
| | /user1
| | /pass1
| /hanaInst2/
| /user2
| /pass2
/xsuaa/
/xsuaaInst/
/user
/pass
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: garouter
labels:
app: garouter
version: v1
spec:
replicas: 1
selector:
matchLabels:
app: garouter
version: v1
template:
metadata:
labels:
app: garouter
version: v1
spec:
containers:
- name: garouter
image: gopalanand/approuterinkyma:latest
imagePullPolicy: Always
resources:
limits:
cpu: "250m"
memory: "128Mi"
requests:
cpu: "250m"
memory: "128Mi"
ports:
- containerPort: 5000
volumeMounts:
- name: garouter-uaa
mountPath: "/etc/secrets/sapcp/xsuaa/garouter-uaa"
readOnly: true
volumes:
- name: garouter-uaa
secret:
secretName: routerauth-binding
---
apiVersion: v1
kind: Service
metadata:
name: garouter
labels:
app: garouter
service: garouter
spec:
ports:
- port: 5000
name: http
selector:
app: garouter
---
apiVersion: gateway.kyma-project.io/v1beta1
kind: APIRule
metadata:
name: garouter
spec:
gateway: kyma-gateway.kyma-system.svc.cluster.local
host: garouter.<your cluster host>
service:
name: garouter
port: 5000
rules:
- accessStrategies:
- config: {}
handler: allow
methods:
- GET
- POST
- PUT
- PATCH
- DELETE
- HEAD
path: /.*
kubectl apply -f deployment.yaml
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
39 | |
25 | |
17 | |
13 | |
7 | |
7 | |
7 | |
7 | |
6 | |
6 |