This repository has been archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adding Example for Kubernetes KIND #274
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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
This file contains 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,12 @@ | ||
default: test | ||
|
||
RELEASE := helm-es-kind | ||
|
||
install: | ||
helm upgrade --wait --timeout=900 --install --values values.yaml $(RELEASE) ../../ | ||
|
||
test: install | ||
helm test $(RELEASE) | ||
|
||
purge: | ||
helm del --purge $(RELEASE) |
This file contains 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,37 @@ | ||
--- | ||
# Permit co-located instances for solitary minikube virtual machines. | ||
antiAffinity: "soft" | ||
|
||
# Shrink default JVM heap. | ||
esJavaOpts: "-Xmx128m -Xms128m" | ||
|
||
# Allocate smaller chunks of memory per pod. | ||
resources: | ||
requests: | ||
cpu: "100m" | ||
memory: "512M" | ||
limits: | ||
cpu: "1000m" | ||
memory: "512M" | ||
|
||
# Request smaller persistent volumes. | ||
volumeClaimTemplate: | ||
accessModes: [ "ReadWriteOnce" ] | ||
storageClassName: "hostpath" | ||
resources: | ||
requests: | ||
storage: 100M | ||
extraInitContainers: | | ||
- name: create | ||
image: busybox:1.28 | ||
command: ['mkdir', '/usr/share/elasticsearch/data/nodes/'] | ||
volumeMounts: | ||
- mountPath: /usr/share/elasticsearch/data | ||
name: elasticsearch-master | ||
- name: file-permissions | ||
image: busybox:1.28 | ||
command: ['chown', '-R', '1000:1000', '/usr/share/elasticsearch/'] | ||
volumeMounts: | ||
- mountPath: /usr/share/elasticsearch/data | ||
name: elasticsearch-master | ||
|
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.
Could you explain why these extra init containers are needed for a kind deployment? The chart is already correctly setting the permissions and the elasticsearch process should be creating those directories.
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.
@Crazybus yeah.. that is needed for KIND.. for some reason the container doesn't create that by default and the whole deployment was failing. You can give it a try and see if you find the reason why the container is failing to do so.. I couldn't see anything in the logs except for an exception saying that it didn't had access to write the files in the
/usr/share/elasticsearch/data/nodes/
directory. Once the directory is created, everything works as expected.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.
Thanks, I'll certainly give it a go to see if I can reproduce it. Seems like a bit of a shame that kind doesn't seem to be compatible with the way that normal kubernetes works though :(. It makes sense that resources and node anti affinity need to be relaxed but this makes it impossible to properly test with kind.
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.
It should be super straight forward to reproduce it and find the cause if you can debug the ElasticSearch container. But for now that is needed.
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.
@Crazybus also I notice that for KIND this is required:
storageClassName: "standard"
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.
Sorry that I haven't gotten around to testing this out just yet. Did you also try just leaving
storageClassName
out completely? That should just use whatever the default is set to which is probably "standard"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.
that is true.. I am removing that line completely