You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.6 KiB

  1. # Ambassador
  2. The [Ambassador API Gateway](https://github.com/datawire/ambassador) provides all the functionality of a traditional ingress controller
  3. (e.g., path-based routing) while exposing many additional capabilities such as authentication,
  4. URL rewriting, CORS, rate limiting, and automatic metrics collection.
  5. ## Installation
  6. ### Configuration
  7. * `ingress_ambassador_namespace` (default `ambassador`): namespace for installing Ambassador.
  8. * `ingress_ambassador_update_window` (default `0 0 * * SUN`): _crontab_-like expression
  9. for specifying when the Operator should try to update the Ambassador API Gateway.
  10. * `ingress_ambassador_version` (default: `*`): SemVer rule for versions allowed for
  11. installation/updates.
  12. * `ingress_ambassador_secure_port` (default: 443): HTTPS port to listen at.
  13. * `ingress_ambassador_insecure_port` (default: 80): HTTP port to listen at.
  14. ### Ambassador Operator
  15. This Ambassador addon deploys the Ambassador Operator, which in turn will install
  16. the [Ambassador API Gateway](https://github.com/datawire/ambassador) in
  17. a Kubernetes cluster.
  18. The Ambassador Operator is a Kubernetes Operator that controls Ambassador's complete lifecycle
  19. in your cluster, automating many of the repeatable tasks you would otherwise have to perform
  20. yourself. Once installed, the Operator will complete installations and seamlessly upgrade to new
  21. versions of Ambassador as they become available.
  22. ## Usage
  23. The following example creates simple http-echo services and an `Ingress` object
  24. to route to these services.
  25. Note well that the [Ambassador API Gateway](https://github.com/datawire/ambassador) will automatically load balance `Ingress` resources
  26. that include the annotation `kubernetes.io/ingress.class=ambassador`. All the other
  27. resources will be just ignored.
  28. ```yaml
  29. kind: Pod
  30. apiVersion: v1
  31. metadata:
  32. name: foo-app
  33. labels:
  34. app: foo
  35. spec:
  36. containers:
  37. - name: foo-app
  38. image: hashicorp/http-echo
  39. args:
  40. - "-text=foo"
  41. ---
  42. kind: Service
  43. apiVersion: v1
  44. metadata:
  45. name: foo-service
  46. spec:
  47. selector:
  48. app: foo
  49. ports:
  50. # Default port used by the image
  51. - port: 5678
  52. ---
  53. apiVersion: extensions/v1beta1
  54. kind: Ingress
  55. metadata:
  56. name: example-ingress
  57. annotations:
  58. kubernetes.io/ingress.class: ambassador
  59. spec:
  60. rules:
  61. - http:
  62. paths:
  63. - path: /foo
  64. backend:
  65. serviceName: foo-service
  66. servicePort: 5678
  67. ```
  68. Now you can test that the ingress is working with curl:
  69. ```console
  70. $ export AMB_IP=$(kubectl get service ambassador -n ambassador -o 'go-template={{range .status.loadBalancer.ingress}}{{print .ip "\n"}}{{end}}')
  71. $ curl $AMB_IP/foo
  72. foo
  73. ```