Search code examples
nginxgoogle-compute-enginegoogle-cloud-endpoints

Install Extensible Service Proxy on GCE/RHEL7


Quickstart for Endpoints on Compute Engine says

you need to run the Extensible Service Proxy before sending requests to the API

But it also says

This quickstart works only on Debian. Make sure you create a VM that runs Debian.

I have an existing GCE VM instance running Red Hat EL 7 that I'm adding this Endpoint to. Where are instructions for installing and running Extensible Service Proxy on it?

FWIW I examined the contents of the Debian package. It appears to be just nginx with custom configs and some extra scripts. If there's no RPM or other way of installing ESP on RHEL7, can I just manually install the contents extracted from the .deb package?


Solution

  • The instructions for installing the ESP are implied in the instructions for installing the Cloud SDK on Red Hat and CentOS, since the endpoints-runtime RPM is available from the same repo as is the SDK.

    $ sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
    [google-cloud-sdk]
    name=Google Cloud SDK
    baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
           https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
    EOM
    $ 
    $ sudo yum install google-cloud-sdk
    

    Note that the ESP installs as nginx, with supporting scripts and config files, that will replace any existing nginx and any files with the same name, which will overwrite any existing nginx functionality (like proxy, cache etc). It might be best to archive any host-specific nginx configs first, then install ESP, then merge old configs into the new ones installed by yum.