https://flyte.org logo
#ask-the-community
Title
# ask-the-community
a

Abhinay Dronavally

05/16/2023, 4:33 AM
Hello, How to configure S3 and Postgres from Environment variables in Kubernetes cluster?
s

Samhita Alla

05/16/2023, 7:26 AM
Are you trying to deploy Flyte on EKS?
a

Abhinay Dronavally

05/16/2023, 9:42 AM
Yes Samhita
I am trying to run flyte in single binary mode on Kubernetes with Postgres and AWS S3 config. Is there any sample config available to test it?
Is there a way to run it on a ec2 instance instead of container?
s

Samhita Alla

05/16/2023, 1:14 PM
d

David Espejo (he/him)

05/16/2023, 3:49 PM
@Abhinay Dronavally there's also a community-maintained guide for the process: https://github.com/davidmirror-ops/flyte-the-hard-way/
a

Abhinay Dronavally

05/16/2023, 4:06 PM
@David Espejo (he/him) - was following the same.
@Samhita Alla - I have tried the link you have shared, I see no error and container is crashing.
s

Samhita Alla

05/17/2023, 4:10 AM
Are you still seeing issues, Abhinay?
a

Abhinay Dronavally

05/17/2023, 10:17 AM
Yes @Samhita Alla. We are unable to bring up cluster yet. We are seeing this issue now.
Copy code
{"json":{},"level":"warning","msg":"stow configuration section missing, defaulting to legacy s3/minio connection config","ts":"2023-05-17T10:14:52Z"}

{"json":{},"level":"warning","msg":"stow configuration section missing, defaulting to legacy s3/minio connection config","ts":"2023-05-17T10:14:55Z"}

{"json":{},"level":"warning","msg":"Failed to create cluster resources for namespace [flytesnacks-development] with err: Failed to read config template dir [flytesnacks-development] for namespace [] with err: open : no such file or directory","ts":"2023-05-17T10:14:55Z"}
{"json":{},"level":"warning","msg":"Failed to create cluster resources for namespace [flytesnacks-staging] with err: Failed to read config template dir [flytesnacks-staging] for namespace [] with err: open : no such file or directory","ts":"2023-05-17T10:14:55Z"}
{"json":{},"level":"warning","msg":"Failed to create cluster resources for namespace [flytesnacks-production] with err: Failed to read config template dir [flytesnacks-production] for namespace [] with err: open : no such file or directory","ts":"2023-05-17T10:14:55Z"}
{"json":{},"level":"warning","msg":"Failed cluster resource creation loop with: Failed to read config template dir [flytesnacks-development] for namespace [] with err: open : no such file or directory, Failed to read config template dir [flytesnacks-staging] for namespace [] with err: open : no such file or directory, Failed to read config template dir [flytesnacks-production] for namespace [] with err: open : no such file or directory","ts":"2023-05-17T10:14:55Z"}

{"json":{},"level":"error","msg":"Failed to initialize certificates for Secrets Webhook. client rate limiter Wait returned an error: context canceled","ts":"2023-05-17T10:14:57Z"}
{"json":{},"level":"panic","msg":"Failed to start Propeller, err: failed to create FlyteWorkflow CRD: <http://customresourcedefinitions.apiextensions.k8s.io|customresourcedefinitions.apiextensions.k8s.io> is forbidden: User \"system:serviceaccount:<workspace_name>:flyte\" cannot create resource \"customresourcedefinitions\" in API group \"<http://apiextensions.k8s.io|apiextensions.k8s.io>\" at the cluster scope","ts":"2023-05-17T10:14:57Z"}
s

Samhita Alla

05/17/2023, 11:35 AM
Are you following the guide that @David Espejo (he/him) shared?
a

Abhinay Dronavally

05/17/2023, 11:36 AM
Yeah.
Helm is working, but single binary seems not to be working.
Can you share environment variables or config file with dummy values to connect to aws s3 and aws rds postgres instance.
s

Samhita Alla

05/17/2023, 11:40 AM
a

Abhinay Dronavally

05/17/2023, 11:44 AM
We tried this, this worked. But we want to simplify this even further with env variables injection.
Also, what is the significance of
Copy code
annotations:
    <http://eks.amazonaws.com/role-arn|eks.amazonaws.com/role-arn>: "arn:aws:iam::<aws-account-id>:role/flyte-system-role"
We tried this, this worked. But we want to simplify this even further with env variables injection.
@David Espejo (he/him), do you know how to do this?
a

Abhinay Dronavally

05/17/2023, 11:59 AM
Is there a way to configure flyte without giving role ARN, by giving access to EKS host and port?
d

David Espejo (he/him)

05/17/2023, 6:33 PM
Is there a way to configure flyte without giving role ARN, by giving access to EKS host and port?
@Abhinay Dronavally IAM Roles for Service Accounts is the recommended approach, and as far as I can tell the chart itself is designed to accept a Service Account annotated with an IAM role. What's your use case here?
a

Abhinay Dronavally

05/17/2023, 6:35 PM
We are running light weight data processing pipeline. We already have EKS with decent capacity. So, we are checking if there is a way to ignore ARN as we already provide Kubernetes config.
d

David Espejo (he/him)

05/17/2023, 6:37 PM
Typically Flyte is deployed on a dedicated EKS cluster, and an IAM role can be used by multiple EKS clusters
a

Abhinay Dronavally

05/17/2023, 6:37 PM
Okay.
In a single EKS cluster setups, is that optional?
d

David Espejo (he/him)

05/17/2023, 6:38 PM
Absolutely!
You mean, single worker node?
a

Abhinay Dronavally

05/17/2023, 6:38 PM
No, I mean multiple nodes in a single EKS cluster.
d

David Espejo (he/him)

05/17/2023, 6:39 PM
yes, it's totally fine. The example guide uses two compute (worker) nodes in a cluster
a

Abhinay Dronavally

05/17/2023, 6:41 PM
Can you share a holy bible of flight which I can follow for config management?
Also, is there a way to inject env variables for AWS S3 and Postgres like the way we do for Kubernetes config?
d

David Espejo (he/him)

05/17/2023, 6:43 PM
Can you share a holy bible of flight which I can follow for config management?
Sure but, in this context, what do you mean by
configuration management
?
a

Abhinay Dronavally

05/17/2023, 6:44 PM
AWS S3 bucket specific access, and RDS configuration etc.
d

David Espejo (he/him)

05/17/2023, 6:45 PM
Also, is there a way to inject env variables for AWS S3 and Postgres like the way we do for Kubernetes config?
All the env vars that I see accepted by the chart are in
values
or under
extraEnvVars
(again in
values
) There is a way to inject env vars but at the task level (using Pod Templates), not that I know for the backend
a

Abhinay Dronavally

05/17/2023, 6:48 PM
I am looking to run Flyte on a single binary setup, with postgres and S3 credentials injected in env variables.
Thank you for podtemplate link @David Espejo (he/him)
I am looking to run Flyte on a single binary setup, with postgres and S3 credentials injected in env variables. - Is there a way to do this?
d

David Espejo (he/him)

05/17/2023, 6:57 PM
oh credentials
you could put them ina K8s secret and mount the secret
inject credentials via env vars is not recommended in general
see here how a Flyte user uses the ExternalSecrets operator to store and inject credentials: https://github.com/alexifm/flyte-eks-deployment
a

Abhinay Dronavally

05/18/2023, 4:20 AM
Okay, thank you @David Espejo (he/him).
11 Views