Replies: 11 comments 1 reply
-
Thanks for opening an issue @cvatsops! Can you share what version of
|
Beta Was this translation helpful? Give feedback.
-
Hello @desertaxle Thanks for having a look into this issue. |
Beta Was this translation helpful? Give feedback.
-
Thanks @cvatsops! Could you share the entire stack trace from your error and also share a code example for how you are creating your |
Beta Was this translation helpful? Give feedback.
-
Sure. I am using below code : from prefect_kubernetes.credentials import KubernetesCredentials
k8s_credentials = KubernetesCredentials.load("k8s-creds") I have created a KubernetesCredentials block in Prefect UI called k8s-creds And then this is the below code: v1_job_metadata = create_namespaced_job(new_job=V1Job(yaml_manifest),kubernetes_credentials=k8s_credentials)
# Define the Kubernetes Job block
k8s_job = KubernetesJob(job=v1_job_metadata,namespace="commons")
job = KubernetesJob(
credentials=k8s_credentials,
# v1_job=yaml_manifest,
v1_job=yaml.safe_load(yaml_manifest),
namespace="commons",
delete_after_completion=True,
interval_seconds=5,
timeout_seconds=300
)
# Run the Kubernetes Job
run_namespaced_job(job) While running run_namespaced_job(job) , i am getting the below error:
|
Beta Was this translation helpful? Give feedback.
-
did you get the chance to check this ? @desertaxle |
Beta Was this translation helpful? Give feedback.
-
@cvatsops I think there might be an issue with the configuration of your import asyncio
from kubernetes_asyncio import config
async def main():
await config.load_kube_config_from_dict(
config_dict=YOUR_CONFIG_DICT,
context=YOUR_CONTEXT
)
if __name__ == "__main__":
asyncio.run(main()) The values for |
Beta Was this translation helpful? Give feedback.
-
I tested the above code which you provided and getting below error:
How will I now understand what's wrong in my configuration of your KubernetesClusterConfig block. |
Beta Was this translation helpful? Give feedback.
-
The apiVersion: v1
clusters:
- cluster:
certificate-authority-data: <ca-data-here>
server: https://your-k8s-cluster.com
name: <cluster-name>
contexts:
- context:
cluster: <cluster-name>
user: <cluster-name-user>
name: <cluster-name>
current-context: <cluster-name>
kind: Config
preferences: {}
users:
- name: <cluster-name-user>
user:
token: <secret-token-here> and the I don't think there's an issue with Prefect here, so I'm going to transfer this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Yes , i am using the same content of kubectl file which i use for my k8s cluster . |
Beta Was this translation helpful? Give feedback.
-
We had a same problem and decided not to try to migrate into 3.0. |
Beta Was this translation helpful? Give feedback.
-
@mikelogaciuk so which version is working fine for you ? |
Beta Was this translation helpful? Give feedback.
-
Bug summary
We have deployed a self-hosted Prefect(3.0.9) in our Kubernetes Cluster through helm chart and I am trying to run a Kubernetes Job but facing an issue.
I am trying to run a k8 job using below code:
and getting below error in when running run_namespaced_job(job):
Version info (
prefect version
output)Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions