Lab 2.2 - Deploy Hello-World Using Ingress

Now that CIS is up and running, let’s deploy an application and leverage CIS.

For this lab we’ll use a simple pre-configured docker image called “f5-hello-world”. It can be found on docker hub at f5devcentral/f5-hello-world

App Deployment

On kube-master1 we will create all the required files:

  1. Create a file called deployment-hello-world.yaml


    Use the file in ~/agilitydocs/docs/class1/kubernetes

     1apiVersion: apps/v1
     2kind: Deployment
     4  name: f5-hello-world-web
     5  namespace: default
     7  replicas: 2
     8  selector:
     9    matchLabels:
    10      app: f5-hello-world-web
    11  template:
    12    metadata:
    13      labels:
    14        app: f5-hello-world-web
    15    spec:
    16      containers:
    17      - env:
    18        - name: service_name
    19          value: f5-hello-world-web
    20        image: f5devcentral/f5-hello-world:latest
    21        imagePullPolicy: IfNotPresent
    22        name: f5-hello-world-web
    23        ports:
    24        - containerPort: 8080
    25          protocol: TCP
  2. Create a file called clusterip-service-hello-world.yaml


    Use the file in ~/agilitydocs/docs/class1/kubernetes

     1apiVersion: v1
     2kind: Service
     4  name: f5-hello-world-web
     5  namespace: default
     6  labels:
     7    app: f5-hello-world-web
     8 AS3
     9 A1
    10 web_pool
    12  ports:
    13  - name: f5-hello-world-web
    14    port: 8080
    15    protocol: TCP
    16    targetPort: 8080
    17  type: ClusterIP
    18  selector:
    19    app: f5-hello-world-web
  3. Create a file called ingress-hello-world.yaml


    Use the file in ~/agilitydocs/docs/class1/kubernetes

     2kind: Ingress
     4  name: f5-hello-world-web
     5  namespace: default
     6  annotations:
     7 "kubernetes"
     9 "80"
    10 "false"
    11 "round-robin"
    12 |
    13      [
    14        {
    15          "path":     "",
    16          "send":     "HTTP GET /",
    17          "interval": 5,
    18          "timeout":  10
    19        }
    20      ]
    22  rules:
    23  - http:
    24      paths:
    25      - path: /
    26        pathType: Prefix
    27        backend:
    28          service:
    29            name: f5-hello-world-web
    30            port:
    31              number: 8080
  4. We can now launch our application:

    kubectl create -f deployment-hello-world.yaml
    kubectl create -f clusterip-service-hello-world.yaml
    kubectl create -f ingress-hello-world.yaml
  5. To check the status of our deployment, you can run the following commands:

    kubectl get pods -o wide
    kubectl describe svc f5-hello-world


    To understand and test the new app pay attention to the Endpoints value, this shows our 2 instances (defined as replicas in our deployment file) and the flannel IP assigned to the pod.

  6. Now that we have deployed our application sucessfully, we can check the configuration on BIG-IP1. Go back to the Deployment tab of your UDF lab session at and connect to BIG-IP1 using the TMUI access method.

  7. Login with username: admin and password: admin.

  8. Browse to: Local Traffic ‣ Virtual Servers


    Don’t forget to select the “kubernetes” partition or you’ll see nothing.

    Here you can see a new Virtual Server, “ingress_10.1.1.4_80” was created, listening on in partition “kubernetes”.

  9. Check the Pools to see a new pool and the associated pool members.

    Browse to: Local Traffic ‣ Pools and select the “ingress_default_f5-hello-world-web” pool. Click the Members tab.



    You can see that the pool members IP addresses are assigned from the overlay network (ClusterIP mode)

  10. Access your web application via Firefox on the superjump.


    Select the “Hello, World” shortcut or type in the URL field.

  11. To check traffic distribution, hit Refresh many times on your open browser session. Then go back to the open BIG-IP TMUI management console on firefox.

    Browse to: Local Traffic ‣ Pools ‣ Pool list ‣ ingress_default_f5-hello-world-web ‣ Statistics



    Are you seeing traffic distribution as shown in the image above? If not why? (HINT: Check the virtual server settings.)

  12. Delete Hello-World


    Do not skip this step. Instead of reusing some of these objects, the next lab we will re-deploy them to avoid conflicts and errors.

    kubectl delete -f ingress-hello-world.yaml
    kubectl delete -f clusterip-service-hello-world.yaml
    kubectl delete -f deployment-hello-world.yaml


    Validate the objects are removed via the management console. Local Traffic ‣ Virtual Servers