Envoy as Ingress, API and Function Gateway for Kubernetes with Gloo

Kubernetes users often need to allow traffic to flow from and to the cluster, and Envoy is great for that purpose. The open source project Gloo, which is built on top of Envoy, is designed for microservices, monoliths and also applications that might want to leverage function as a service. Gloo can decouple client APIs from upstream APIs at the routing level. In a simplistic way, Gloo is a great and easy to use tool to get traffic inside your Kubernetes cluster.

Continue reading for more information on how to get started with Gloo. This should only take a few minutes

Installing Gloo

For this installation, there are three main prerequisites:

  • Kubernetes version: Gloo requires version 1.8 or higher. Minikube is an easy way to get access to your own local Kubernetes installation.

  • kubectl: you need access to the kubectl command line tool.

  • glooctl: this is the Gloo command line tool which you will use to interact with the open source version of Gloo. Check the releases page under Gloo’s project repository to download the latest release. There you will find versions compatible with macOS and Linux.

Once all you have the above, all you need to do is run the following command:

  1. glooctl install kube

If you are familiar with Kubernetes, the command above will tell kubernetes what and how it should run the Gloo images. The Gloo pods should be running in a namespace called gloo-system.

Your output should look similar to this:

  1. namespace/gloo-system created
  2. customresourcedefinition.apiextensions.k8s.io/upstreams.gloo.solo.io created
  3. customresourcedefinition.apiextensions.k8s.io/virtualservices.gloo.solo.io created
  4. customresourcedefinition.apiextensions.k8s.io/roles.gloo.solo.io created
  5. customresourcedefinition.apiextensions.k8s.io/attributes.gloo.solo.io created
  6. configmap/ingress-config created
  7. clusterrole.rbac.authorization.k8s.io/gloo-role created
  8. clusterrole.rbac.authorization.k8s.io/gloo-discovery-role created
  9. clusterrolebinding.rbac.authorization.k8s.io/gloo-cluster-admin-binding created
  10. clusterrolebinding.rbac.authorization.k8s.io/gloo-discovery-cluster-admin-binding created
  11. clusterrole.rbac.authorization.k8s.io/gloo-knative-upstream-discovery-role created
  12. clusterrolebinding.rbac.authorization.k8s.io/gloo-knative-upstream-discovery-binding created
  13. deployment.apps/control-plane created
  14. service/control-plane created
  15. deployment.apps/function-discovery created
  16. deployment.apps/ingress created
  17. service/ingress created
  18. deployment.extensions/kube-ingress-controller created
  19. deployment.extensions/upstream-discovery created
  20. Gloo successfully installed.

Checking your Installation

For more details on what is running in the gloo-system namespace, run the following command:

  1. kubectl get all -n gloo-system

Your output should look similar to this:

  1. NAME READY STATUS RESTARTS AGE
  2. pod/control-plane-6fc6dc7545-xrllk 1/1 Running 0 11m
  3. pod/function-discovery-544c596dcd-gk8x7 1/1 Running 0 11m
  4. pod/ingress-64f75ccb7-4z299 1/1 Running 0 11m
  5. pod/kube-ingress-controller-665d59bc7d-t6lwk 1/1 Running 0 11m
  6. pod/upstream-discovery-74db4d7475-gqrst 1/1 Running 0 11m
  7. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
  8. service/control-plane ClusterIP 10.101.206.34 <none> 8081/TCP 11m
  9. service/ingress LoadBalancer 10.108.115.187 <pending> 8080:32608/TCP,8443:30634/TCP 11m
  10. NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
  11. deployment.apps/control-plane 1 1 1 1 11m
  12. deployment.apps/function-discovery 1 1 1 1 11m
  13. deployment.apps/ingress 1 1 1 1 11m
  14. deployment.apps/kube-ingress-controller 1 1 1 1 11m
  15. deployment.apps/upstream-discovery 1 1 1 1 11m
  16. NAME DESIRED CURRENT READY AGE
  17. replicaset.apps/control-plane-6fc6dc7545 1 1 1 11m
  18. replicaset.apps/function-discovery-544c596dcd 1 1 1 11m
  19. replicaset.apps/ingress-64f75ccb7 1 1 1 11m
  20. replicaset.apps/kube-ingress-controller-665d59bc7d 1 1 1 11m
  21. replicaset.apps/upstream-discovery-74db4d7475 1 1 1 11m

In case your pods are not in Running state, feel free to jump on the Gloo slack channel. The community will be able to assist you there.

What’s next?

For examples and more documentation on how to use the open source project Gloo, check the project page.