Skip to content

Commit

Permalink
Helm 3 (#516) (#904)
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 elastic/helm-charts#127)
* optimize docker images
* replace deprecated gitversion capability (related to helm/helm#5601)
* remove some heritage labels in immutable fields
  • Loading branch information
jmlrt authored Nov 18, 2020
1 parent 6a6115b commit ad1373b
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 66 deletions.
13 changes: 7 additions & 6 deletions elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ This chart is tested with the latest 6.8.14-SNAPSHOT version.
`helm repo add elastic https://helm.elastic.co`

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


### Install development version using 6.8 branch and 6.8.14-SNAPSHOT versions

Expand All @@ -71,8 +72,9 @@ This chart is tested with the latest 6.8.14-SNAPSHOT version.
* Checkout the branch : git checkout 6.8

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


## Upgrading

Expand Down Expand Up @@ -159,7 +161,7 @@ support multiple versions with minimal changes.
| `secretMounts` | Allows you easily mount a secret as a file inside the StatefulSet. Useful for mounting certificates and other secrets. See [values.yaml][] for an example | `[]` |
| `securityContext` | Allows you to set the [securityContext][] for the container | see [values.yaml][] |
| `service.annotations` | [LoadBalancer annotations][] that Kubernetes will use for the service. This will configure load balancer if `service.type` is `LoadBalancer` | `{}` |
| `service.externalTrafficPolicy` | Some cloud providers allow you to specify the [LoadBalancer externalTrafficPolicy][]. Kubernetes will use this to preserve the client source IP. This will configure load balancer if `service.type` is `LoadBalancer` | `""` |
| `service.externalTrafficPolicy` | Some cloud providers allow you to specify the [LoadBalancer externalTrafficPolicy][]. Kubernetes will use this to preserve the client source IP. This will configure load balancer if `service.type` is `LoadBalancer` | `""` |
| `service.httpPortName` | The name of the http port within the service | `http` |
| `service.labelsHeadless` | Labels to be added to headless service | `{}` |
| `service.labels` | Labels to be added to non-headless service | `{}` |
Expand Down Expand Up @@ -416,7 +418,6 @@ about our development and testing process.
[examples/security]: https://github.com/elastic/helm-charts/tree/6.8/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/6.8/elasticsearch/README.md#how-to-install-plugins
[how to use the keystore]: https://github.com/elastic/helm-charts/tree/6.8/elasticsearch/README.md#how-to-use-the-keystore
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 @@ -60,7 +60,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 @@ -71,7 +71,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
Loading

0 comments on commit ad1373b

Please sign in to comment.