Only download kubectl and provide volume if graylog version is < 4.2.0-0#154
Only download kubectl and provide volume if graylog version is < 4.2.0-0#154tuxBurner wants to merge 3 commits intoKongZ:mainfrom
Conversation
Signed-off-by: tuxBurner <s.hardt@micromata.de>
|
The |
|
Aaah okay sorry have overseen this |
|
@KongZ do we really need this mechamism ? As stated in https://go2docs.graylog.org/5-0/downloading_and_installing_graylog/docker_installation.htm#KubernetesAutomaticMasterSelection we only need to set the POD_NAME env var. The /docker-entrypoint.sh has a part like this # check if we are inside kubernetes, Graylog should be run as statefulset and $POD_NAME env var should be defined like this
# env:
# - name: POD_NAME
# valueFrom:
# fieldRef:
# fieldPath: metadata.name
# First stateful member is having pod name ended with -0, so
if [[ ! -z "${POD_NAME}" ]]
then
if echo "${POD_NAME}" | grep "\\-0$" >/dev/null
then
export GRAYLOG_IS_LEADER="true"
else
export GRAYLOG_IS_LEADER="false"
fi
fi |
|
The solution described in the doc above will hard-code pod-0 to be the master. I believe the recent Graylog versions are stable and we should be able to use pod-0 as the master but I do not have a chance to test them. |
|
@KongZ i commented your script out which determines which is the master node and added the suggested env var POD_NAME It works on my installation :) |
|
I'm using this change as well and it works much better, especially with the pod security settings (chown is disallowed) but I get an error that there are multiple leaders in the cluster. |
| /k8s/kubectl --namespace {{ .Release.Namespace }} label --overwrite pod $HOSTNAME graylog-role="coordinating" | ||
| fi | ||
| fi | ||
| #for i in {0..2} |
There was a problem hiding this comment.
@tuxBurner sorry for being late. Instead of commenting out, it would be better to delete them from manifest.
| rm -rf /usr/share/graylog/data/journal/messagejournal-0 | ||
| rm -rf /usr/share/graylog/data/journal/recovery-point-offset-checkpoint | ||
| {{- end }} | ||
| {{- if semverCompare "< 4.2.0-0" ( $graylogVersion ) }} |
There was a problem hiding this comment.
The Graylog 4 is very out of date. We can say the chart no longer supports Graylog version < 4.2.
You can remove all kubectl related.
| name: graylog | ||
| home: https://www.graylog.org | ||
| version: 2.3.4 | ||
| version: 2.3.5 |
There was a problem hiding this comment.
Please bump chart version one more.
|
@KongZ can close this out now |
Only download kubectl and provide volume if graylog version is < 4.2.0-0
I recognized that the kubectl is always downloaded. But it is only used in the lifecycle whe tne graylog version is < 4.2.0-0
Which issue this PR fixes
Special notes for your reviewer
Checklist