Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Latest commit

 

History

History
153 lines (122 loc) · 17.4 KB

README.md

File metadata and controls

153 lines (122 loc) · 17.4 KB

APM Server Helm Chart

This functionality is in alpha and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Alpha features are not subject to the support SLA of official GA features.

This helm chart is a lightweight way to configure and run our official APM Server docker image.

Requirements

  • Kubernetes >= 1.9
  • Helm >= 2.8.0

Usage notes and getting started

  • The default APM Server configuration file for this chart is configured to use an Elasticsearch endpoint as configured by the rest of these helm charts. This can easily be overridden in the config value apmConfig.apm-server.yml.
  • Automated testing of this chart is currently only run against GKE (Google Kubernetes Engine).

Installing

  • Add the elastic helm charts repo
    helm repo add elastic https://helm.elastic.co
    
  • Install it
    helm install --name apm-server elastic/apm-server
    

Using master branch

  • Clone the git repo
    git clone git@github.com:elastic/helm-charts.git
    
  • Install it
    helm install --name apm-server ./helm-charts/apm-server
    

Compatibility

This chart is tested with the latest supported versions. The currently tested versions are:

6.x 7.x
6.8.8 7.6.2

Examples of installing older major versions can be found in the examples directory.

While only the latest releases are tested, it is possible to easily install old or new releases by overriding the imageTag. To install version 7.6.2 of APM Server it would look like this:

helm install --name apm-server elastic/apm-server --set imageTag=7.6.2

Configuration

Parameter Description Default
apmConfig Allows you to add any config files in /usr/share/apm-server/config such as apm-server.yml. See values.yaml for an example of the formatting with the default configuration. see values.yaml
replicas Number of APM servers to run 1
extraContainers Templatable string of additional containers to be passed to the tpl function ""
extraInitContainers Templatable string of additional containers to be passed to the tpl function ""
extraEnvs Extra environment variables which will be appended to the env: definition for the container []
extraVolumeMounts List of additional volumeMounts []
extraVolumes List of additional volumes []
image The APM Server docker image docker.elastic.co/apm/apm-server
imageTag The APM Server docker image tag 7.6.2
imagePullPolicy The Kubernetes imagePullPolicy value IfNotPresent
imagePullSecrets Configuration for imagePullSecrets so that you can use a private registry for your image []
managedServiceAccount Whether the serviceAccount should be managed by this helm chart. Set this to false in order to manage your own service account and related roles. true
podAnnotations Configurable annotations applied to all APM Server pods {}
labels Configurable label applied to all APM server pods {}
podSecurityContext Configurable podSecurityContext for APM Server pod execution environment runAsUser: 0
privileged: false
livenessProbe Parameters to pass to liveness probe checks for values such as timeouts and thresholds. failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 3
timeoutSeconds: 5
readinessProbe Parameters to pass to readiness probe checks for values such as timeouts and thresholds. failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 3
timeoutSeconds: 5
resources Allows you to set the resources for the Deployment requests.cpu: 100m
requests.memory: 100Mi
limits.cpu: 1000m
limits.memory: 200Mi
serviceAccount Custom serviceAccount that APM Server will use during execution. By default will use the service account created by this chart. ""
secretMounts Allows you easily mount a secret as a file inside the Deployment. Useful for mounting certificates and other secrets. See values.yaml for an example []
terminationGracePeriod Termination period (in seconds) to wait before killing APM Server pod process on pod shutdown 30
tolerations Configurable tolerations []
nodeSelector Configurable nodeSelector {}
affinity Configurable affinity {}
priorityClassName The name of the PriorityClass. No default is supplied as the PriorityClass must be created first. ""
updateStrategy Allows you to change the default update strategy for the deployment. RollingUpdate
autoscaling.enabled Enable the pod horizonatal auto scaler false
ingress Configurable ingress to expose the APM Server service. See values.yaml for an example enabled: false
service Configurable service to expose the APM Server service. See values.yaml for an example type: ClusterIP
port: 8200
nodePort:
annotations: {}
lifecycle Configurable livecycle hooks false
nameOverride Overrides the chart name for resources. If not set the name will default to .Chart.Name ""
fullnameOverride Overrides the full name of the resources. If not set the name will default to .Release.Name-.Values.nameOverride or .Chart.Name ""

Examples

In examples/ you will find some example configurations. These examples are used for the automated testing of this helm chart.

Default

  • Deploy the default Elasticsearch helm chart
  • Deploy APM Server with the default values
    cd examples/default
    make
    
  • You can now setup a port forward for Elasticsearch to observe APM indices
    kubectl port-forward svc/elasticsearch-master 9200
    curl localhost:9200/_cat/indices
    

Testing

This chart uses pytest to test the templating logic. The dependencies for testing can be installed from the requirements.txt in the parent directory.

pip install -r ../requirements.txt
make pytest

You can also use helm template to look at the YAML being generated

make template

It is possible to run all of the tests and linting inside of a docker container

make test

Integration Testing

Integration tests are run using goss which is a serverspec like tool written in golang. See goss.yaml for an example of what the tests look like.

To run the goss tests against the default example:

cd examples/default
make goss