Deploying the Site24x7 PHP agent in a Kubernetes environment

How to deploy the Site24x7 PHP agent in a Kubernetes environment?

The following options are available for APM support in Kubernetes.

Without Helm charts:

1. You can include the installation script when building the container. This is similar to the docker installation method. For more information, please refer to our docker installation help documentation.

2. You can include the installation script in the Post Life Cycle hooks of Kubernetes YAML.

Add the following in the Kubernetes deployment YAML file,
  1. lifecycle:
  2.        preStop:
  3.            exec:
  4.                command: ["/bin/bash", "-c", "service zpdpsvc stop;"]
  5.         postStart:
  6.             exec:
  7.                 command: ["/bin/bash", "-c", "wget https://staticdownloads.site24x7.com/apminsight/scripts/s247apmphpinstall.sh && ./s247apmphpinstall.sh -key=<site24x7 license key> -appname=<App name to be shown in APM> ; /etc/init.d/apache2 reload ;" ]
The /etc/init.d/apache2 reload command in the above example is for Apache-based server. If you are using NGINX or FPM based server, you'll need to add the command kill -USR2 1.

With Helm charts:

3. If you are deploying with Helm, you can include the installation script in the Helm charts file.

Add the following to the template folder or deployment.yaml, or if you prefer to use values.yaml, configure as follows:
  1. site24x7:
  2.   apikey: <site24x7 license key>
  3.   appname: <App name to be shown in APM>
Use the following configuration in lifecycle hooks:
  1. lifecycle:
  2.       preStop:
  3.          exec:
  4.              command: ["/bin/bash", "-c", "service zpdpsvc stop;"]
  5.       postStart:
  6.           exec:
  7.                command: ["/bin/bash", "-c", "wget https://staticdownloads.site24x7.com/apminsight/scripts/s247apmphpinstall.sh && ./s247apmphpinstall.sh -key={{ .Values.site24x7.apikey }} -appname={{ .Values.site24x7.appname }} ; /etc/init.d/apache2 reload ;" ]
You can also keep the license keys in a configmap to avoid using them in the deployment files.


    • Related Articles

    • How to modify the APM Insight PHP agent's communication port?

      The agent uses ports 20021 and 20022 by default. You can change these ports by modifying the appropriate directive in the zpa.ini file (Linux) or php.ini file (Windows), as well as in the apminsight.conf file (Linux and Windows).   Default ...
    • Reconfigure APM Insight PHP agent during PHP version upgrade

      If you have upgraded your PHP version and face problems in monitoring after the upgrade, here's how you can resolve it.  In general, APM Insight PHP agent registers with the PHP version present in the server at the time of installation.  So when you ...
    • How to enable and disable distributed tracing in PHP applications?

      To enable distributed tracing, set the "zpa.capture distributed trace" directive to "1" in the zpa.ini (Linux) or php.ini (Windows). Similarly, to disable, set to "0."   To enable distributed tracing: In the zpa.ini (Linux) or php.ini (Windows), ...
    • How to rename an APM Insight application?

      Site24x7 APM Insight doesn't support renaming applications/monitors from the web client. However, the application name of an existing application instance can be renamed in the apminsight.conf file and the agent associated with that instance will ...
    • How to customize instrumentation in PHP agent?

      By default, the following components are tracked: CASSANDRA, CURL, MSSQL, MYSQL, ORACLE, PDO, and POSTGRES. These can be individually enabled or disabled by modifying the corresponding ini directive in the zpa.ini (Linux) or php.ini (Windows). ...