Extract WordPress URL
export WORDPRESS_IP=$(kubectl get svc -n wordpress wordpress-kubernetes -o jsonpath='{.status.loadBalancer.ingress[*].ip}')
echo "WordPress URL: http://$WORDPRESS_IP/"
echo "WordPress Admin URL: http://$WORDPRESS_IP/admin"
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hey,
Thank you for sharing this method for extracting the WordPress URL in a Kubernetes environment on a DigitalOcean Droplet. Your contribution is greatly appreciated by the community!
To add a bit more context for others who might come across this post: the command you’ve shared is a handy way to quickly retrieve the IP address of a WordPress service running in a Kubernetes cluster. This is particularly useful when the service is exposed via a LoadBalancer, which is common in cloud environments like DigitalOcean.
By executing
export WORDPRESS_IP=$(kubectl get svc -n wordpress wordpress-kubernetes -o jsonpath='{.status.loadBalancer.ingress[*].ip}')
, you’re setting an environment variableWORDPRESS_IP
with the IP address of the WordPress service. Then, usingecho "WordPress URL: http://$WORDPRESS_IP/"
andecho "WordPress Admin URL: http://$WORDPRESS_IP/admin"
, you can easily access both the main site and the admin panel.Thanks again for your valuable input! Feel free to share more tips or ask questions in our community.
Best,
Bobby
Heya @e363a183d9c44a9b8c77c619516fb5,
Can you provide a little bit more information, what exactly do you want to access and what issues are your experiencing in your attempts?