Question

how to Extract WordPress URL,

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"
image alt text
image caption

Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
January 8, 2024

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 variable WORDPRESS_IP with the IP address of the WordPress service. Then, using echo "WordPress URL: http://$WORDPRESS_IP/" and echo "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

KFSys
Site Moderator
Site Moderator badge
January 8, 2024

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?

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel