-
Notifications
You must be signed in to change notification settings - Fork 10
Elasticsearch helm chart #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
renmak
wants to merge
1
commit into
att-comdev:master
Choose a base branch
from
renmak:elasticsearch-helm-chart
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Copyright 2017 The Openstack-Helm Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| apiVersion: v1 | ||
| description: A Helm chart for Elasticsearch | ||
| name: elasticsearch | ||
| version: 0.1.0 | ||
| maintainers: | ||
| - name: OpenStack-Helm Authors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # Elasticsearch Helm Chart | ||
|
|
||
| This chart installs a working version of Elasticsearch cluster on Kubernetes. | ||
|
|
||
| ### Installation | ||
|
|
||
| Values.yaml contains configuration for Elasticsearch cluster. | ||
|
|
||
| #### Note: Minimum of 2 Master Nodes are required for elasticsearch cluster | ||
|
|
||
| ``` | ||
| helm install elasticsearch | ||
|
|
||
| ``` | ||
| ### To verify the helm deployment was successful: | ||
|
|
||
| ``` | ||
| helm list | ||
| ``` | ||
|
|
||
| ### To confirm all pods are up and running: | ||
|
|
||
| ``` | ||
| kubectl get pods | ||
|
|
||
| ``` | ||
|
|
||
| ### To view list of services | ||
|
|
||
| ``` | ||
| kubectl get svc | ||
| ``` | ||
|
|
||
| ``` | ||
| elasticsearch-discovery 10.99.148.252 <none> 9300/TCP 47m | ||
| elasticsearch-logging 10.105.222.126 <pending> 9200:31070/TCP 47m | ||
| ``` | ||
|
|
||
| ### Test elasticsearch functionality: | ||
|
|
||
| #### From any host within cluster.. | ||
|
|
||
| 1) Check if Elasticsearch cluster is up | ||
| ``` | ||
| curl http://10.105.222.126:9200 | ||
| ``` | ||
| ``` | ||
| curl http://10.105.222.126:9200/_cluster/health?pretty | ||
| ``` | ||
|
|
||
| 2) Store data manually using APIs | ||
| ``` | ||
| curl -XPUT 'http://10.105.222.126:9200/blog/user/renmak' -d \ | ||
| '{ "name" : "Dilbert Brown" }' | ||
| ``` | ||
| ``` | ||
| curl -XPUT 'http://10.105.222.126:9200/blog/post/1' -d \ | ||
| '{ "user":"renmak", "title":"how to test ES"}' | ||
| ``` | ||
| 3) Retrive data manually using APIs | ||
| ``` | ||
| curl -XGET 'http://10.105.222.126:9200/blog/user/renmak?pretty=true' | ||
|
|
||
| curl -XGET 'http://10.105.222.126:9200/blog/post/1?pretty=true' | ||
|
|
||
| curl -XGET 'http://10.105.222.126:9200/blog/post/_search?q=user:renmak&pretty=true' | ||
|
|
||
| curl -XGET 'http://10.105.222.126:9200/_search?q=*renmak&pretty=true' | ||
|
|
||
| ``` | ||
|
|
Binary file not shown.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| {{/* vim: set filetype=mustache: */}} | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 24 | trimSuffix "-" -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Create a default fully qualified app name. | ||
| We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
| */}} | ||
| {{- define "fullname" -}} | ||
| {{- $name := default .Chart.Name .Values.nameOverride -}} | ||
| {{- printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}} | ||
| {{- end -}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # Copyright 2017 The Openstack-Helm Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| apiVersion: extensions/v1beta1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ .Values.labels.es_client.name }} | ||
| labels: | ||
| component: {{ .Values.labels.common.component }} | ||
| role: {{ .Values.labels.es_client.role }} | ||
| spec: | ||
| replicas: {{ .Values.replicas.es_client }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| component: {{ .Values.labels.common.component }} | ||
| role: {{ .Values.labels.es_client.role }} | ||
| annotations: | ||
| # Elasticsearch uses a hybrid mmapfs / niofs directory by default to | ||
| # store its indices. The default operating system limits on mmap counts | ||
| # is likely to be too low, which may result in out of memory exceptions, | ||
| # so we use vm.max_map_count=262144 to increase that value. | ||
| pod.beta.kubernetes.io/init-containers: '[ | ||
| { | ||
| "name": "sysctl", | ||
| "image": "busybox", | ||
| "imagePullPolicy": "IfNotPresent", | ||
| "command": ["sysctl", "-w", "vm.max_map_count=262144"], | ||
| "securityContext": { | ||
| "privileged": true | ||
| } | ||
| } | ||
| ]' | ||
| spec: | ||
| containers: | ||
| - name: {{ .Values.labels.es_client.name }} | ||
| securityContext: | ||
| privileged: false | ||
| capabilities: | ||
| add: | ||
| - IPC_LOCK | ||
| - SYS_RESOURCE | ||
| image: {{ .Values.images.elasticsearch }} | ||
| imagePullPolicy: {{ .Values.images.pullPolicy }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ability to enable resources and template the values for limits and requests should be included, as in the other charts
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| {{- if .Values.resources.enabled }} | ||
| resources: | ||
| limits: | ||
| cpu: {{ .Values.resources.limits.cpu }} | ||
| memory: {{ .Values.resources.limits.memory }} | ||
| requests: | ||
| cpu: {{ .Values.resources.requests.cpu }} | ||
| memory: {{ .Values.resources.requests.memory }} | ||
| {{- end }} | ||
| env: | ||
| - name: NAMESPACE | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.namespace | ||
| - name: NODE_NAME | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.name | ||
| - name: "CLUSTER_NAME" | ||
| value: {{ .Values.cluster_name }} | ||
| - name: NODE_MASTER | ||
| value: "false" | ||
| - name: NODE_DATA | ||
| value: "false" | ||
| - name: HTTP_ENABLE | ||
| value: "true" | ||
| - name: "ES_JAVA_OPTS" | ||
| value: {{ .Values.es_java_opts.es_client }} | ||
| ports: | ||
| - containerPort: {{ .Values.network.client.port }} | ||
| name: {{ .Values.network.client.name }} | ||
| protocol: {{ .Values.network.client.protocol }} | ||
| - containerPort: {{ .Values.network.discovery.port}} | ||
| name: {{ .Values.network.discovery.name }} | ||
| protocol: {{ .Values.network.discovery.protocol }} | ||
| volumeMounts: | ||
| - name: storage | ||
| mountPath: /data | ||
| volumes: | ||
| - name: storage | ||
| emptyDir: {} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Copyright 2017 The Openstack-Helm Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| apiVersion: extensions/v1beta1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ .Values.labels.es_data.name }} | ||
| labels: | ||
| component: {{ .Values.labels.common.component }} | ||
| role: {{ .Values.labels.es_data.role }} | ||
| spec: | ||
| replicas: {{ .Values.replicas.es_data }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| component: {{ .Values.labels.common.component }} | ||
| role: {{ .Values.labels.es_data.role }} | ||
| annotations: | ||
| pod.beta.kubernetes.io/init-containers: '[ | ||
| { | ||
| "name": "sysctl", | ||
| "image": "busybox", | ||
| "imagePullPolicy": "IfNotPresent", | ||
| "command": ["sysctl", "-w", "vm.max_map_count=262144"], | ||
| "securityContext": { | ||
| "privileged": true | ||
| } | ||
| } | ||
| ]' | ||
| spec: | ||
| containers: | ||
| - name: {{ .Values.labels.es_data.name }} | ||
| securityContext: | ||
| privileged: false | ||
| capabilities: | ||
| add: | ||
| - IPC_LOCK | ||
| - SYS_RESOURCE | ||
| image: {{ .Values.images.elasticsearch }} | ||
| imagePullPolicy: {{ .Values.images.pullPolicy }} | ||
| {{- if .Values.resources.enabled }} | ||
| resources: | ||
| limits: | ||
| cpu: {{ .Values.resources.limits.cpu }} | ||
| memory: {{ .Values.resources.limits.memory }} | ||
| requests: | ||
| cpu: {{ .Values.resources.requests.cpu }} | ||
| memory: {{ .Values.resources.requests.memory }} | ||
| {{- end }} | ||
| env: | ||
| - name: NAMESPACE | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.namespace | ||
| - name: NODE_NAME | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.name | ||
| - name: "CLUSTER_NAME" | ||
| value: {{ .Values.cluster_name }} | ||
| - name: NODE_MASTER | ||
| value: "false" | ||
| - name: NODE_INGEST | ||
| value: "false" | ||
| - name: HTTP_ENABLE | ||
| value: "false" | ||
| - name: "ES_JAVA_OPTS" | ||
| value: {{ .Values.es_java_opts.es_data }} | ||
| ports: | ||
| - containerPort: {{ .Values.network.discovery.port}} | ||
| name: {{ .Values.network.discovery.name}} | ||
| protocol: {{ .Values.network.discovery.protocol}} | ||
| volumeMounts: | ||
| - name: storage | ||
| mountPath: /data | ||
| volumes: | ||
| - name: storage | ||
| emptyDir: {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see these two partial templates used anywhere. If they're unnecessary, they should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes will delete this file if no usage found. Keeping it right now just in case if needed.