Manan Kapoor
Manan Kapoor

Reputation: 327

How to provide inputs to a containerized application

I have recently started working on Docker, K8s and Argo. I am currently working on creating 2 containerized applications and then link them up in such a way that they can run on Argo. The 2 containerized applications would be as follows:

  1. ReadDataFromAFile: This container would have the code that would receive a url/file with some random names. It would separate out all those names and return an array/list of names.

  2. PrintData: This container would accept the list of names and then print them out with some business logic involved.

I am currently not able to understand how to:

  1. Pass text/file to the ReadData Container.
  2. Pass on the processed array of names from the first container to the second container.

I have to write an Argo Workflow that would regularly perform these steps!

Upvotes: 0

Views: 267

Answers (1)

mozello
mozello

Reputation: 1244

Posting this as Community wiki for better visibility with a general solution. Feel free to expand it.


Since you don't need to store any artifacts, the best options to pass data between Kubernetes Pods are (as @David Maze mentioned in his comment):

1. Pass the data in the body of HTTP POST requests.

There is a good article with examples of HTTP POST requests here.

POST is an HTTP method designed to send data to the server from an HTTP client. The HTTP POST method requests the web server accept the data enclosed in the body of the POST message.

2. Use a message broker, for example, RabbitMQ.

RabbitMQ is the most widely deployed open source message broker. It supports multiple messaging protocols. RabbitMQ can be deployed in distributed and federated configurations to meet high-scale, high-availability requirements.

RabbitMQ provides a wide range of developer tools for most popular languages.

You can install RabbitMQ into the Kubernetes cluster using the Bitnami Helm chart.

Upvotes: 1

Related Questions