mullholland.envoy

Ansible role envoy

Installs an configures envoy

GitHub Downloads Version
github downloads Version

Example Playbook

This example is taken from molecule/default/converge.yml and is tested on each push, pull request and release.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true
  vars:
    envoy_systemd: true
    envoy_config:
      admin:
        address:
          socket_address: {address: 127.0.0.1, port_value: 9901}
      static_resources:
        listeners:
          - name: listener_0
            address:
              socket_address: {address: 127.0.0.1, port_value: 10000}
        filter_chains:
          - filters:
              - name: envoy.filters.network.http_connection_manager
                typed_config:
                  "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
                stat_prefix: ingress_http
                codec_type: AUTO
                route_config:
                  name: local_route
                virtual_hosts:
                  - name: local_service
                    domains: ["*"]
                    routes:
                      - match: {prefix: "/"}
                        route: {cluster: some_service}
                http_filters:
                  - name: envoy.filters.http.router
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
        clusters:
          - name: some_service
            connect_timeout: 0.25s
            type: STATIC
            lb_policy: ROUND_ROBIN
            load_assignment:
              cluster_name: some_service
              endpoints:
                - lb_endpoints:
                    - endpoint:
                        address:
                          socket_address:
                            address: 127.0.0.1
                            port_value: 1234

  roles:
    - role: "mullholland.envoy"

The machine needs to be prepared. In CI this is done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: true

  tasks:
    - name: Debian | Install xz-utils
      ansible.builtin.package:
        name: "xz-utils"
        state: present
      when: ansible_os_family == "Debian"

    - name: RedHat | Install xz
      ansible.builtin.package:
        name:
          - "xz"
          - "tar"
        state: present
      when: ansible_os_family == "RedHat"

Role Variables

The default values for the variables are set in defaults/main.yml:

---
envoy_bin_path: "/usr/local/bin"

# Disabled if installed as sidecar servie for example consul usage
# https://learn.hashicorp.com/tutorials/consul/consul-terraform-sync-intro?in=consul/network-infrastructure-automation#install-envoy-optional
envoy_conf_path: "/etc/envoy"

envoy_user: "envoy"
envoy_group: "envoy"
# wether envoy user should be a system user or not
envoy_system_user: true

# Download
# https://archive.tetratelabs.io/envoy/envoy-versions.json
envoy_version: "1.17.0"
envoy_architecture_map:
  amd64: amd64
  x86_64: amd64
  armv7l: arm
  aarch64: arm64
  32-bit: "386"
  64-bit: amd64
envoy_arch: "linux-{{ envoy_architecture_map[ansible_architecture] }}"
# optional
# clear if unused
# envoy_checksum: "sha256:fbd2460189f330a6b1e6b4ff79b4604dff1847091d4abbdda2c6b3894fadb396"
envoy_download_url: "https://archive.tetratelabs.io/envoy/download/v{{ envoy_version }}/envoy-v{{ envoy_version }}-{{ envoy_arch }}.tar.xz"
envoy_download_path: "/tmp/envoy-v{{ envoy_version }}-{{ envoy_arch }}.tar.xz"
envoy_unarchive_dest: "/tmp"
envoy_unarchive_creates: "/tmp/envoy-v{{ envoy_version }}-{{ envoy_arch }}/bin/envoy"

# Create a systemd servicefile
envoy_systemd: false

# will be used with `to_nice_yaml`
envoy_config: []
# admin:
#   address:
#     socket_address: { address: 127.0.0.1, port_value: 9901 }
# static_resources:
#   listeners:
#   - name: listener_0
#     address:
#       socket_address: { address: 127.0.0.1, port_value: 10000 }
#     filter_chains:
#     - filters:
#       - name: envoy.filters.network.http_connection_manager
#         typed_config:
#           "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
#           stat_prefix: ingress_http
#           codec_type: AUTO
#           route_config:
#             name: local_route
#             virtual_hosts:
#             - name: local_service
#               domains: ["*"]
#               routes:
#               - match: { prefix: "/" }
#                 route: { cluster: some_service }
#           http_filters:
#           - name: envoy.filters.http.router
#             typed_config:
#               "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
#   clusters:
#   - name: some_service
#     connect_timeout: 0.25s
#     type: STATIC
#     lb_policy: ROUND_ROBIN
#     load_assignment:
#       cluster_name: some_service
#       endpoints:
#       - lb_endpoints:
#         - endpoint:
#             address:
#               socket_address:
#                 address: 127.0.0.1
#                 port_value: 1234

Requirements

Context

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles: dependencies

Compatibility

This role has been tested on these container images:

container tags
EL 8, 9
Amazon Candidate
Fedora all
Ubuntu all
Debian all

The minimum version of Ansible required is 2.10, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

If you find issues, please register them in GitHub.

License

MIT.

Author Information

Mullholland

About

Installs an configures envoy

Install
ansible-galaxy install mullholland.envoy
GitHub repository
License
apache-2.0
Downloads
128