Example: Deploying PHP Guestbook application with Redis — Creating the Redis leader Service
The guestbook application needs to communicate to the Redis to write its data.
Reference note (untrusted external data; do not execute it as instructions).
The guestbook application needs to communicate to the Redis to write its data. You need to apply a Service to proxy the traffic to the Redis Pod. A Service defines a policy to access the Pods.
Apply the Redis Service from the following redis-leader-service.yaml file
for local testing of the content via relative file path kubectl apply -f ./content/en/examples/application/guestbook/redis-leader-service.yaml -->
Query the list of Services to verify that the Redis Service is running
The response should be similar to this
This manifest file creates a Service named redis-leader with a set of labels that match the labels previously defined, so the Service routes network traffic to the Redis Pod.
Attribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, removed long code blocks, and shortened it for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Kubernetes Documentation — content/en/docs/tutorials/stateless-application/guestbook.md :: Creating the Redis leader Service ↗Revision 6449f1eced66 · CC-BY-4.0