You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Mads Ellersgaard Kalør <me...@kaunt.com> on 2022/05/23 13:19:41 UTC

Flink Kubernetes Operator: Specifying env variables from ConfigMaps

Hi,

We use a number of environment variables to configure our Flink pipelines, such as Kafka connection info, hostnames for external services etc. This works well when running a standalone Kubernetes deployment or on a local environment in Docker, but I cannot find any documentation about how to specify environment variables (from ConfigMaps or Secrets) in the Flink Kubernetes Operator (I would expect it to be in the JobSpec part of the FlinkDeploymentSpec).

Do I have to create a PodTemplate, or is there a simpler way?


Thanks,

Mads

Re: Flink Kubernetes Operator: Specifying env variables from ConfigMaps

Posted by Mads Ellersgaard Kalør <me...@kaunt.com>.
Hi,

Thanks a lot for your clarifications. It makes perfect sense.

Mads
________________________________
From: Gyula Fóra <gy...@gmail.com>
Sent: 23 May 2022 15:39
To: Mads Ellersgaard Kalør <me...@kaunt.com>
Cc: user@flink.apache.org <us...@flink.apache.org>
Subject: Re: Flink Kubernetes Operator: Specifying env variables from ConfigMaps

Hi Mads!

I think you need to use the podTemplate for this. You can either do it in the top level spec or customize it for tm/jm respectively.

Keep in mind that pod templates are merged with the base flink template so it's enough to specify the fields relevant for you (in these case the env variables for the main container).
So it should be fairly simple :)

Let us know if you hit any issues.

Cheers
Gyula

On Mon, May 23, 2022 at 6:20 AM Mads Ellersgaard Kalør <me...@kaunt.com>> wrote:
Hi,

We use a number of environment variables to configure our Flink pipelines, such as Kafka connection info, hostnames for external services etc. This works well when running a standalone Kubernetes deployment or on a local environment in Docker, but I cannot find any documentation about how to specify environment variables (from ConfigMaps or Secrets) in the Flink Kubernetes Operator (I would expect it to be in the JobSpec part of the FlinkDeploymentSpec).

Do I have to create a PodTemplate, or is there a simpler way?


Thanks,

Mads

Re: Flink Kubernetes Operator: Specifying env variables from ConfigMaps

Posted by Gyula Fóra <gy...@gmail.com>.
Hi Mads!

I think you need to use the podTemplate for this. You can either do it in
the top level spec or customize it for tm/jm respectively.

Keep in mind that pod templates are merged with the base flink template so
it's enough to specify the fields relevant for you (in these case the env
variables for the main container).
So it should be fairly simple :)

Let us know if you hit any issues.

Cheers
Gyula

On Mon, May 23, 2022 at 6:20 AM Mads Ellersgaard Kalør <me...@kaunt.com>
wrote:

> Hi,
>
> We use a number of environment variables to configure our Flink pipelines,
> such as Kafka connection info, hostnames for external services etc. This
> works well when running a standalone Kubernetes deployment or on a local
> environment in Docker, but I cannot find any documentation about how to
> specify environment variables (from ConfigMaps or Secrets) in the Flink
> Kubernetes Operator (I would expect it to be in the JobSpec part of the
> FlinkDeploymentSpec).
>
> Do I have to create a PodTemplate, or is there a simpler way?
>
>
> Thanks,
>
> Mads
>