Skip to content

Commit

Permalink
Add route for CNAME records for frontend and backend services
Browse files Browse the repository at this point in the history
  • Loading branch information
patchkez committed Feb 19, 2024
1 parent 6ea1016 commit d51fff8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
24 changes: 23 additions & 1 deletion ocp-templates/mpp/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ objects:
template:
metadata:
labels:
app: ibutsu-backend
app: ${APP_NAME}
spec:
containers:
- env:
Expand Down Expand Up @@ -174,6 +174,24 @@ objects:
to:
kind: Service
name: ibutsu-backend
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
description: A route to the backend
labels:
app: ${APP_NAME}
shard: internal
name: ibutsu-backend
namespace: ${NAMESPACE}
spec:
host: ${BACKEND_ROUTE_CNAME}
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: ibutsu-backend
- kind: Secret
apiVersion: v1
metadata:
Expand Down Expand Up @@ -225,6 +243,10 @@ parameters:
displayName: Backend Route
description: The URL of the backend of the Ibutsu server
value: ibutsu-api.example.com
- name: BACKEND_ROUTE_CNAME
displayName: Backend Route CNAME
description: The CNAME URL of the backend of the Ibutsu server
value: ibutsu-api.prod.com
- name: FRONTEND_ROUTE
displayName: Frontend Route
description: The URL of the frontend of the Ibutsu server
Expand Down
23 changes: 23 additions & 0 deletions ocp-templates/mpp/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,25 @@ objects:
insecureEdgeTerminationPolicy: Redirect
termination: edge
wildcardPolicy: None
- kind: Route
apiVersion: route.openshift.io/v1
metadata:
labels:
app: ${APP_NAME}
shard: internal
name: ibutsu-frontend-cname
namespace: ${NAMESPACE}
annotations:
description: "A route to the frontend"
spec:
host: ${FRONTEND_ROUTE_CNAME}
to:
kind: Service
name: ibutsu-frontend
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
wildcardPolicy: None
# ===============================================
# Parameters
# ===============================================
Expand All @@ -144,6 +163,10 @@ parameters:
displayName: Frontend Route
description: The URL of the frontend of the Ibutsu server
value: ibutsu.example.com
- name: FRONTEND_ROUTE_CNAME
displayName: Frontend Route
description: The CNAME URL of the frontend of the Ibutsu server
value: ibutsu.prod.com
- name: BACKEND_ROUTE
displayName: Backend Route
description: The URL of the backend of the Ibutsu server
Expand Down

0 comments on commit d51fff8

Please sign in to comment.