1 const sharedIngress = (
2 category: string,
3 fullName: string
4 ): NetworkingV1beta1Ingress => ({
5 apiVersion: 'networking.k8s.io/v1beta1',
6 kind: 'Ingress',
7 metadata: {
8 annotations: {
9 'nginx.ingress.kubernetes.io/rewrite-target': '/$2',
10 },
11 },
12 spec: {
13 rules: [
14 {
15 host: 'xxx',
16 http: {
17 paths: [
18 {
19 path: `/documents/${name}/${category}(/|$)(.*)`,
20 backend: {
21 serviceName: fullName,
22 servicePort: 80 as any,
23 },
24 },
25 ],
26 },
27 },
28 ],
29 },
30 });Created on 6/21/2020