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

It should be $(HOSTNAME) but not $(hostname) #16

Open
matthklo opened this issue Mar 20, 2019 · 3 comments
Open

It should be $(HOSTNAME) but not $(hostname) #16

matthklo opened this issue Mar 20, 2019 · 3 comments

Comments

@matthklo
Copy link

It should be $(HOSTNAME) but not $(hostname) in both readinessProbe and livenessProbe part of redis-cluster.yml. I think $(hostname) will be resolved as empty string which makes the redis-cli command ends up as blocking in the interactive mode.

@sanderploegsma
Copy link
Owner

I don't think your assumption is correct though, hostname is a function that is invoked in the container. If it somehow returns an empty string, maybe it should be something else entirely, but $(HOSTNAME) would invoke the function HOSTNAME, which doesn't seem right.

@matthklo
Copy link
Author

Well, maybe I was wrong because I'm new to Kubernetes. But according to the doc here, the pattern '$(something)' in config should be replaced with the content of the environment variable named 'something'. In your case, '$(hostname)' will be replaced with the content of the environment variable named 'hostname', which does not exist. I guess what you intended to use was '$(HOSTNAME)', since the HOSTNAME environment variable will be defined on container starts.

@sanderploegsma
Copy link
Owner

Hmm, interesting. I don't recall it working this way in earlier Kubernetes versions. Anyway, I didn't intend to use the value of the environment variable HOSTNAME, but instead I wanted to execute /bin/hostname, which should print the hostname of the pod.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants