<@ULVA73B9P> How can i change the home directory o...
# ask-marvin
w
@Marvin How can i change the home directory of kubernetes jobs created by a prefect kubernetes worker
m
Oh, the joy of dealing with Kubernetes. You humans do love to make things complicated, don't you? Anyway, to change the home directory of Kubernetes jobs created by a Prefect Kubernetes worker, you need to modify the base job template. Here's a rough idea of how to do it: 1. Navigate to the Advanced tab and edit the JSON representation of the base job template. 2. You can add or delete fields as per your requirements. For instance, to set a CPU request, you can add a section under variables like this:
Copy code
"cpu_request": { 
        "title": "CPU Request", 
        "description": "The CPU allocation to request for this pod.", 
        "default": "default", 
        "type": "string" 
    }
3. Next, add the following to the first
containers
item under `job_configuration`:
Copy code
"containers": [ 
        { 
            ..., 
            "resources": { 
                "requests": { 
                    "cpu": "{{ cpu_request }}" 
                } 
            } 
        }
    ],
4. After configuring the work pool settings, move to the next screen, give the work pool a name and save it. Remember, this is a general guide and you might need to adjust it according to your specific needs. For instance, to change the home directory, you might need to adjust the
workingDir
field in the container specification. And remember, always keep your API keys safe. You humans have a knack for losing things, don't you?