Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit 2a1ebe1

Browse files
author
Chris Wiechmann
committed
Added APM-Server support
1 parent 8116dbc commit 2a1ebe1

File tree

7 files changed

+159
-12
lines changed

7 files changed

+159
-12
lines changed

helm/Chart.lock

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
dependencies:
22
- name: logstash
33
repository: https://helm.elastic.co
4-
version: 7.13.3
4+
version: 7.15.0
55
- name: filebeat
66
repository: https://helm.elastic.co
7-
version: 7.13.3
7+
version: 7.15.0
88
- name: elasticsearch
99
repository: https://helm.elastic.co
10-
version: 7.13.3
10+
version: 7.15.0
1111
- name: kibana
1212
repository: https://helm.elastic.co
13-
version: 7.13.3
14-
digest: sha256:fd45f895af10453f8124551f19a2ce61fed9af8500dc3dd8366cee4d2c5536fa
15-
generated: "2021-07-21T11:08:27.3500763+02:00"
13+
version: 7.15.0
14+
- name: apm-server
15+
repository: https://helm.elastic.co
16+
version: 7.15.0
17+
digest: sha256:32da0014cabc3f1dfee65b2176e32c25d34db8cbce785541c18f01f8c5a056c9
18+
generated: "2021-12-07T07:45:41.66497+01:00"

helm/Chart.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,22 @@ appVersion: "3.6.0"
1010

1111
dependencies:
1212
- name: logstash
13-
version: "7.15.2"
13+
version: "7.15.0"
1414
repository: https://helm.elastic.co
1515
condition: logstash.enabled
1616
- name: filebeat
17-
version: "7.15.2"
17+
version: "7.15.0"
1818
repository: https://helm.elastic.co
1919
condition: filebeat.enabled
2020
- name: elasticsearch
21-
version: "7.15.2"
21+
version: "7.15.0"
2222
repository: https://helm.elastic.co
2323
condition: elasticsearch.enabled
2424
- name: kibana
25-
version: "7.15.2"
25+
version: "7.15.0"
2626
repository: https://helm.elastic.co
27-
condition: kibana.enabled
27+
condition: kibana.enabled
28+
- name: apm-server
29+
version: "7.15.0"
30+
repository: https://helm.elastic.co
31+
condition: apm-server.enabled

helm/templates/apibuilder4elastic/apibuilder4elastic-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@ data:
1616
PAYLOAD_HANDLING_ENABLED: {{ default true .Values.apibuilder4elastic.payloadEnabled | quote }}
1717
MANAGEMENT_KPIS_ENABLED: {{ default true .Values.apibuilder4elastic.managementKPIsEnabled | quote }}
1818
LOG_LEVEL: {{ default "info" .Values.apibuilder4elastic.logLevel | quote }}
19+
APM_ENABLED: {{ index .Values "apm-server" "enabled" | quote }}
20+
{{- if .Values.apibuilder4elastic.apmserver.serverUrl }}
21+
APM_SERVER: {{ .Values.apibuilder4elastic.apmserver.serverUrl | quote }}
22+
{{- else }}
23+
APM_SERVER: {{ printf "https://%s-apm-server:8200" .Release.Name | quote }}
24+
{{- end }}
25+
APM_VALIDATE_SERVER_CERT: {{ default true .Values.apibuilder4elastic.apmserver.verifyServerCert | quote }}
26+
APM_SERVER_CA: {{ default "" .Values.apibuilder4elastic.apmserver.serverCaCertFile | quote }}
1927
{{- end }}

helm/templates/config/_helpers.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
3434
Generate required certificates
3535
*/}}
3636
{{- define "elastic-apim.gen-certs" -}}
37-
{{- $altNames := list "localhost" ( printf "%s-elasticsearch" (include "apim4elastic.fullname" .) ) ( printf "%s-apibuilder4elastic" (include "apim4elastic.fullname" .) ) ( printf "%s-kibana" (include "apim4elastic.fullname" .) ) -}}
37+
{{- $altNames := list "localhost" ( printf "%s-elasticsearch" (include "apim4elastic.fullname" .) ) ( printf "%s-apibuilder4elastic" (include "apim4elastic.fullname" .) ) ( printf "%s-kibana" (include "apim4elastic.fullname" .) ) ( printf "%s-apmserver" (include "apim4elastic.fullname" .) ) -}}
3838
{{- $ca := genCA "elastic-apim-ca" 365 -}}
3939
{{- $cert := genSignedCert ( include "apim4elastic.name" . ) nil $altNames 365 $ca -}}
4040
ca.crt: {{ $ca.Cert | b64enc }}
@@ -44,4 +44,6 @@ kibana.crt: {{ $cert.Cert | b64enc }}
4444
kibana.key: {{ $cert.Key | b64enc }}
4545
apibuilder4elastic.crt: {{ $cert.Cert | b64enc }}
4646
apibuilder4elastic.key: {{ $cert.Key | b64enc }}
47+
apmserver.crt: {{ $cert.Cert | b64enc }}
48+
apmserver.key: {{ $cert.Key | b64enc }}
4749
{{- end -}}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{- define "apmserver.fullname" -}}
2+
{{ include "apim4elastic.fullname" . }}-apmserver
3+
{{- end }}
4+
5+
{{- define "apmserver.name" -}}
6+
{{ include "apim4elastic.name" . }}-apmserver
7+
{{- end }}
8+
9+
{{/*
10+
Common labels
11+
*/}}
12+
{{- define "apmserver.labels" -}}
13+
helm.sh/chart: {{ include "apim4elastic.chart" . }}
14+
{{ include "apmserver.selectorLabels" . }}
15+
{{- if .Chart.AppVersion }}
16+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
17+
{{- end }}
18+
app.kubernetes.io/managed-by: {{ .Release.Service }}
19+
{{- end }}
20+
21+
{{/*
22+
Selector labels
23+
*/}}
24+
{{- define "apmserver.selectorLabels" -}}
25+
app.kubernetes.io/component: apm-server
26+
app.kubernetes.io/name: {{ include "apim4elastic.name" . }}
27+
app.kubernetes.io/instance: {{ .Release.Name }}
28+
{{- range $key, $value := .Values.apmserver.labels }}
29+
{{ $key }}: {{ $value | quote }}
30+
{{- end }}
31+
{{- end }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- if ".Values.apm-server.enabled" }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ template "apmserver.fullname" . }}-env-config
6+
labels:
7+
app: "{{ template "apmserver.fullname" . }}"
8+
chart: "{{ .Chart.Name }}"
9+
heritage: {{ .Release.Service | quote }}
10+
release: {{ .Release.Name | quote }}
11+
data:
12+
ELASTICSEARCH_HOSTS: {{ required "The value global.elasticsearchHosts is missing." .Values.global.elasticsearchHosts | quote }}
13+
ELASTICSEARCH_CLUSTER_UUID: {{ .Values.apmserver.elasticsearchClusterUUID | quote }}
14+
ELASTICSEARCH_CA: {{ required "The path to the CA for APM-Server to Elasticsearch communication is missing" .Values.global.elasticsearchCa | quote }}
15+
APM_SERVER_CRT: {{ index .Values "apm-server" "ssl" "cert" }}
16+
APM_SERVER_KEY: {{ index .Values "apm-server" "ssl" "key" }}
17+
{{- end }}

helm/values.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ apibuilder4elastic:
186186
# - axway-elk-apim4elastic-logstash
187187
# topologyKey: kubernetes.io/hostname
188188

189+
apmserver:
190+
# If you want to use an external APM-Server, you can configure the URL here.
191+
# Defaults to the internal APM-Server service if enabled
192+
serverUrl: {}
193+
# The Certificate-Authory to validate the APM-Server certificate
194+
# serverCaCertFile: "config/certificates/my-apmserver-ca.crt"
195+
# You may disable the certificate check
196+
# verifyServerCert: "false"
197+
189198
##################################################################################################################################
190199
# L O G S T A S H
191200
##################################################################################################################################
@@ -680,3 +689,76 @@ filebeat:
680689
# keepfiles: 7
681690
# permissions: 0644
682691
#logging.selectors: ["*"]
692+
693+
##################################################################################################################################
694+
# A P M - S E R V E R
695+
##################################################################################################################################
696+
apm-server:
697+
enabled: true
698+
# Required for the internal stack monitoring to work with the APM-Server
699+
elasticsearchClusterUUID: ""
700+
701+
envFrom:
702+
- configMapRef:
703+
name: axway-elk-apim4elastic-apmserver-env-config
704+
705+
secretMounts:
706+
- name: certificates
707+
secretName: axway-elk-apim4elastic-certificates
708+
path: /usr/share/apm-server/config/certificates
709+
710+
# Setup the SSL-Configuration for the APM-Server
711+
# Use secretMounts to mount your keys & certificates into pod
712+
# and configure them here.
713+
# By default the generated key and certificate is used here
714+
ssl:
715+
cert: "config/certificates/apmserver.crt"
716+
key: "config/certificates/apmserver.key"
717+
# password: ""
718+
719+
livenessProbe:
720+
httpGet:
721+
path: /
722+
port: http
723+
scheme: HTTPS
724+
initialDelaySeconds: 30
725+
failureThreshold: 3
726+
periodSeconds: 10
727+
timeoutSeconds: 5
728+
729+
readinessProbe:
730+
httpGet:
731+
path: /
732+
port: http
733+
scheme: HTTPS
734+
initialDelaySeconds: 30
735+
failureThreshold: 3
736+
periodSeconds: 10
737+
timeoutSeconds: 5
738+
739+
apmConfig:
740+
apm-server.yml: |
741+
apm-server:
742+
host: "0.0.0.0:8200"
743+
rum:
744+
enabled: true
745+
ssl:
746+
enabled: true
747+
certificate: ${APM_SERVER_CRT:""}
748+
key: ${APM_SERVER_KEY:""}
749+
key_passphrase: ${APM_SERVER_KEY_PASSPHRASE:""}
750+
751+
output:
752+
elasticsearch:
753+
hosts: "${ELASTICSEARCH_HOSTS}"
754+
username: ${APM_USERNAME:""}
755+
password: ${APM_PASSWORD:""}
756+
ssl:
757+
certificate_authorities: ${ELASTICSEARCH_CA}
758+
759+
monitoring:
760+
enabled: true
761+
elasticsearch:
762+
username: ${APM_USERNAME:""}
763+
password: ${APM_PASSWORD:""}
764+
cluster_uuid: ${ELASTICSEARCH_CLUSTER_UUID}

0 commit comments

Comments
 (0)