Created
June 6, 2022 16:53
-
-
Save rodrigoborgesdeoliveira/b193d1e54cff21f0e618221f7ce34dbd to your computer and use it in GitHub Desktop.
An example of an ingress setup for a gateway on an nginx ingress on kubernetes.
This file contains hidden or 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
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
annotations: | |
nginx.ingress.kubernetes.io/configuration-snippet: | | |
if ($http_env = "dev") { proxy_pass http://<service-name>.<service-namespace>.svc.cluster.local:<service-port>; } # Point directly to a service in the same cluster | |
if ($http_env = "staging") { proxy_pass https://staging.example.com; } # Or point to a URL | |
name: gateway | |
namespace: default | |
# Continue as usual pointing to the default service | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment