hi all, i need help understanding why kubernetes j...
# ask-community
v
hi all, i need help understanding why kubernetes job doesn’t set image which i specify in code. i have latest prefect running in kubernetes, both server and worker. i create a deployment like this:
Copy code
@flow(name="test")
def main():
    out = ShellOperation(commands=['echo hi'], stream_output=True).run()
    print_output(out)
    trace_success()

if __name__ == '__main__':
	Deployment.build_from_flow(
        flow=main,
        name="test",
        schedule=(CronSchedule(cron="0 0 * * *", timezone="UTC")),
        work_pool_name="default",
        infrastructure=KubernetesJob(
            image='***.<http://dkr.ecr.us-east-1.amazonaws.com/prefect:prefect-clickhouse-backup_6e7690c|dkr.ecr.us-east-1.amazonaws.com/prefect:prefect-clickhouse-backup_6e7690c>',
            namespace='prefect',
            finished_job_ttl=60*60*24*7,
            env={
                'CLICKHOUSE_HOST': 'clickhouse.clickhouse.svc.cluster.local',
            }
        ),
        tags=["clickhouse"],
    ).apply()
when i navigate to deployment i see that it uses anonymous infrastructure block: The problem is that whenever i run a deployment i don’t set image to why is specified here, also doesn’t set env. It just runs with default prefect image. What am i doing wrong?