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

Commit

Permalink
Helm 3 (#516)
Browse files Browse the repository at this point in the history
* bump helm version to helm 3.4.1
* update doc to make helm 3 the recommended version
* update helm commands arguments for helm 3
* remove helm init and tiller install commands
* add stable repo for metricbeat dependencies
* remove the charts dance in helmignore (related to #127)
* optimize docker images
* replace deprecated gitversion capability (related to helm/helm#5601)
* remove some heritage labels in immutable fields
  • Loading branch information
jmlrt committed Nov 17, 2020
1 parent 58bdd96 commit d4e9f6b
Show file tree
Hide file tree
Showing 49 changed files with 120 additions and 148 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- [Support Matrix](#support-matrix)
- [Kubernetes Versions](#kubernetes-versions)
- [Helm versions](#helm-versions)
- [Helm 3 beta](#helm-3-beta)
- [ECK](#eck)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -77,13 +76,8 @@ exact versions are defined under `KUBERNETES_VERSIONS` in
### Helm versions

While we are checking backward compatibility, the charts are only tested with
Helm version mentioned in [helm-tester Dockerfile][] (currently 2.17.0).
Helm version mentioned in [helm-tester Dockerfile][] (currently 3.4.1).

#### Helm 3 beta

While we don't have automated tests for [Helm 3][] yet, we fixed the main
blockers to use it. We now have enough feedbacks from internal and external
users to add support in beta.

## ECK

Expand All @@ -97,7 +91,6 @@ Kubernetes.
[elastic cloud on kubernetes]: https://github.com/elastic/cloud-on-k8s
[elastic helm repo]: https://helm.elastic.co
[github releases]: https://github.com/elastic/helm-charts/releases
[helm 3]: https://v3.helm.sh
[helm-tester Dockerfile]: https://github.com/elastic/helm-charts/blob/master/helpers/helm-tester/Dockerfile
[helpers/matrix.yml]: https://github.com/elastic/helm-charts/blob/master/helpers/matrix.yml
[operator pattern]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
Expand Down
9 changes: 4 additions & 5 deletions apm-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ See [supported configurations][] for more details.
`helm repo add elastic https://helm.elastic.co`

* Install it:
- with Helm 2: `helm install --name apm-server elastic/apm-server`
- with [Helm 3 (beta)][]: `helm install apm-server elastic/apm-server`
- with Helm 3: `helm install apm-server elastic/apm-server`
- with Helm 2 (deprecated): `helm install --name apm-server elastic/apm-server`


### Install development version using master branch

* Clone the git repo: `git clone git@github.com:elastic/helm-charts.git`

* Install it:
- with Helm 2: `helm install --name apm-server ./helm-charts/apm-server --set imageTag=8.0.0-SNAPSHOT`
- with [Helm 3 (beta)][]: `helm install apm-server ./helm-charts/apm-server --set imageTag=8.0.0-SNAPSHOT`
- with Helm 3: `helm install apm-server ./helm-charts/apm-server --set imageTag=8.0.0-SNAPSHOT`
- with Helm 2 (deprecated): `helm install --name apm-server ./helm-charts/apm-server --set imageTag=8.0.0-SNAPSHOT`


## Upgrading
Expand Down Expand Up @@ -160,7 +160,6 @@ about our development and testing process.
[examples/oss]: https://github.com/elastic/helm-charts/tree/master/apm-server/examples/oss
[examples/security]: https://github.com/elastic/helm-charts/tree/master/apm-server/examples/security
[helm]: https://helm.sh
[helm 3 (beta)]: https://github.com/elastic/helm-charts/tree/master/README.md#helm-3-beta
[horizontal pod autoscaler]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
[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
Expand Down
4 changes: 2 additions & 2 deletions apm-server/examples/default/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ include ../../../helpers/examples.mk
RELEASE := helm-apm-server-default

install:
helm upgrade --wait --timeout=900 --install $(RELEASE) ../../
helm upgrade --wait --timeout=900s --install $(RELEASE) ../../

test: install goss

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
4 changes: 2 additions & 2 deletions apm-server/examples/oss/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ include ../../../helpers/examples.mk
RELEASE := helm-apm-server-oss

install:
helm upgrade --wait --timeout=900 --install $(RELEASE) --values values.yaml ../../
helm upgrade --wait --timeout=900s --install $(RELEASE) --values values.yaml ../../

test: install goss

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
4 changes: 2 additions & 2 deletions apm-server/examples/security/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ include ../../../helpers/examples.mk
RELEASE := helm-apm-server-security

install:
helm upgrade --wait --timeout=900 --install $(RELEASE) --values values.yaml ../../
helm upgrade --wait --timeout=900s --install $(RELEASE) --values values.yaml ../../

test: install goss

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
4 changes: 2 additions & 2 deletions apm-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
Return the appropriate apiVersion for ingress.
*/}}
{{- define "apm.ingress.apiVersion" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.Version -}}
{{- print "extensions/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- end -}}
{{- end -}}
{{- define "apm.autoscaling.apiVersion" -}}
{{- if semverCompare "<1.12-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if semverCompare "<1.12-0" .Capabilities.KubeVersion.Version -}}
{{- print "autoscaling/v2beta1" -}}
{{- else -}}
{{- print "autoscaling/v2beta2" -}}
Expand Down
9 changes: 4 additions & 5 deletions elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ See [supported configurations][] for more details.
`helm repo add elastic https://helm.elastic.co`

* Install it:
- with Helm 2: `helm install --name elasticsearch elastic/elasticsearch`
- with [Helm 3 (beta)][]: `helm install elasticsearch elastic/elasticsearch`
- with Helm 3: `helm install elasticsearch elastic/elasticsearch`
- with Helm 2 (deprecated): `helm install --name elasticsearch elastic/elasticsearch`


### Install development version using master branch

* Clone the git repo: `git clone git@github.com:elastic/helm-charts.git`

* Install it:
- with Helm 2: `helm install --name elasticsearch ./helm-charts/elasticsearch --set imageTag=8.0.0-SNAPSHOT`
- with [Helm 3 (beta)][]: `helm install elasticsearch ./helm-charts/elasticsearch --set imageTag=8.0.0-SNAPSHOT`
- with Helm 3: `helm install elasticsearch ./helm-charts/elasticsearch --set imageTag=8.0.0-SNAPSHOT`
- with Helm 2 (deprecated): `helm install --name elasticsearch ./helm-charts/elasticsearch --set imageTag=8.0.0-SNAPSHOT`


## Upgrading
Expand Down Expand Up @@ -413,7 +413,6 @@ about our development and testing process.
[examples/security]: https://github.com/elastic/helm-charts/tree/master/elasticsearch/examples/security
[gke]: https://cloud.google.com/kubernetes-engine
[helm]: https://helm.sh
[helm 3 (beta)]: https://github.com/elastic/helm-charts/tree/master/README.md#helm-3-beta
[helm/charts stable]: https://github.com/helm/charts/tree/master/stable/elasticsearch/
[how to install plugins guide]: https://github.com/elastic/helm-charts/tree/master/elasticsearch/README.md#how-to-install-plugins
[how to use the keystore]: https://github.com/elastic/helm-charts/tree/master/elasticsearch/README.md#how-to-use-the-keystore
Expand Down
4 changes: 2 additions & 2 deletions elasticsearch/examples/config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include ../../../helpers/examples.mk
RELEASE := helm-es-config

install:
helm upgrade --wait --timeout=900 --install $(RELEASE) --values ./values.yaml ../../
helm upgrade --wait --timeout=900s --install $(RELEASE) --values ./values.yaml ../../

secrets:
kubectl delete secret elastic-config-credentials elastic-config-secret elastic-config-slack elastic-config-custom-path || true
Expand All @@ -16,4 +16,4 @@ secrets:
test: secrets install goss

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
6 changes: 3 additions & 3 deletions elasticsearch/examples/default/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ include ../../../helpers/examples.mk
RELEASE := helm-es-default

install:
helm upgrade --wait --timeout=900 --install $(RELEASE) ../../
helm upgrade --wait --timeout=900s --install $(RELEASE) ../../

restart:
helm upgrade --set terminationGracePeriod=121 --wait --timeout=900 --install $(RELEASE) ../../
helm upgrade --set terminationGracePeriod=121 --wait --timeout=900s --install $(RELEASE) ../../

test: install goss

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
4 changes: 2 additions & 2 deletions elasticsearch/examples/docker-for-mac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ default: test
RELEASE := helm-es-docker-for-mac

install:
helm upgrade --wait --timeout=1200 --install --values values.yaml $(RELEASE) ../../
helm upgrade --wait --timeout=1200s --install --values values.yaml $(RELEASE) ../../

test: install
helm test $(RELEASE)

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
6 changes: 3 additions & 3 deletions elasticsearch/examples/kubernetes-kind/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ default: test
RELEASE := helm-es-kind

install:
helm upgrade --wait --timeout=1200 --install --values values.yaml $(RELEASE) ../../
helm upgrade --wait --timeout=1200s --install --values values.yaml $(RELEASE) ../../

install-local-path:
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
helm upgrade --wait --timeout=1200 --install --values values-local-path.yaml $(RELEASE) ../../
helm upgrade --wait --timeout=1200s --install --values values-local-path.yaml $(RELEASE) ../../

test: install
helm test $(RELEASE)

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
4 changes: 2 additions & 2 deletions elasticsearch/examples/microk8s/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ default: test
RELEASE := helm-es-microk8s

install:
helm upgrade --wait --timeout=1200 --install --values values.yaml $(RELEASE) ../../
helm upgrade --wait --timeout=1200s --install --values values.yaml $(RELEASE) ../../

test: install
helm test $(RELEASE)

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
6 changes: 3 additions & 3 deletions elasticsearch/examples/migration/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PREFIX := helm-es-migration

data:
helm upgrade --wait --timeout=900 --install --values ./data.yml $(PREFIX)-data ../../
helm upgrade --wait --timeout=900s --install --values ./data.yml $(PREFIX)-data ../../

master:
helm upgrade --wait --timeout=900 --install --values ./master.yml $(PREFIX)-master ../../
helm upgrade --wait --timeout=900s --install --values ./master.yml $(PREFIX)-master ../../

client:
helm upgrade --wait --timeout=900 --install --values ./client.yml $(PREFIX)-client ../../
helm upgrade --wait --timeout=900s --install --values ./client.yml $(PREFIX)-client ../../
4 changes: 2 additions & 2 deletions elasticsearch/examples/minikube/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ default: test
RELEASE := helm-es-minikube

install:
helm upgrade --wait --timeout=1200 --install --values values.yaml $(RELEASE) ../../
helm upgrade --wait --timeout=1200s --install --values values.yaml $(RELEASE) ../../

test: install
helm test $(RELEASE)

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
12 changes: 6 additions & 6 deletions elasticsearch/examples/multi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ PREFIX := helm-es-multi
RELEASE := helm-es-multi-master

install:
helm upgrade --wait --timeout=900 --install --values ./master.yml $(PREFIX)-master ../../
helm upgrade --wait --timeout=900 --install --values ./data.yml $(PREFIX)-data ../../
helm upgrade --wait --timeout=900 --install --values ./client.yml $(PREFIX)-client ../../
helm upgrade --wait --timeout=900s --install --values ./master.yml $(PREFIX)-master ../../
helm upgrade --wait --timeout=900s --install --values ./data.yml $(PREFIX)-data ../../
helm upgrade --wait --timeout=900s --install --values ./client.yml $(PREFIX)-client ../../

test: install goss

purge:
helm del --purge $(PREFIX)-master
helm del --purge $(PREFIX)-data
helm del --purge $(PREFIX)-client
helm del $(PREFIX)-master
helm del $(PREFIX)-data
helm del $(PREFIX)-client
4 changes: 2 additions & 2 deletions elasticsearch/examples/openshift/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ template:
helm template --values ./values.yaml ../../

install:
helm upgrade --wait --timeout=900 --install $(RELEASE) --values ./values.yaml ../../
helm upgrade --wait --timeout=900s --install $(RELEASE) --values ./values.yaml ../../

test: install goss

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
4 changes: 2 additions & 2 deletions elasticsearch/examples/oss/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ include ../../../helpers/examples.mk
RELEASE := helm-es-oss

install:
helm upgrade --wait --timeout=900 --install $(RELEASE) --values ./values.yaml ../../
helm upgrade --wait --timeout=900s --install $(RELEASE) --values ./values.yaml ../../

test: install goss

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
4 changes: 2 additions & 2 deletions elasticsearch/examples/security/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ RELEASE := helm-es-security
ELASTICSEARCH_IMAGE := docker.elastic.co/elasticsearch/elasticsearch:$(STACK_VERSION)

install:
helm upgrade --wait --timeout=900 --install --values ./security.yml $(RELEASE) ../../
helm upgrade --wait --timeout=900s --install --values ./security.yml $(RELEASE) ../../

purge:
kubectl delete secrets elastic-credentials elastic-certificates elastic-certificate-pem elastic-certificate-crt|| true
helm del --purge $(RELEASE)
helm del $(RELEASE)

test: secrets install goss

Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1. Watch all cluster members come up.
$ kubectl get pods --namespace={{ .Release.Namespace }} -l app={{ template "elasticsearch.uname" . }} -w
2. Test cluster health using Helm test.
$ helm test {{ .Release.Name }} --cleanup
$ helm test {{ .Release.Name }}
4 changes: 2 additions & 2 deletions elasticsearch/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
Return the appropriate apiVersion for statefulset.
*/}}
{{- define "elasticsearch.statefulset.apiVersion" -}}
{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.Version -}}
{{- print "apps/v1beta2" -}}
{{- else -}}
{{- print "apps/v1" -}}
Expand All @@ -79,7 +79,7 @@ Return the appropriate apiVersion for statefulset.
Return the appropriate apiVersion for ingress.
*/}}
{{- define "elasticsearch.ingress.apiVersion" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.Version -}}
{{- print "extensions/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1beta1" -}}
Expand Down
4 changes: 1 addition & 3 deletions elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ spec:
name: {{ template "elasticsearch.uname" . }}
{{- if .Values.persistence.labels.enabled }}
labels:
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}"
app: "{{ template "elasticsearch.uname" . }}"
Expand All @@ -47,7 +46,6 @@ spec:
metadata:
name: "{{ template "elasticsearch.uname" . }}"
labels:
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}"
app: "{{ template "elasticsearch.uname" . }}"
Expand Down Expand Up @@ -154,7 +152,7 @@ spec:
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
{{- if semverCompare ">1.13-0" .Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">1.13-0" .Capabilities.KubeVersion.Version }}
enableServiceLinks: {{ .Values.enableServiceLinks }}
{{- end }}
initContainers:
Expand Down
5 changes: 4 additions & 1 deletion elasticsearch/tests/elasticsearch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,10 @@ def test_enabling_persistence_label_in_volumeclaimtemplate():
"volumeClaimTemplates"
][0]["metadata"]["labels"]
statefulset_labels = r["statefulset"][uname]["metadata"]["labels"]
assert volume_claim_template_labels == statefulset_labels
expected_labels = statefulset_labels
# heritage label shouldn't be present in volumeClaimTemplates labels
expected_labels.pop("heritage")
assert volume_claim_template_labels == expected_labels


def test_adding_a_secret_mount():
Expand Down
9 changes: 4 additions & 5 deletions filebeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ See [supported configurations][] for more details.
`helm repo add elastic https://helm.elastic.co`

* Install it:
- with Helm 2: `helm install --name filebeat elastic/filebeat`
- with [Helm 3 (beta)][]: `helm install filebeat elastic/filebeat`
- with Helm 3: `helm install filebeat elastic/filebeat`
- with Helm 2 (deprecated): `helm install --name filebeat elastic/filebeat`


### Install development version using master branch

* Clone the git repo: `git clone git@github.com:elastic/helm-charts.git`

* Install it:
- with Helm 2: `helm install --name filebeat ./helm-charts/filebeat --set imageTag=8.0.0-SNAPSHOT`
- with [Helm 3 (beta)][]: `helm install filebeat ./helm-charts/filebeat --set imageTag=8.0.0-SNAPSHOT`
- with Helm 3: `helm install filebeat ./helm-charts/filebeat --set imageTag=8.0.0-SNAPSHOT`
- with Helm 2 (deprecated): `helm install --name filebeat ./helm-charts/filebeat --set imageTag=8.0.0-SNAPSHOT`


## Upgrading
Expand Down Expand Up @@ -200,7 +200,6 @@ about our development and testing process.
[filebeat oss docker image]: https://www.docker.elastic.co/r/beats/filebeat-oss
[filebeat outputs]: https://www.elastic.co/guide/en/beats/filebeat/current/configuring-output.html
[helm]: https://helm.sh
[helm 3 (beta)]: https://github.com/elastic/helm-charts/tree/master/README.md#helm-3-beta
[hostNetwork]: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#host-namespaces
[dnsConfig]: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
[hostPath]: https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
Expand Down
Loading

0 comments on commit d4e9f6b

Please sign in to comment.