1
_______________________________________________________________________________________________________________
LAB 9
Objective: Deploy an Ingress controller, create an Ingress rule to reach a clusterIP type service.
inikube is in your lab folder (retrieve from
The manifest for an Ingress controller that works on m
Course [Link]. Just create the controller with kubectl:
Resources) and is called b
$ kubectl create -f [Link]
With the Ingress controller now running, you will repeat part of the lab from Chapter 8 and create an
Ingress rule as well.
To make this straightforward, check the manifest [Link]. You will see the manifest for a Pod, a
service that matches the pod labels, and an Ingress rule. Create it.
$ kubectl create -f [Link]
You will now see a running pod, a service, and an Ingress rule.
$ kubectl get ingress
NAME HOSTS ADDRESS PORTS AGE
nginx nginx.[Link].[Link] [Link] 80 3m
The manifest describing the Ingress is shown below:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx
spec:
____________________________________________________________________________________________________________
LFS258 Copyright 2017. The Linux Foundation. All rights reserved.
2
_______________________________________________________________________________________________________________
rules:
- host: nginx.[Link].[Link]
http:
paths:
- backend:
serviceName: nginx
servicePort: 80
This Ingress rule is used by the Ingress controller (started by the [Link] manifest) to
inikube). The rule will proxy
re-configure the nginx proxy running on the head node (in our case, m
requests for host nginx.[Link].[Link] to the internal service called n
ginx.
We use the [Link] service. It is a wildcard DNS service that is very handy for testing. It will resolve
nginx.[Link].[Link] to [Link] the IP of minikube. Note that you may
need to edit the Ingress rule manifest if the IP of your minikube is different.
Once the rule is implemented by the controller (could take O(10) s), open your browser at
ginx.
nginx.[Link].[Link] and enjoy n
Try to reproduce this with a ghost application.
____________________________________________________________________________________________________________
LFS258 Copyright 2017. The Linux Foundation. All rights reserved.