Skip to content

Commit 04c1c2c

Browse files
author
Carlos Lapao
committed
wip
1 parent 9f140a3 commit 04c1c2c

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
kind: ConfigMap
2+
apiVersion: v1
3+
metadata:
4+
name: {{ include "restapi-testapp.fullname" . }}
5+
namespace: {{ .Values.namespace.name }}
6+
data:
7+
API_PORT: {{ .Values.ports.http | quote }}
8+
TLS_API_PORT: {{ .Values.ports.tls | quote }}
9+
TLS: {{ .Values.ports.tlsEnabled | quote }}
10+
API_PREFIX: {{ .Values.ingress.routePrefix |quote }}

helm-charts/restapi-testapp/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ spec:
2626
limits: {cpu: "250m", memory: "50Mi"}
2727
env:
2828
- name: RESTAPI_API_PORT
29-
value: {{ .Values.apiPort | quote }}
29+
value: {{ .Values.ports.http | quote }}
3030
dnsPolicy: ClusterFirstWithHostNet
3131
restartPolicy: Always

helm-charts/restapi-testapp/templates/virtualservice.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{ $namespace := .Values.namespace.name }}
22
{{ $fullname := include "restapi-testapp.fullname" .}}
3+
{{ $routePrefix := .Values.ingress.routePrefix }}
34
{{ if and (eq .Values.ingress.ingressClass "istio") (.Values.ingress.enabled) }}
45
apiVersion: networking.istio.io/v1beta1
56
kind: VirtualService
@@ -17,7 +18,7 @@ spec:
1718
- name: {{ .name }}
1819
match:
1920
- uri:
20-
prefix: {{ .route }}
21+
prefix: {{if not (hasPrefix "/" $routePrefix) }}/{{end}}{{ $routePrefix }}/{{ .route }}
2122
route:
2223
- destination:
2324
host: {{$fullname}}.{{$namespace}}.svc.cluster.local
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
apiPort: 10000
21
replicaCount: 1
32
service:
4-
port: 80
3+
http: 80
4+
tls: 443
55
namespace:
6-
name: demo
76
create: true
7+
name: demo
88
serviceAccount:
99
create: true
1010
autoscaling:
@@ -13,13 +13,20 @@ autoscaling:
1313
maxReplicas: 5
1414
targetCPUUtilizationPercentage: 30
1515
targetMemoryUtilizationPercentage: 75
16+
tlsEnabled: true
1617
ingress:
1718
enabled: true
18-
ingressClass: istio
19-
gateway: proxy
20-
tls: true
19+
ingressClass: 'istio'
20+
gateway: 'proxy'
21+
routePrefix: '/api'
2122
hosts:
2223
- host: 'test.local-cluster.internal'
2324
paths:
24-
- name: "hello"
25-
route: "/hello"
25+
- name: "hello-world"
26+
route: "hello"
27+
- name: "auth"
28+
route: "auth"
29+
- name: "login-route"
30+
route: "login"
31+
- name: "validate-route"
32+
route: "validate"

0 commit comments

Comments
 (0)