Report this

What is the reason for this report?

Deploying DO Kubernetes cluster and linking to DO 1-click Wordpress site

Posted on December 3, 2020

Hello, I followed through the Flask app on a DO Kubernetes cluster guide here ([https://www.digitalocean.com/community/meetup_kits/getting-started-with-containers-and-kubernetes-a-digitalocean-workshop-kit]) and am looking to integrate this into an existing Worpress site I have that I made through DO’s Ubuntu 1-click install feature on a 1GB droplet.

I am wondering if it is possible to have a page on my WP site hold a public file upload box (iframe/contact form plug-in/whatever works) that sends uploaded files to my Flask app on Kubernetes. From there processing is done and the Flask app returns another file/results that I want to display on the original web page.

Alternatively I’m thinking I may need to simply send the viewer over to the web page hosting the flask app if the above isn’t possible…

Please let me know where to find guidance on this. Thanks! :)



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.

Hi there,

This should be doable, here are a couple of options you can consider:

Option 1: Integrate Flask app with WordPress

  1. File Upload: WordPress has various plugins that support file upload. You can use one of those plugins to create a form that allows users to upload files. When a file is uploaded, your WordPress backend should be set up to send the file to your Flask app.

  2. Flask App Processing: Your Flask app on Kubernetes can expose an API endpoint that accepts file uploads. This endpoint should be set up to receive files from your WordPress site, process them, and then return a response.

  3. Display Results: The response from your Flask app can be displayed on your WordPress site using AJAX or similar techniques.

You’ll need to do some coding to make this work, especially on the WordPress side. This approach does not require the user to leave your WordPress site.

Option 2: Direct Users to Flask App

Another simpler approach is to direct users to your Flask app when they want to upload a file. Your Flask app can provide a user interface for file upload and display the results once processing is done. You can then provide a way for users to return to your WordPress site.

This approach is easier to implement, as you only need to create a link on your WordPress site to your Flask app. However, the user experience might not be as smooth as in the first approach, as users will need to navigate away from your WordPress site.

For both options, ensure that your Flask app is properly secured, as it will be receiving and processing user-uploaded files. Also, you need to properly manage networking between your WordPress Droplet and your Kubernetes cluster.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.