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.

97 lines
3.2 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. * `ingress_ambassador_multi_namespaces` (default `false`): By default, Ambassador will only
  15. watch the `ingress_ambassador_namespace` namespace for `AmbassadorInstallation` CRD resources.
  16. When set to `true`, this value will tell the Ambassador Operator to watch **all** namespaces
  17. for CRDs. If you want to run multiple Ambassador ingress instances, set this to `true`.
  18. ### Ingress annotations
  19. The Ambassador API Gateway will automatically load balance `Ingress` resources
  20. that include the annotation `kubernetes.io/ingress.class=ambassador`. All the other
  21. resources will be just ignored.
  22. ### Ambassador Operator
  23. This Ambassador addon deploys the Ambassador Operator, which in turn will install
  24. the [Ambassador API Gateway](https://github.com/datawire/ambassador) in
  25. a Kubernetes cluster.
  26. The Ambassador Operator is a Kubernetes Operator that controls Ambassador's complete lifecycle
  27. in your cluster, automating many of the repeatable tasks you would otherwise have to perform
  28. yourself. Once installed, the Operator will complete installations and seamlessly upgrade to new
  29. versions of Ambassador as they become available.
  30. ## Usage
  31. The following example creates simple http-echo services and an `Ingress` object
  32. to route to these services.
  33. Note well that the [Ambassador API Gateway](https://github.com/datawire/ambassador) will automatically load balance `Ingress` resources
  34. that include the annotation `kubernetes.io/ingress.class=ambassador`. All the other
  35. resources will be just ignored.
  36. ```yaml
  37. kind: Pod
  38. apiVersion: v1
  39. metadata:
  40. name: foo-app
  41. labels:
  42. app: foo
  43. spec:
  44. containers:
  45. - name: foo-app
  46. image: hashicorp/http-echo
  47. args:
  48. - "-text=foo"
  49. ---
  50. kind: Service
  51. apiVersion: v1
  52. metadata:
  53. name: foo-service
  54. spec:
  55. selector:
  56. app: foo
  57. ports:
  58. # Default port used by the image
  59. - port: 5678
  60. ---
  61. apiVersion: extensions/v1beta1
  62. kind: Ingress
  63. metadata:
  64. name: example-ingress
  65. annotations:
  66. kubernetes.io/ingress.class: ambassador
  67. spec:
  68. rules:
  69. - http:
  70. paths:
  71. - path: /foo
  72. backend:
  73. serviceName: foo-service
  74. servicePort: 5678
  75. ```
  76. Now you can test that the ingress is working with curl:
  77. ```console
  78. $ export AMB_IP=$(kubectl get service ambassador -n ambassador -o 'go-template={{range .status.loadBalancer.ingress}}{{print .ip "\n"}}{{end}}')
  79. $ curl $AMB_IP/foo
  80. foo
  81. ```