-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds gateway to expose internal services
This patch adds the common gateway (flex-gateway) in nginx-gateway namespace. This gateway will be shared by all other namespaces to expose services internally. To do so the service that is getting exposed internally simply need to follow the fqdn naming of *.sjc.ohthree.com and ref the flex-gateway. Also, adding the http routes for prometheus and alertmanager that use the above method to expose the two services internally.
- Loading branch information
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: alertmanger-gateway-route | ||
namespace: prometheus | ||
spec: | ||
parentRefs: | ||
- name: flex-gateway | ||
sectionName: http | ||
namespace: nginx-gateway | ||
hostnames: | ||
- "alertmanager.sjc.ohthree.com" | ||
rules: | ||
- backendRefs: | ||
- name: kube-prometheus-stack-alertmanager | ||
port: 9093 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: flex-gateway | ||
namespace: nginx-gateway | ||
spec: | ||
gatewayClassName: nginx | ||
listeners: | ||
- name: http | ||
port: 80 | ||
protocol: HTTP | ||
hostname: "*.sjc.ohthree.com" | ||
allowedRoutes: | ||
namespaces: | ||
from: All |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
resources: | ||
- internal-gateway-api.yaml # namespace: nginx-gateway (common gateway) | ||
- alertmanager-routes.yaml # namespace: prometheus | ||
- prometheus-routes.yaml # namespace: prometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: prometheus-gateway-route | ||
namespace: prometheus | ||
spec: | ||
parentRefs: | ||
- name: flex-gateway | ||
sectionName: http | ||
namespace: nginx-gateway | ||
hostnames: | ||
- "prometheus.sjc.ohthree.com" | ||
rules: | ||
- backendRefs: | ||
- name: kube-prometheus-stack-prometheus | ||
port: 9090 |