Hands-On Kubernetes on Azure - Second Edition by Nills Franssens Shivakumar Gopalakrishnan and Gunther Lenz

Hands-On Kubernetes on Azure - Second Edition by Nills Franssens Shivakumar Gopalakrishnan and Gunther Lenz

Author:Nills Franssens, Shivakumar Gopalakrishnan, and Gunther Lenz
Language: eng
Format: epub
Publisher: Packt Publishing Pvt. Ltd.
Published: 2020-05-12T00:00:00+00:00


Next, we will create an Ingress so that any URL that goes to handsonaks-ingress-<yourname>.<your azure region>.cloudapp.azure.com/oauth will be redirected to the oauth2-proxy service. The same Let's Encrypt certificate issuer is used here (the oauth2_ingress.yaml file in the source code for this chapter):1 apiVersion: extensions/v1beta1

2 kind: Ingress

3 metadata:

4 name: oauth2-proxy-ingress

5 annotations:

6 kubernetes.io/ingress.class: nginx

7 cert-manager.io/issuer: "letsencrypt-prod"

8 spec:

9 tls:

10 - hosts:

11 - <your DNS prefix>.<your azure region>.cloudapp.azure.com

12 secretName: tls-secret

13 rules:

14 - host: <your DNS prefix>.<your azure region>.cloudapp.azure.com

15 http:

16 paths:

17 - path: /oauth2

18 backend:

19 serviceName: oauth2-proxy

20 servicePort: 4180

There is one interesting line to point out in this Ingress. Line 17 introduced a new path to our Ingress. As mentioned earlier in this chapter, the same Ingress can have multiple paths being directed to different back-end services. This is what we are configuring here.

Create this Ingress by using the following command:

kubectl create -f oauth2_ingress.yaml



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.