Finding the Redis service
WIth the Redis service up and running, we can now use it from our own Pod. As we mentioned previously, there are two ways to locate the service: an environment variable with a name based on the service will be set with the host IP and port, or you can use a DNS entry based on the name of the service.
The environment variables will only be set on Pods that are created after the service. If you still have the flask Pod up and running as per our previous example, then it will not show the environment variables. If we create a new Pod, even a temporary one, then it will include the service in the environment variables. This is because environment variables are set based on the state of Kubernetes at the time that the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access