Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

[kibana] update the upgrade test #1695

Merged
merged 4 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions kibana/examples/upgrade/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,34 @@ default: test
include ../../../helpers/examples.mk

CHART := kibana
RELEASE := helm-kibana-upgrade
FROM := 7.4.0 # versions before 7.4.O aren't compatible with Kubernetes >= 1.16.0
TO := 7.10.0 # required to use with Elasticsearch 7.10.0
ES_CLUSTER := kibana-upgrade
ES_RELEASE := helm-kibana-upgrade-es
RELEASE := helm-kibana-upgrade-kb
FROM := 7.17.1

install:
../../../helpers/upgrade.sh --chart $(CHART) --release $(RELEASE) --from $(FROM) --to $(TO)
repo:
helm repo add elastic https://helm.elastic.co

install-es:
helm install $(ES_RELEASE) elastic/elasticsearch --wait --version $(FROM) --set clusterName=$(ES_CLUSTER)

install-kb:
helm install $(RELEASE) elastic/kibana --wait --version $(FROM) --set elasticsearchHosts="http://$(ES_CLUSTER)-master:9200"

upgrade-es:
helm upgrade $(ES_RELEASE) ../../../elasticsearch/ --wait --set clusterName=$(ES_CLUSTER) --set updateStrategy=OnDelete
# Rollout ES pods
kubectl delete pod --selector=app=$(ES_CLUSTER)-master

upgrade-kb:
helm upgrade $(RELEASE) ../../ --wait --values values.yaml
kubectl rollout status deployment $(RELEASE)-kibana

install: repo install-es install-kb upgrade-es upgrade-kb

test: install goss

purge:
helm del $(RELEASE)
helm delete $(RELEASE)
helm delete $(ES_RELEASE)
kubectl delete $$(kubectl get pvc -o name | grep $(ES_CLUSTER))
6 changes: 4 additions & 2 deletions kibana/examples/upgrade/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ http:
http://localhost:5601/api/status:
status: 200
timeout: 2000
request-headers:
- "Authorization: Bearer {{ .Env.ELASTICSEARCH_SERVICEACCOUNTTOKEN}}"
body:
- '"number":"7.10.0"'
- '"number":"8.4.1"'

http://localhost:5601/app/kibana:
status: 200
timeout: 2000

http://helm-kibana-upgrade-kibana:5601/app/kibana:
http://helm-kibana-upgrade-kb-kibana:5601/app/kibana:
status: 200
timeout: 2000
5 changes: 4 additions & 1 deletion kibana/examples/upgrade/values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
---
elasticsearchHosts: "http://upgrade-master:9200"
elasticsearchHosts: "https://kibana-upgrade-master:9200"
elasticsearchCertificateSecret: kibana-upgrade-master-certs
elasticsearchCertificateAuthoritiesFile: ca.crt
elasticsearchCredentialSecret: kibana-upgrade-master-credentials
3 changes: 1 addition & 2 deletions kibana/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: {{ template "kibana.fullname" . }}-post-delete
labels: {{ include "kibana.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": post-delete,post-upgrade
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
{{- if .Values.annotations }}
{{- range $key, $value := .Values.annotations }}
Expand All @@ -22,7 +22,6 @@ spec:
imagePullPolicy: "{{ .Values.imagePullPolicy }}"
command: ["curl"]
args:
- --fail
- -XDELETE
- --cacert
- {{ template "kibana.home_dir" . }}/config/certs/{{ .Values.elasticsearchCertificateAuthoritiesFile }}
Expand Down