some unfinished and untested work over helm mirror
This commit is contained in:
2
config/helm/scraper/test/.helmignore
Normal file
2
config/helm/scraper/test/.helmignore
Normal file
@@ -0,0 +1,2 @@
|
||||
tests/
|
||||
.pytest_cache/
|
||||
12
config/helm/scraper/test/Chart.yaml
Normal file
12
config/helm/scraper/test/Chart.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
appVersion: 8.5.1
|
||||
description: Official Elastic helm chart for Elastic APM Server
|
||||
home: https://github.com/elastic/helm-charts
|
||||
icon: https://helm.elastic.co/icons/apm.png
|
||||
maintainers:
|
||||
- email: helm-charts@elastic.co
|
||||
name: Elastic
|
||||
name: apm-server
|
||||
sources:
|
||||
- https://github.com/elastic/apm
|
||||
version: 8.5.1
|
||||
1
config/helm/scraper/test/Makefile
Normal file
1
config/helm/scraper/test/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
include ../helpers/common.mk
|
||||
183
config/helm/scraper/test/README.md
Normal file
183
config/helm/scraper/test/README.md
Normal file
@@ -0,0 +1,183 @@
|
||||
# APM Server Helm Chart
|
||||
|
||||
[](https://devops-ci.elastic.co/job/elastic+helm-charts+main/) [](https://artifacthub.io/packages/search?repo=elastic)
|
||||
|
||||
This Helm chart is a lightweight way to configure and run our official
|
||||
[APM Server Docker image][].
|
||||
|
||||
> **Warning**
|
||||
> When it comes to running the Elastic on Kubernetes infrastructure, we
|
||||
> recommend [Elastic Cloud on Kubernetes][] (ECK) as the best way to run and manage
|
||||
> the Elastic Stack.
|
||||
>
|
||||
> ECK offers many operational benefits for both our basic-tier and our
|
||||
> enterprise-tier customers, such as spinning up cluster nodes that were lost on
|
||||
> failed infrastructure, seamless upgrades, rolling cluster changes, and much
|
||||
> much more.
|
||||
>
|
||||
> With the release of the Elastic Stack Helm charts for Elastic version 8.5.1,
|
||||
> we are handing over the ongoing maintenance of our Elastic Stack Helm charts
|
||||
> to the community and contributors. This repository will finally be archived
|
||||
> after 6 months time. Elastic Stacks deployed on Kubernetes through Helm charts
|
||||
> will still be fully supported under EOL limitations.
|
||||
>
|
||||
> Since we want to provide an even better experience for our customers by
|
||||
> running the Elastic Stack on Kubernetes, we will continue maintaining the
|
||||
> Helm charts applicable to ECK Custom Resources. These charts can be found in
|
||||
> the [ECK repository][eck-charts].
|
||||
>
|
||||
> Helm charts will currently be maintained for ECK Enterprise-tier customers,
|
||||
> however, we encourage the community to engage with the existing Helm charts
|
||||
> for the Elastic Stack and continue supporting their ongoing maintenance.
|
||||
>
|
||||
> See <https://github.com/elastic/helm-charts/issues/1731> for more details.
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
|
||||
|
||||
- [Requirements](#requirements)
|
||||
- [Installing](#installing)
|
||||
- [Install a released version using the Helm repository](#install-a-released-version-using-the-helm-repository)
|
||||
- [Install a development version using the main branch](#install-a-development-version-using-the-main-branch)
|
||||
- [Upgrading](#upgrading)
|
||||
- [Usage notes](#usage-notes)
|
||||
- [Configuration](#configuration)
|
||||
- [FAQ](#faq)
|
||||
- [How to use APM Server with Elasticsearch with security (authentication and TLS) enabled?](#how-to-use-apm-server-with-elasticsearch-with-security-authentication-and-tls-enabled)
|
||||
- [Contributing](#contributing)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- Use this to update TOC: -->
|
||||
<!-- docker run --entrypoint doctoc --rm -it -v $(pwd):/usr/src jorgeandrada/doctoc README.md --github --no-title -->
|
||||
|
||||
|
||||
## Requirements
|
||||
|
||||
See [supported configurations][] for more details.
|
||||
|
||||
|
||||
## Installing
|
||||
|
||||
### Install a released version using the Helm repository
|
||||
|
||||
* Add the Elastic Helm charts repo:
|
||||
`helm repo add elastic https://helm.elastic.co`
|
||||
|
||||
* Install it `helm install apm-server elastic/apm-server`
|
||||
|
||||
|
||||
### Install a development version using the main branch
|
||||
|
||||
* Clone the git repo: `git clone git@github.com:elastic/helm-charts.git`
|
||||
|
||||
* Install it: `helm install apm-server ./helm-charts/apm-server --set imageTag=8.5.1`
|
||||
|
||||
|
||||
## Upgrading
|
||||
|
||||
Please always check [CHANGELOG.md][] and [BREAKING_CHANGES.md][] before
|
||||
upgrading to a new chart version.
|
||||
|
||||
|
||||
## Usage notes
|
||||
|
||||
* 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).
|
||||
|
||||
* This repo includes several [examples][] of configurations that can be used as a
|
||||
reference. They are also used in the automated testing of this chart.
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
|
||||
| `affinity` | Configurable [affinity][] | `{}` |
|
||||
| `apmConfig` | Allows you to add any config files in `/usr/share/apm-server/config` such as `apm-server.yml` | see [values.yaml][] |
|
||||
| `autoscaling` | Enable the [horizontal pod autoscaler][] | see [values.yaml][] |
|
||||
| `envFrom` | Templatable string to be passed to the [environment from variables][] which will be appended to the `envFrom:` definition for the container | `[]` |
|
||||
| `extraContainers` | 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 | see [values.yaml][] |
|
||||
| `extraInitContainers` | Templatable string of additional containers to be passed to the `tpl` function | `""` |
|
||||
| `extraVolumeMounts` | List of additional `volumeMounts` | `[]` |
|
||||
| `extraVolumes` | List of additional `volumes` | `[]` |
|
||||
| `fullnameOverride` | Overrides the full name of the resources. If not set the name will default to `.Release.Name` - `.Values.nameOverride` or `.Chart.Name` | `""` |
|
||||
| `hostAliases` | Configurable [hostAliases][] | `[]` |
|
||||
| `imagePullPolicy` | The Kubernetes [imagePullPolicy][] value | `IfNotPresent` |
|
||||
| `imagePullSecrets` | Configuration for [imagePullSecrets][] so that you can use a private registry for your image | `[]` |
|
||||
| `imageTag` | The APM Server Docker image tag | `8.5.1` |
|
||||
| `image` | The APM Server Docker image | `docker.elastic.co/apm/apm-server` |
|
||||
| `ingress` | Configurable [ingress][] to expose the APM Server service | see [values.yaml][] |
|
||||
| `labels` | Configurable [labels][] applied to all APM server pods | `{}` |
|
||||
| `lifecycle` | Configurable [lifecycle hooks][] | `false` |
|
||||
| `livenessProbe` | Parameters to pass to liveness [probe][] checks for values such as timeouts and thresholds | see [values.yaml][] |
|
||||
| `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` |
|
||||
| `nameOverride` | Overrides the chart name for resources. If not set the name will default to `.Chart.Name` | `""` |
|
||||
| `nodeSelector` | Configurable [nodeSelector][] | `{}` |
|
||||
| `podAnnotations` | Configurable [annotations][] applied to all APM Server pods | `{}` |
|
||||
| `podSecurityContext` | Configurable [podSecurityContext][] for APM Server pod execution environment | see [values.yaml][] |
|
||||
| `priorityClassName` | The name of the [PriorityClass][]. No default is supplied as the `PriorityClass` must be created first | `""` |
|
||||
| `readinessProbe` | Parameters to pass to readiness [probe][] checks for values such as timeouts and thresholds | see [values.yaml][] |
|
||||
| `replicas` | Number of APM servers to run | `1` |
|
||||
| `resources` | Allows you to set the [resources][] for the `Deployment` | see [values.yaml][] |
|
||||
| `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 | `[]` |
|
||||
| `serviceAccount` | Custom [serviceAccount][] that APM Server will use during execution. By default will use the `serviceAccount` created by this chart | `""` |
|
||||
| `serviceAccountAnnotations` | Annotations to be added to the ServiceAccount that is created by this chart. | `{}` |
|
||||
| `service` | Configurable [service][] to expose the APM Server service. See [values.yaml][] for an example | see [values.yaml][] |
|
||||
| `terminationGracePeriod` | Termination period (in seconds) to wait before killing APM Server pod process on pod shutdown | `30` |
|
||||
| `tolerations` | Configurable [tolerations][] | `[]` |
|
||||
| `updateStrategy` | Allows you to change the default [updateStrategy][] for the deployment | see [values.yaml][] |
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### How to use APM Server with Elasticsearch with security (authentication and TLS) enabled?
|
||||
|
||||
This Helm chart can use existing [Kubernetes secrets][] to setup
|
||||
credentials or certificates for examples. These secrets should be created
|
||||
outside of this chart and accessed using [environment variables][] and volumes.
|
||||
|
||||
An example can be found in [examples/security][].
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
Please check [CONTRIBUTING.md][] before any contribution or for any questions
|
||||
about our development and testing process.
|
||||
|
||||
[affinity]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
[annotations]: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
[apm server docker image]: https://www.elastic.co/guide/en/apm/server/current/running-on-docker.html
|
||||
[BREAKING_CHANGES.md]: https://github.com/elastic/helm-charts/blob/main/BREAKING_CHANGES.md
|
||||
[CHANGELOG.md]: https://github.com/elastic/helm-charts/blob/main/CHANGELOG.md
|
||||
[CONTRIBUTING.md]: https://github.com/elastic/helm-charts/blob/main/CONTRIBUTING.md
|
||||
[eck-charts]: https://github.com/elastic/cloud-on-k8s/tree/master/deploy
|
||||
[elastic cloud on kubernetes]: https://github.com/elastic/cloud-on-k8s
|
||||
[environment from variables]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables
|
||||
[environment variables]: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config
|
||||
[examples]: https://github.com/elastic/helm-charts/tree/main/apm-server/examples
|
||||
[examples/security]: https://github.com/elastic/helm-charts/tree/main/apm-server/examples/security
|
||||
[horizontal pod autoscaler]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
|
||||
[hostAliases]: https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
|
||||
[imagePullPolicy]: https://kubernetes.io/docs/concepts/containers/images/#updating-images
|
||||
[imagePullSecrets]: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-pod-that-uses-your-secret
|
||||
[ingress]: https://kubernetes.io/docs/concepts/services-networking/ingress/
|
||||
[kubernetes secrets]: https://kubernetes.io/docs/concepts/configuration/secret/
|
||||
[labels]: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
[lifecycle hooks]: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/
|
||||
[nodeSelector]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
[podSecurityContext]: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
|
||||
[priorityClass]: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
|
||||
[probe]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
|
||||
[resources]: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
||||
[service]: https://kubernetes.io/docs/concepts/services-networking/service/
|
||||
[serviceAccount]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||
[supported configurations]: https://github.com/elastic/helm-charts/tree/main/README.md#supported-configurations
|
||||
[tolerations]: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
[updateStrategy]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment
|
||||
[values.yaml]: https://github.com/elastic/helm-charts/tree/main/apm-server/values.yaml
|
||||
13
config/helm/scraper/test/examples/default/Makefile
Normal file
13
config/helm/scraper/test/examples/default/Makefile
Normal file
@@ -0,0 +1,13 @@
|
||||
default: test
|
||||
|
||||
include ../../../helpers/examples.mk
|
||||
|
||||
RELEASE := helm-apm-server-default
|
||||
|
||||
install:
|
||||
helm upgrade --wait --timeout=$(TIMEOUT) --install $(RELEASE) ../../
|
||||
|
||||
test: install goss
|
||||
|
||||
purge:
|
||||
helm del $(RELEASE)
|
||||
27
config/helm/scraper/test/examples/default/README.md
Normal file
27
config/helm/scraper/test/examples/default/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Default
|
||||
|
||||
This example deploy APM Server 8.5.1 using [default values][].
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
* Deploy [Elasticsearch Helm chart][].
|
||||
|
||||
* Deploy APM Server chart with the default values: `make install`
|
||||
|
||||
* You can now setup a port forward to query APM indices:
|
||||
|
||||
```
|
||||
kubectl port-forward svc/elasticsearch-master 9200
|
||||
curl localhost:9200/_cat/indices
|
||||
```
|
||||
|
||||
|
||||
## Testing
|
||||
|
||||
You can also run [goss integration tests][] using `make test`
|
||||
|
||||
|
||||
[elasticsearch helm chart]: https://github.com/elastic/helm-charts/tree/main/elasticsearch/examples/default/
|
||||
[goss integration tests]: https://github.com/elastic/helm-charts/tree/main/apm-server/examples/default/test/goss.yaml
|
||||
[default values]: https://github.com/elastic/helm-charts/tree/main/apm-server/values.yaml
|
||||
6
config/helm/scraper/test/examples/default/test/goss.yaml
Normal file
6
config/helm/scraper/test/examples/default/test/goss.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
http:
|
||||
http://localhost:8200?pretty:
|
||||
status: 200
|
||||
timeout: 2000
|
||||
body:
|
||||
- "8.5.1"
|
||||
13
config/helm/scraper/test/examples/security/Makefile
Normal file
13
config/helm/scraper/test/examples/security/Makefile
Normal file
@@ -0,0 +1,13 @@
|
||||
default: test
|
||||
|
||||
include ../../../helpers/examples.mk
|
||||
|
||||
RELEASE := helm-apm-server-security
|
||||
|
||||
install:
|
||||
helm upgrade --wait --timeout=$(TIMEOUT) --install --values values.yaml $(RELEASE) ../../
|
||||
|
||||
test: install goss
|
||||
|
||||
purge:
|
||||
helm del $(RELEASE)
|
||||
28
config/helm/scraper/test/examples/security/README.md
Normal file
28
config/helm/scraper/test/examples/security/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Security
|
||||
|
||||
This example deploy APM Server 8.5.1 using authentication and TLS to connect to
|
||||
Elasticsearch (see [values][]).
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
* Deploy [Elasticsearch Helm chart][].
|
||||
|
||||
* Deploy APM Server chart with security: `make install`
|
||||
|
||||
* You can now setup a port forward to query APM indices:
|
||||
|
||||
```
|
||||
kubectl port-forward svc/security-master 9200
|
||||
curl -u elastic:changeme https://localhost:9200/_cat/indices
|
||||
```
|
||||
|
||||
|
||||
## Testing
|
||||
|
||||
You can also run [goss integration tests][] using `make test`
|
||||
|
||||
|
||||
[elasticsearch helm chart]: https://github.com/elastic/helm-charts/tree/main/elasticsearch/examples/security/
|
||||
[goss integration tests]: https://github.com/elastic/helm-charts/tree/main/apm-server/examples/security/test/goss.yaml
|
||||
[values]: https://github.com/elastic/helm-charts/tree/main/apm-server/examples/security/values.yaml
|
||||
@@ -0,0 +1,6 @@
|
||||
http:
|
||||
http://localhost:8200?pretty:
|
||||
status: 200
|
||||
timeout: 2000
|
||||
body:
|
||||
- "8.5.1"
|
||||
29
config/helm/scraper/test/examples/security/values.yaml
Normal file
29
config/helm/scraper/test/examples/security/values.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
apmConfig:
|
||||
apm-server.yml: |
|
||||
apm-server:
|
||||
host: "0.0.0.0:8200"
|
||||
queue: {}
|
||||
output.elasticsearch:
|
||||
username: '${ELASTICSEARCH_USERNAME}'
|
||||
password: '${ELASTICSEARCH_PASSWORD}'
|
||||
protocol: https
|
||||
hosts: ["security-master:9200"]
|
||||
ssl.certificate_authorities:
|
||||
- /usr/share/apm-server/config/certs/elastic-certificate.pem
|
||||
|
||||
secretMounts:
|
||||
- name: elastic-certificate-pem
|
||||
secretName: elastic-certificate-pem
|
||||
path: /usr/share/apm-server/config/certs
|
||||
|
||||
extraEnvs:
|
||||
- name: "ELASTICSEARCH_USERNAME"
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: security-master-credentials
|
||||
key: username
|
||||
- name: "ELASTICSEARCH_PASSWORD"
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: security-master-credentials
|
||||
key: password
|
||||
17
config/helm/scraper/test/examples/upgrade/Makefile
Normal file
17
config/helm/scraper/test/examples/upgrade/Makefile
Normal file
@@ -0,0 +1,17 @@
|
||||
default: test
|
||||
|
||||
include ../../../helpers/examples.mk
|
||||
|
||||
CHART := apm-server
|
||||
RELEASE := helm-apm-server-upgrade
|
||||
# K8S 1.22 doesn't support anymore rbac.authorization.k8s.io/v1beta1 used in 7.9.0
|
||||
FROM := 7.10.0
|
||||
|
||||
install:
|
||||
../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM)
|
||||
kubectl rollout status deployment $(RELEASE)-apm-server
|
||||
|
||||
test: install goss
|
||||
|
||||
purge:
|
||||
helm del $(RELEASE)
|
||||
21
config/helm/scraper/test/examples/upgrade/README.md
Normal file
21
config/helm/scraper/test/examples/upgrade/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Upgrade
|
||||
|
||||
This example will deploy APM Server chart using an old chart version,
|
||||
then upgrade it.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
* Add the Elastic Helm charts repo: `helm repo add elastic https://helm.elastic.co`
|
||||
|
||||
* Deploy [Elasticsearch Helm chart][]: `helm install elasticsearch elastic/elasticsearch`
|
||||
|
||||
* Deploy and upgrade APM Server chart with the default values: `make install`
|
||||
|
||||
|
||||
## Testing
|
||||
|
||||
You can also run [goss integration tests][] using `make test`.
|
||||
|
||||
|
||||
[goss integration tests]: https://github.com/elastic/helm-charts/tree/main/apm-server/examples/upgrade/test/goss.yaml
|
||||
6
config/helm/scraper/test/examples/upgrade/test/goss.yaml
Normal file
6
config/helm/scraper/test/examples/upgrade/test/goss.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
http:
|
||||
http://localhost:8200?pretty:
|
||||
status: 200
|
||||
timeout: 2000
|
||||
body:
|
||||
- "8.5.1"
|
||||
26
config/helm/scraper/test/examples/upgrade/values.yaml
Normal file
26
config/helm/scraper/test/examples/upgrade/values.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
apmConfig:
|
||||
apm-server.yml: |
|
||||
apm-server:
|
||||
host: "0.0.0.0:8200"
|
||||
|
||||
queue: {}
|
||||
output.file:
|
||||
enabled: false
|
||||
|
||||
output.elasticsearch:
|
||||
hosts: ["http://upgrade-master:9200"]
|
||||
username: "${ELASTICSEARCH_USERNAME}"
|
||||
password: "${ELASTICSEARCH_PASSWORD}"
|
||||
|
||||
extraEnvs:
|
||||
- name: "ELASTICSEARCH_USERNAME"
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: upgrade-master-credentials
|
||||
key: username
|
||||
- name: "ELASTICSEARCH_PASSWORD"
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: upgrade-master-credentials
|
||||
key: password
|
||||
2
config/helm/scraper/test/templates/NOTES.txt
Normal file
2
config/helm/scraper/test/templates/NOTES.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
1. Watch all containers come up.
|
||||
$ kubectl get pods --namespace={{ .Release.Namespace }} -l app={{ template "apm.fullname" . }} -w
|
||||
31
config/helm/scraper/test/templates/_helpers.tpl
Normal file
31
config/helm/scraper/test/templates/_helpers.tpl
Normal file
@@ -0,0 +1,31 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "apm.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "apm.fullname" }}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-"}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Use the fullname if the serviceAccount value is not set
|
||||
*/}}
|
||||
{{- define "apm.serviceAccount" -}}
|
||||
{{- if .Values.serviceAccount }}
|
||||
{{- .Values.serviceAccount -}}
|
||||
{{- else }}
|
||||
{{- template "apm.fullname" . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
21
config/helm/scraper/test/templates/clusterrole.yaml
Normal file
21
config/helm/scraper/test/templates/clusterrole.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
{{- if .Values.managedServiceAccount }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ template "apm.serviceAccount" . }}-cluster-role
|
||||
labels:
|
||||
app: "{{ template "apm.fullname" . }}"
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- namespaces
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{{- end -}}
|
||||
19
config/helm/scraper/test/templates/clusterrolebinding.yaml
Normal file
19
config/helm/scraper/test/templates/clusterrolebinding.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
{{- if .Values.managedServiceAccount }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ template "apm.serviceAccount" . }}-cluster-role-binding
|
||||
labels:
|
||||
app: "{{ template "apm.fullname" . }}"
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: {{ template "apm.serviceAccount" . }}-cluster-role
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "apm.serviceAccount" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end -}}
|
||||
17
config/helm/scraper/test/templates/configmap.yaml
Normal file
17
config/helm/scraper/test/templates/configmap.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
{{- if .Values.apmConfig }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "apm.fullname" . }}-config
|
||||
labels:
|
||||
app: "{{ template "apm.fullname" . }}"
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
data:
|
||||
{{- range $path, $config := .Values.apmConfig }}
|
||||
{{ $path }}: |
|
||||
{{ $config | indent 4 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
130
config/helm/scraper/test/templates/deployment.yaml
Normal file
130
config/helm/scraper/test/templates/deployment.yaml
Normal file
@@ -0,0 +1,130 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "apm.fullname" . }}
|
||||
labels:
|
||||
app: {{ .Chart.Name }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
{{- range $key, $value := .Values.labels }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicas }}
|
||||
strategy:
|
||||
{{ toYaml .Values.updateStrategy | indent 4 }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: apm-server
|
||||
release: {{ .Release.Name | quote }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: apm-server
|
||||
release: {{ .Release.Name | quote }}
|
||||
{{- range $key, $value := .Values.labels }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.podAnnotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{/* This forces a restart if the configmap has changed */}}
|
||||
{{- if .Values.apmConfig }}
|
||||
configChecksum: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum | trunc 63 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.podSecurityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.podSecurityContext | indent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: {{ .Values.priorityClassName }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "apm.serviceAccount" . }}
|
||||
{{- if .Values.hostAliases }}
|
||||
hostAliases: {{ toYaml .Values.hostAliases | nindent 6 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- range .Values.secretMounts }}
|
||||
- name: {{ .name }}
|
||||
secret:
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- if .Values.apmConfig }}
|
||||
- name: apm-server-config
|
||||
configMap:
|
||||
name: {{ template "apm.fullname" . }}-config
|
||||
defaultMode: 0600
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{ toYaml .Values.extraVolumes | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{ toYaml .Values.imagePullSecrets | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraInitContainers }}
|
||||
initContainers:
|
||||
{{ tpl .Values.extraInitContainers . | indent 6 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: apm-server
|
||||
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
|
||||
imagePullPolicy: "{{ .Values.imagePullPolicy }}"
|
||||
{{- with .Values.extraEnvs }}
|
||||
env:
|
||||
{{ toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.envFrom }}
|
||||
envFrom:
|
||||
{{ toYaml .Values.envFrom | indent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.securityContext | indent 10 }}
|
||||
{{- end }}
|
||||
livenessProbe:
|
||||
{{ toYaml .Values.livenessProbe | indent 10 }}
|
||||
readinessProbe:
|
||||
{{ toYaml .Values.readinessProbe | indent 10 }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.service.port }}
|
||||
name: http
|
||||
{{- if .Values.lifecycle }}
|
||||
lifecycle:
|
||||
{{ toYaml .Values.lifecycle | indent 10 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{ toYaml .Values.resources | indent 10 }}
|
||||
volumeMounts:
|
||||
{{- range .Values.secretMounts }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .path }}
|
||||
{{- if .subPath }}
|
||||
subPath: {{ .subPath }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $path, $config := .Values.apmConfig }}
|
||||
- name: apm-server-config
|
||||
mountPath: /usr/share/apm-server/{{ $path }}
|
||||
subPath: {{ $path }}
|
||||
readOnly: true
|
||||
{{- end -}}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{ toYaml .Values.extraVolumeMounts | indent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraContainers }}
|
||||
{{ tpl .Values.extraContainers . | indent 6 }}
|
||||
{{- end }}
|
||||
26
config/helm/scraper/test/templates/hpa.yaml
Normal file
26
config/helm/scraper/test/templates/hpa.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- if .Values.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ template "apm.fullname" . }}
|
||||
labels:
|
||||
app: {{ .Chart.Name }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
{{- range $key, $value := .Values.labels }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ template "apm.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ .Values.autoscaling.averageCpuUtilization }}
|
||||
{{- end }}
|
||||
41
config/helm/scraper/test/templates/ingress.yaml
Normal file
41
config/helm/scraper/test/templates/ingress.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "apm.fullname" . -}}
|
||||
{{- $servicePort := .Values.service.port -}}
|
||||
{{- $pathtype := .Values.ingress.pathtype -}}
|
||||
{{- $ingressPath := .Values.ingress.path -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ template "apm.fullname" . }}
|
||||
labels:
|
||||
app: {{ .Chart.Name }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
{{- range $key, $value := .Values.labels }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.className }}
|
||||
ingressClassName: {{ .Values.ingress.className | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{ toYaml .Values.ingress.tls | indent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ . }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ $ingressPath }}
|
||||
pathType: {{ $pathtype }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $servicePort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
33
config/helm/scraper/test/templates/service.yaml
Normal file
33
config/helm/scraper/test/templates/service.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "apm.fullname" . }}
|
||||
labels:
|
||||
app: {{ .Chart.Name }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.service.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if .Values.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
{{- with .Values.service.nodePort }}
|
||||
nodePort: {{ . }}
|
||||
{{- end }}
|
||||
protocol: TCP
|
||||
name: http
|
||||
targetPort: {{ .Values.service.port }}
|
||||
selector:
|
||||
app: {{ .Chart.Name }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
15
config/helm/scraper/test/templates/serviceaccount.yaml
Normal file
15
config/helm/scraper/test/templates/serviceaccount.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- if .Values.managedServiceAccount }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "apm.serviceAccount" . }}
|
||||
annotations:
|
||||
{{- with .Values.serviceAccountAnnotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: "{{ template "apm.fullname" . }}"
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
{{- end -}}
|
||||
191
config/helm/scraper/test/values.yaml
Normal file
191
config/helm/scraper/test/values.yaml
Normal file
@@ -0,0 +1,191 @@
|
||||
---
|
||||
# Allows you to add config files
|
||||
apmConfig:
|
||||
apm-server.yml: |
|
||||
apm-server:
|
||||
host: "0.0.0.0:8200"
|
||||
|
||||
queue: {}
|
||||
|
||||
output.elasticsearch:
|
||||
hosts: ["http://elasticsearch-master:9200"]
|
||||
username: "${ELASTICSEARCH_USERNAME}"
|
||||
password: "${ELASTICSEARCH_PASSWORD}"
|
||||
## If SSL is enabled
|
||||
# protocol: https
|
||||
# ssl.certificate_authorities:
|
||||
# - /usr/share/apm-server/config/certs/elastic-ca.pem
|
||||
|
||||
replicas: 1
|
||||
|
||||
extraContainers: ""
|
||||
# - name: dummy-init
|
||||
# image: busybox
|
||||
# command: ['echo', 'hey']
|
||||
|
||||
extraInitContainers: ""
|
||||
# - name: dummy-init
|
||||
# image: busybox
|
||||
# command: ['echo', 'hey']
|
||||
|
||||
# Extra environment variables to append to the DaemonSet pod spec.
|
||||
# This will be appended to the current 'env:' key. You can use any of the kubernetes env
|
||||
# syntax here
|
||||
extraEnvs:
|
||||
- name: "ELASTICSEARCH_USERNAME"
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: elasticsearch-master-credentials
|
||||
key: username
|
||||
- name: "ELASTICSEARCH_PASSWORD"
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: elasticsearch-master-credentials
|
||||
key: password
|
||||
|
||||
# Allows you to load environment variables from kubernetes secret or config map
|
||||
envFrom: []
|
||||
# - secretRef:
|
||||
# name: env-secret
|
||||
# - configMapRef:
|
||||
# name: config-map
|
||||
|
||||
extraVolumeMounts: []
|
||||
# - name: extras
|
||||
# mountPath: /usr/share/extras
|
||||
# readOnly: true
|
||||
|
||||
extraVolumes: []
|
||||
# - name: extras
|
||||
# emptyDir: {}
|
||||
|
||||
hostAliases: []
|
||||
#- ip: "127.0.0.1"
|
||||
# hostnames:
|
||||
# - "foo.local"
|
||||
# - "bar.local"
|
||||
|
||||
image: "docker.elastic.co/apm/apm-server"
|
||||
imageTag: "8.5.1"
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
imagePullSecrets: []
|
||||
|
||||
# Whether this chart should self-manage its service account, role, and associated role binding.
|
||||
managedServiceAccount: true
|
||||
|
||||
podAnnotations: {}
|
||||
# iam.amazonaws.com/role: es-cluster
|
||||
|
||||
# additionals labels
|
||||
labels: {}
|
||||
|
||||
podSecurityContext:
|
||||
fsGroup: 1000
|
||||
runAsUser: 1000
|
||||
runAsGroup: 0
|
||||
|
||||
securityContext:
|
||||
privileged: false
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
runAsGroup: 0
|
||||
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 30
|
||||
failureThreshold: 3
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 30
|
||||
failureThreshold: 3
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m"
|
||||
memory: "100Mi"
|
||||
limits:
|
||||
cpu: "1000m"
|
||||
memory: "512Mi"
|
||||
|
||||
# Custom service account override that the pod will use
|
||||
serviceAccount: ""
|
||||
|
||||
# Annotations to add to the ServiceAccount that is created if the serviceAccount value isn't set.
|
||||
serviceAccountAnnotations: {}
|
||||
# eks.amazonaws.com/role-arn: arn:aws:iam::111111111111:role/k8s.clustername.namespace.serviceaccount
|
||||
|
||||
# A list of secrets and their paths to mount inside the pod
|
||||
secretMounts: []
|
||||
# - name: elastic-certificate-pem
|
||||
# secretName: elastic-certificates
|
||||
# path: /usr/share/apm-server/config/certs
|
||||
|
||||
terminationGracePeriod: 30
|
||||
|
||||
tolerations: []
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
affinity: {}
|
||||
|
||||
# This is the PriorityClass settings as defined in
|
||||
# https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
|
||||
priorityClassName: ""
|
||||
|
||||
updateStrategy:
|
||||
type: "RollingUpdate"
|
||||
|
||||
# Override various naming aspects of this chart
|
||||
# Only edit these if you know what you're doing
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
autoscaling:
|
||||
enabled: false
|
||||
minReplicas: 1
|
||||
maxReplicas: 3
|
||||
averageCpuUtilization: 50
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: "nginx"
|
||||
pathtype: ImplementationSpecific
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
path: /
|
||||
hosts:
|
||||
- chart-example.local
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
loadBalancerIP: ""
|
||||
port: 8200
|
||||
nodePort: ""
|
||||
annotations: {}
|
||||
# cloud.google.com/load-balancer-type: "Internal"
|
||||
# service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
|
||||
# service.beta.kubernetes.io/azure-load-balancer-internal: "true"
|
||||
# service.beta.kubernetes.io/openstack-internal-load-balancer: "true"
|
||||
# service.beta.kubernetes.io/cce-load-balancer-internal-vpc: "true"
|
||||
|
||||
lifecycle: {}
|
||||
# preStop:
|
||||
# exec:
|
||||
# command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]
|
||||
# postStart:
|
||||
# exec:
|
||||
# command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]
|
||||
Reference in New Issue
Block a user